Skip to content

Commit

Permalink
fix: Fabricv4 patch project response (#58)
Browse files Browse the repository at this point in the history
* Removed required field for `projectId` from project model to resolve
customer issue with Terraform Provider
  * equinix/terraform-provider-equinix#657
* Error is caused by Equinix Fabric API returning an empty project
`project: {}` in the JSON response for PDS user accounts
* Adding temporary patch until Equinix Fabric API teams remove the empty
project from the API response
* Does affect request models as well, but the API will return the error
that project is required for those requests. Will revert as soon as we
can
  • Loading branch information
thogarty committed May 7, 2024
2 parents e2cf064 + caea8fd commit dd062b8
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 306 deletions.
1 change: 0 additions & 1 deletion services/fabricv4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ Class | Method | HTTP request | Description
- [PortResponseBmmrType](docs/PortResponseBmmrType.md)
- [PortResponseConnectivitySourceType](docs/PortResponseConnectivitySourceType.md)
- [PortResponsePhysicalPortsType](docs/PortResponsePhysicalPortsType.md)
- [PortResponseProject](docs/PortResponseProject.md)
- [PortResponseServiceType](docs/PortResponseServiceType.md)
- [PortSearchFieldName](docs/PortSearchFieldName.md)
- [PortSettings](docs/PortSettings.md)
Expand Down
8 changes: 4 additions & 4 deletions services/fabricv4/docs/Port.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Name | Type | Description | Notes
**PhysicalPortsCount** | Pointer to **int32** | | [optional]
**ConnectivitySourceType** | [**PortResponseConnectivitySourceType**](PortResponseConnectivitySourceType.md) | |
**BmmrType** | Pointer to [**PortResponseBmmrType**](PortResponseBmmrType.md) | | [optional]
**Project** | Pointer to [**PortResponseProject**](PortResponseProject.md) | | [optional]
**Project** | Pointer to [**Project**](Project.md) | | [optional]
**State** | Pointer to [**PortState**](PortState.md) | | [optional]
**Order** | Pointer to [**PortOrder**](PortOrder.md) | | [optional]
**CvpId** | Pointer to **string** | Equinix assigned response attribute for Unique ID for a virtual port. | [optional]
Expand Down Expand Up @@ -366,20 +366,20 @@ HasBmmrType returns a boolean if a field has been set.

### GetProject

`func (o *Port) GetProject() PortResponseProject`
`func (o *Port) GetProject() Project`

GetProject returns the Project field if non-nil, zero value otherwise.

### GetProjectOk

`func (o *Port) GetProjectOk() (*PortResponseProject, bool)`
`func (o *Port) GetProjectOk() (*Project, bool)`

GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetProject

`func (o *Port) SetProject(v PortResponseProject)`
`func (o *Port) SetProject(v Project)`

SetProject sets Project field to given value.

Expand Down
8 changes: 4 additions & 4 deletions services/fabricv4/docs/PortResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Name | Type | Description | Notes
**PhysicalPortsCount** | Pointer to **int32** | | [optional]
**ConnectivitySourceType** | Pointer to [**PortResponseConnectivitySourceType**](PortResponseConnectivitySourceType.md) | | [optional]
**BmmrType** | Pointer to [**PortResponseBmmrType**](PortResponseBmmrType.md) | | [optional]
**Project** | Pointer to [**PortResponseProject**](PortResponseProject.md) | | [optional]
**Project** | Pointer to [**Project**](Project.md) | | [optional]
**State** | Pointer to [**PortState**](PortState.md) | | [optional]
**Order** | Pointer to [**PortOrder**](PortOrder.md) | | [optional]
**CvpId** | Pointer to **string** | Equinix assigned response attribute for Unique ID for a virtual port. | [optional]
Expand Down Expand Up @@ -366,20 +366,20 @@ HasBmmrType returns a boolean if a field has been set.

### GetProject

`func (o *PortResponse) GetProject() PortResponseProject`
`func (o *PortResponse) GetProject() Project`

GetProject returns the Project field if non-nil, zero value otherwise.

### GetProjectOk

`func (o *PortResponse) GetProjectOk() (*PortResponseProject, bool)`
`func (o *PortResponse) GetProjectOk() (*Project, bool)`

GetProjectOk returns a tuple with the Project field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetProject

`func (o *PortResponse) SetProject(v PortResponseProject)`
`func (o *PortResponse) SetProject(v Project)`

SetProject sets Project field to given value.

Expand Down
56 changes: 0 additions & 56 deletions services/fabricv4/docs/PortResponseProject.md

This file was deleted.

9 changes: 7 additions & 2 deletions services/fabricv4/docs/Project.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ProjectId** | **string** | Subscriber-assigned project ID |
**ProjectId** | Pointer to **string** | Subscriber-assigned project ID | [optional]

## Methods

### NewProject

`func NewProject(projectId string, ) *Project`
`func NewProject() *Project`

NewProject instantiates a new Project object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -44,6 +44,11 @@ and a boolean to check if the value has been set.

SetProjectId sets ProjectId field to given value.

### HasProjectId

`func (o *Project) HasProjectId() bool`

HasProjectId returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
2 changes: 1 addition & 1 deletion services/fabricv4/docs/RouteFiltersApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ import (
)

func main() {
routeFiltersBase := *openapiclient.NewRouteFiltersBase(openapiclient.ConnectionRouteFilterData_type("BGP_IPv4_PREFIX_FILTER"), "My-direct-route-1", *openapiclient.NewProject("44f4c4f8-2f39-494e-838c-d8e640591be5")) // RouteFiltersBase |
routeFiltersBase := *openapiclient.NewRouteFiltersBase(openapiclient.ConnectionRouteFilterData_type("BGP_IPv4_PREFIX_FILTER"), "My-direct-route-1", *openapiclient.NewProject()) // RouteFiltersBase |

configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
Expand Down
12 changes: 6 additions & 6 deletions services/fabricv4/model_port.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions services/fabricv4/model_port_response.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dd062b8

Please sign in to comment.