diff --git a/CHANGELOG.md b/CHANGELOG.md index e9049f4..c350efc 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [v1.0.0-beta.35](https://github.com/fastly/fastly-go/releases/tag/release/v1.0.0-beta.35) (2024-09-13) + +**Bug fixes:** + +- bugfix(rust): Implement std::fmt::Display instead of std::string::ToString for enum models. +- fix(contact): Corrected endpoint called by `delete-contact` operation +- fix(origin-inspector, domain-inspector): Use integer type for Timestamp. +- fix(billing): Make all fields on billing list item data nullable + +**Enhancements:** + +- feat(acls-in-compute): Add ACLs in Compute API +- feat(enabled-products): Updated to use `v1` versioned endpoints. +- feat(enabled-products): Added `get-product-configuration`, `set-product-configuration` operations. +- feat(realtime, historical): Added `request_denied_get_head_body` metric. +- feat(tls): Add definitions for values of sort parameter +- feat(staging): Add activate/deactivate endpoints for staging +- feat(customer-addresses): Add Customer Addresses API + +**Documentation:** + +- doc(enabled-products): Added support for product IDs `bot_management` and `ngwaf`. + ## [v1.0.0-beta.34](https://github.com/fastly/fastly-go/releases/tag/release/v1.0.0-beta.34) (2024-08-21) **Bug fixes:** diff --git a/README.md b/README.md index 77e69e7..f7b8eda 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Add the following to your project's `go.mod`: ```go.mod require ( - github.com/fastly/fastly-go 1.0.0-beta.34 + github.com/fastly/fastly-go 1.0.0-beta.35 ) ``` @@ -80,6 +80,13 @@ Class | Method | Description *ACLEntryAPI* | [**GetACLEntry**](docs/AclEntryAPI.md#getaclentry) | Describe an ACL entry *ACLEntryAPI* | [**ListACLEntries**](docs/AclEntryAPI.md#listaclentries) | List ACL entries *ACLEntryAPI* | [**UpdateACLEntry**](docs/AclEntryAPI.md#updateaclentry) | Update an ACL entry +*ACLsInComputeAPI* | [**ComputeACLCreateACLs**](docs/AclsInComputeAPI.md#computeaclcreateacls) | Create a new ACL +*ACLsInComputeAPI* | [**ComputeACLDeleteSACLID**](docs/AclsInComputeAPI.md#computeacldeletesaclid) | Delete an ACL +*ACLsInComputeAPI* | [**ComputeACLListACLEntries**](docs/AclsInComputeAPI.md#computeacllistaclentries) | List an ACL +*ACLsInComputeAPI* | [**ComputeACLListACLs**](docs/AclsInComputeAPI.md#computeacllistacls) | List ACLs +*ACLsInComputeAPI* | [**ComputeACLListACLsSAclID**](docs/AclsInComputeAPI.md#computeacllistaclssaclid) | Describe an ACL +*ACLsInComputeAPI* | [**ComputeACLLookupACLs**](docs/AclsInComputeAPI.md#computeacllookupacls) | Lookup an ACL +*ACLsInComputeAPI* | [**ComputeACLUpdateACLs**](docs/AclsInComputeAPI.md#computeaclupdateacls) | Update an ACL *ApexRedirectAPI* | [**CreateApexRedirect**](docs/ApexRedirectAPI.md#createapexredirect) | Create an apex redirect *ApexRedirectAPI* | [**DeleteApexRedirect**](docs/ApexRedirectAPI.md#deleteapexredirect) | Delete an apex redirect *ApexRedirectAPI* | [**GetApexRedirect**](docs/ApexRedirectAPI.md#getapexredirect) | Get an apex redirect @@ -140,6 +147,9 @@ Class | Method | Description *CustomerAPI* | [**GetLoggedInCustomer**](docs/CustomerAPI.md#getloggedincustomer) | Get the logged in customer *CustomerAPI* | [**ListUsers**](docs/CustomerAPI.md#listusers) | List users *CustomerAPI* | [**UpdateCustomer**](docs/CustomerAPI.md#updatecustomer) | Update a customer +*CustomerAddressesAPI* | [**CreateCustomerAddress**](docs/CustomerAddressesAPI.md#createcustomeraddress) | Creates an address associated with a customer account. +*CustomerAddressesAPI* | [**ListCustomerAddresses**](docs/CustomerAddressesAPI.md#listcustomeraddresses) | Return the list of addresses associated with a customer account. +*CustomerAddressesAPI* | [**UpdateCustomerAddress**](docs/CustomerAddressesAPI.md#updatecustomeraddress) | Updates an address associated with a customer account. *DictionaryAPI* | [**CreateDictionary**](docs/DictionaryAPI.md#createdictionary) | Create an edge dictionary *DictionaryAPI* | [**DeleteDictionary**](docs/DictionaryAPI.md#deletedictionary) | Delete an edge dictionary *DictionaryAPI* | [**GetDictionary**](docs/DictionaryAPI.md#getdictionary) | Get an edge dictionary @@ -177,6 +187,8 @@ Class | Method | Description *EnabledProductsAPI* | [**DisableProduct**](docs/EnabledProductsAPI.md#disableproduct) | Disable a product *EnabledProductsAPI* | [**EnableProduct**](docs/EnabledProductsAPI.md#enableproduct) | Enable a product *EnabledProductsAPI* | [**GetEnabledProduct**](docs/EnabledProductsAPI.md#getenabledproduct) | Get enabled product +*EnabledProductsAPI* | [**GetProductConfiguration**](docs/EnabledProductsAPI.md#getproductconfiguration) | Get configuration for a product +*EnabledProductsAPI* | [**SetProductConfiguration**](docs/EnabledProductsAPI.md#setproductconfiguration) | Update configuration for a product *EventsAPI* | [**GetEvent**](docs/EventsAPI.md#getevent) | Get an event *EventsAPI* | [**ListEvents**](docs/EventsAPI.md#listevents) | List events *GzipAPI* | [**CreateGzipConfig**](docs/GzipAPI.md#creategzipconfig) | Create a gzip configuration @@ -573,9 +585,11 @@ Class | Method | Description *VclAPI* | [**UpdateCustomVcl**](docs/VclAPI.md#updatecustomvcl) | Update a custom VCL file *VclDiffAPI* | [**VclDiffServiceVersions**](docs/VclDiffAPI.md#vcldiffserviceversions) | Get a comparison of the VCL changes between two service versions *VersionAPI* | [**ActivateServiceVersion**](docs/VersionAPI.md#activateserviceversion) | Activate a service version +*VersionAPI* | [**ActivateServiceVersionEnvironment**](docs/VersionAPI.md#activateserviceversionenvironment) | Activate a service version on the specified environment *VersionAPI* | [**CloneServiceVersion**](docs/VersionAPI.md#cloneserviceversion) | Clone a service version *VersionAPI* | [**CreateServiceVersion**](docs/VersionAPI.md#createserviceversion) | Create a service version *VersionAPI* | [**DeactivateServiceVersion**](docs/VersionAPI.md#deactivateserviceversion) | Deactivate a service version +*VersionAPI* | [**DeactivateServiceVersionEnvironment**](docs/VersionAPI.md#deactivateserviceversionenvironment) | Deactivate a service version on an environment *VersionAPI* | [**GetServiceVersion**](docs/VersionAPI.md#getserviceversion) | Get a version of a service *VersionAPI* | [**ListServiceVersions**](docs/VersionAPI.md#listserviceversions) | List versions of a service *VersionAPI* | [**LockServiceVersion**](docs/VersionAPI.md#lockserviceversion) | Lock a service version @@ -640,6 +654,8 @@ The fastly-go API client currently does not support the following endpoints: - [`/alerts/history`](https://www.fastly.com/documentation/reference/api/observability/alerts/history) (GET) - [`/dns/configurations/{dns_configuration_id}`](https://www.fastly.com/documentation/reference/api/) (DELETE, GET, PATCH) - [`/dns/configurations`](https://www.fastly.com/documentation/reference/api/) (GET, POST) +- [`/domains/{domain_id}`](https://www.fastly.com/documentation/reference/api/) (DELETE, GET, PATCH) +- [`/domains`](https://www.fastly.com/documentation/reference/api/) (GET, POST) - [`/notifications/integration-types`](https://developer.fastly.com/reference/api/observability/notification) (GET) - [`/notifications/integrations/{integration_id}/rotateSigningKey`](https://developer.fastly.com/reference/api/observability/notification) (POST) - [`/notifications/integrations/{integration_id}/signingKey`](https://developer.fastly.com/reference/api/observability/notification) (GET) @@ -647,12 +663,23 @@ The fastly-go API client currently does not support the following endpoints: - [`/notifications/integrations`](https://developer.fastly.com/reference/api/observability/notification) (GET, POST) - [`/notifications/mailinglist-confirmations`](https://developer.fastly.com/reference/api/observability/notification) (POST) - [`/resources/stores/kv/{store_id}/batch`](https://www.fastly.com/documentation/reference/api/services/resources/kv-store-item) (PUT) +- [`/security/workspaces/{workspace_id}/events/{event_id}`](https://docs.fastly.com/en/ngwaf/) (GET, PATCH) +- [`/security/workspaces/{workspace_id}/events`](https://docs.fastly.com/en/ngwaf/) (GET) +- [`/security/workspaces/{workspace_id}/redactions/{redaction_id}`](https://docs.fastly.com/en/ngwaf/) (DELETE, GET, PATCH) +- [`/security/workspaces/{workspace_id}/redactions`](https://docs.fastly.com/en/ngwaf/) (GET, POST) +- [`/security/workspaces/{workspace_id}/requests/{request_id}`](https://docs.fastly.com/en/ngwaf/) (GET) +- [`/security/workspaces/{workspace_id}/requests`](https://docs.fastly.com/en/ngwaf/) (GET) +- [`/security/workspaces/{workspace_id}/rules/{rule_id}`](https://docs.fastly.com/en/ngwaf/) (DELETE, GET, PATCH) +- [`/security/workspaces/{workspace_id}/rules`](https://docs.fastly.com/en/ngwaf/) (GET, POST) +- [`/security/workspaces/{workspace_id}/timeseries`](https://docs.fastly.com/en/ngwaf/) (GET) +- [`/security/workspaces/{workspace_id}/virtual-patches/{virtual_patch_id}`](https://docs.fastly.com/en/ngwaf/) (GET, PATCH) +- [`/security/workspaces/{workspace_id}/virtual-patches`](https://docs.fastly.com/en/ngwaf/) (GET) +- [`/security/workspaces/{workspace_id}`](https://docs.fastly.com/en/ngwaf/) (DELETE, GET, PATCH) +- [`/security/workspaces`](https://docs.fastly.com/en/ngwaf/) (GET, POST) - [`/tls/activations/{tls_activation_id}`](https://www.fastly.com/documentation/reference/api/tls/mutual-tls/activations) (GET, PATCH) - [`/tls/activations`](https://www.fastly.com/documentation/reference/api/tls/mutual-tls/activations) (GET) - [`/tls/configurations/{tls_configuration_id}`](https://www.fastly.com/documentation/reference/api/) (DELETE, GET, PATCH) - [`/tls/configurations`](https://www.fastly.com/documentation/reference/api/) (GET, POST) -- [`/tls/preview/domains/{domain_id}`](https://www.fastly.com/documentation/reference/api/) (GET, PATCH) -- [`/tls/preview/domains`](https://www.fastly.com/documentation/reference/api/) (GET, POST) - [`/v1/channel/{service_id}/ts/h/limit/{max_entries}`](https://www.fastly.com/documentation/reference/api/metrics-stats/origin-insights) (GET) - [`/v1/channel/{service_id}/ts/h`](https://www.fastly.com/documentation/reference/api/metrics-stats/origin-insights) (GET) - [`/v1/channel/{service_id}/ts/{start_timestamp}`](https://www.fastly.com/documentation/reference/api/metrics-stats/origin-insights) (GET) diff --git a/docs/AclsInComputeAPI.md b/docs/AclsInComputeAPI.md new file mode 100644 index 0000000..55d7a3e --- /dev/null +++ b/docs/AclsInComputeAPI.md @@ -0,0 +1,473 @@ +# ACLsInComputeAPI + +> [!NOTE] +> All URIs are relative to `https://api.fastly.com` + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ComputeACLCreateAcls**](AclsInComputeAPI.md#ComputeACLCreateAcls) | **POST** `/resources/acls` | Create a new ACL +[**ComputeACLDeleteSAclID**](AclsInComputeAPI.md#ComputeACLDeleteSAclID) | **DELETE** `/resources/acls/{acl_id}` | Delete an ACL +[**ComputeACLListAclEntries**](AclsInComputeAPI.md#ComputeACLListAclEntries) | **GET** `/resources/acls/{acl_id}/entries` | List an ACL +[**ComputeACLListAcls**](AclsInComputeAPI.md#ComputeACLListAcls) | **GET** `/resources/acls` | List ACLs +[**ComputeACLListAclsSAclID**](AclsInComputeAPI.md#ComputeACLListAclsSAclID) | **GET** `/resources/acls/{acl_id}` | Describe an ACL +[**ComputeACLLookupAcls**](AclsInComputeAPI.md#ComputeACLLookupAcls) | **GET** `/resources/acls/{acl_id}/entry/{acl_ip}` | Lookup an ACL +[**ComputeACLUpdateAcls**](AclsInComputeAPI.md#ComputeACLUpdateAcls) | **PATCH** `/resources/acls/{acl_id}/entries` | Update an ACL + + + +## ComputeACLCreateAcls + +Create a new ACL + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + computeACLCreateAclsRequest := *openapiclient.NewComputeACLCreateAclsRequest() // ComputeACLCreateAclsRequest | (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLCreateAcls(ctx).ComputeACLCreateAclsRequest(computeACLCreateAclsRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ACLsInComputeAPI.ComputeACLCreateAcls`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ComputeACLCreateAcls`: ComputeACLCreateAclsResponse + fmt.Fprintf(os.Stdout, "Response from `ACLsInComputeAPI.ComputeACLCreateAcls`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiComputeACLCreateAclsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **computeACLCreateAclsRequest** | [**ComputeACLCreateAclsRequest**](ComputeACLCreateAclsRequest.md) | | + +### Return type + +[**ComputeACLCreateAclsResponse**](ComputeACLCreateAclsResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## ComputeACLDeleteSAclID + +Delete an ACL + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + aclID := "aclId_example" // string | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLDeleteSAclID(ctx, aclID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ACLsInComputeAPI.ComputeACLDeleteSAclID`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**aclID** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiComputeACLDeleteSAclIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## ComputeACLListAclEntries + +List an ACL + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + aclID := "aclId_example" // string | + cursor := "cursor_example" // string | (optional) + limit := int32(56) // int32 | (optional) (default to 100) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLListAclEntries(ctx, aclID).Cursor(cursor).Limit(limit).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ACLsInComputeAPI.ComputeACLListAclEntries`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ComputeACLListAclEntries`: ComputeACLListEntries + fmt.Fprintf(os.Stdout, "Response from `ACLsInComputeAPI.ComputeACLListAclEntries`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**aclID** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiComputeACLListAclEntriesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cursor** | **string** | | **limit** | **int32** | | [default to 100] + +### Return type + +[**ComputeACLListEntries**](ComputeACLListEntries.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## ComputeACLListAcls + +List ACLs + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLListAcls(ctx).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ACLsInComputeAPI.ComputeACLListAcls`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ComputeACLListAcls`: []ComputeACLCreateAclsResponse + fmt.Fprintf(os.Stdout, "Response from `ACLsInComputeAPI.ComputeACLListAcls`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiComputeACLListAclsRequest struct via the builder pattern + + + +### Return type + +[**[]ComputeACLCreateAclsResponse**](ComputeACLCreateAclsResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## ComputeACLListAclsSAclID + +Describe an ACL + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + aclID := "aclId_example" // string | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLListAclsSAclID(ctx, aclID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ACLsInComputeAPI.ComputeACLListAclsSAclID`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ComputeACLListAclsSAclID`: ComputeACLCreateAclsResponse + fmt.Fprintf(os.Stdout, "Response from `ACLsInComputeAPI.ComputeACLListAclsSAclID`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**aclID** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiComputeACLListAclsSAclIDRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ComputeACLCreateAclsResponse**](ComputeACLCreateAclsResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## ComputeACLLookupAcls + +Lookup an ACL + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + aclID := "aclId_example" // string | + aclIP := "aclIp_example" // string | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLLookupAcls(ctx, aclID, aclIP).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ACLsInComputeAPI.ComputeACLLookupAcls`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ComputeACLLookupAcls`: ComputeACLLookup + fmt.Fprintf(os.Stdout, "Response from `ACLsInComputeAPI.ComputeACLLookupAcls`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**aclID** | **string** | | +**aclIP** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiComputeACLLookupAclsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ComputeACLLookup**](ComputeACLLookup.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## ComputeACLUpdateAcls + +Update an ACL + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + aclID := "aclId_example" // string | + computeACLUpdateEntry := []openapiclient.ComputeACLUpdateEntry{*openapiclient.NewComputeACLUpdateEntry()} // []ComputeACLUpdateEntry | (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLUpdateAcls(ctx, aclID).ComputeACLUpdateEntry(computeACLUpdateEntry).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ACLsInComputeAPI.ComputeACLUpdateAcls`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**aclID** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiComputeACLUpdateAclsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **computeACLUpdateEntry** | [**[]ComputeACLUpdateEntry**](ComputeACLUpdateEntry.md) | | + +### Return type + + (empty response body) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/BillingResponseLineItem.md b/docs/BillingResponseLineItem.md index 689e766..8c90406 100644 --- a/docs/BillingResponseLineItem.md +++ b/docs/BillingResponseLineItem.md @@ -7,21 +7,21 @@ Name | Type | Description | Notes **CreatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **DeletedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **UpdatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] -**Amount** | Pointer to **float32** | | [optional] -**AriaInvoiceID** | Pointer to **string** | An alphanumeric string identifying the invoice. | [optional] [readonly] -**ClientServiceID** | Pointer to **string** | | [optional] +**Amount** | Pointer to **NullableFloat32** | | [optional] +**AriaInvoiceID** | Pointer to **NullableString** | An alphanumeric string identifying the invoice. | [optional] [readonly] +**ClientServiceID** | Pointer to **NullableString** | | [optional] **CreditCouponCode** | Pointer to **NullableString** | | [optional] -**Description** | Pointer to **string** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] **ID** | Pointer to **string** | | [optional] -**LineNumber** | Pointer to **int32** | | [optional] -**PlanName** | Pointer to **string** | | [optional] -**PlanNo** | Pointer to **float32** | | [optional] +**LineNumber** | Pointer to **NullableInt32** | | [optional] +**PlanName** | Pointer to **NullableString** | | [optional] +**PlanNo** | Pointer to **NullableFloat32** | | [optional] **RatePerUnit** | Pointer to **NullableFloat32** | | [optional] **RateScheduleNo** | Pointer to **NullableFloat32** | | [optional] **RateScheduleTierNo** | Pointer to **NullableFloat32** | | [optional] -**ServiceName** | Pointer to **string** | | [optional] -**ServiceNo** | Pointer to **float32** | | [optional] -**Units** | Pointer to **float32** | | [optional] +**ServiceName** | Pointer to **NullableString** | | [optional] +**ServiceNo** | Pointer to **NullableFloat32** | | [optional] +**Units** | Pointer to **NullableFloat32** | | [optional] **UsageTypeCd** | Pointer to **NullableString** | | [optional] **UsageTypeNo** | Pointer to **NullableFloat32** | | [optional] @@ -174,6 +174,16 @@ SetAmount sets Amount field to given value. HasAmount returns a boolean if a field has been set. +### SetAmountNil + +`func (o *BillingResponseLineItem) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *BillingResponseLineItem) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil ### GetAriaInvoiceID `func (o *BillingResponseLineItem) GetAriaInvoiceID() string` @@ -199,6 +209,16 @@ SetAriaInvoiceID sets AriaInvoiceID field to given value. HasAriaInvoiceID returns a boolean if a field has been set. +### SetAriaInvoiceIDNil + +`func (o *BillingResponseLineItem) SetAriaInvoiceIDNil(b bool)` + + SetAriaInvoiceIDNil sets the value for AriaInvoiceID to be an explicit nil + +### UnsetAriaInvoiceID +`func (o *BillingResponseLineItem) UnsetAriaInvoiceID()` + +UnsetAriaInvoiceID ensures that no value is present for AriaInvoiceID, not even an explicit nil ### GetClientServiceID `func (o *BillingResponseLineItem) GetClientServiceID() string` @@ -224,6 +244,16 @@ SetClientServiceID sets ClientServiceID field to given value. HasClientServiceID returns a boolean if a field has been set. +### SetClientServiceIDNil + +`func (o *BillingResponseLineItem) SetClientServiceIDNil(b bool)` + + SetClientServiceIDNil sets the value for ClientServiceID to be an explicit nil + +### UnsetClientServiceID +`func (o *BillingResponseLineItem) UnsetClientServiceID()` + +UnsetClientServiceID ensures that no value is present for ClientServiceID, not even an explicit nil ### GetCreditCouponCode `func (o *BillingResponseLineItem) GetCreditCouponCode() string` @@ -284,6 +314,16 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### SetDescriptionNil + +`func (o *BillingResponseLineItem) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *BillingResponseLineItem) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil ### GetID `func (o *BillingResponseLineItem) GetID() string` @@ -334,6 +374,16 @@ SetLineNumber sets LineNumber field to given value. HasLineNumber returns a boolean if a field has been set. +### SetLineNumberNil + +`func (o *BillingResponseLineItem) SetLineNumberNil(b bool)` + + SetLineNumberNil sets the value for LineNumber to be an explicit nil + +### UnsetLineNumber +`func (o *BillingResponseLineItem) UnsetLineNumber()` + +UnsetLineNumber ensures that no value is present for LineNumber, not even an explicit nil ### GetPlanName `func (o *BillingResponseLineItem) GetPlanName() string` @@ -359,6 +409,16 @@ SetPlanName sets PlanName field to given value. HasPlanName returns a boolean if a field has been set. +### SetPlanNameNil + +`func (o *BillingResponseLineItem) SetPlanNameNil(b bool)` + + SetPlanNameNil sets the value for PlanName to be an explicit nil + +### UnsetPlanName +`func (o *BillingResponseLineItem) UnsetPlanName()` + +UnsetPlanName ensures that no value is present for PlanName, not even an explicit nil ### GetPlanNo `func (o *BillingResponseLineItem) GetPlanNo() float32` @@ -384,6 +444,16 @@ SetPlanNo sets PlanNo field to given value. HasPlanNo returns a boolean if a field has been set. +### SetPlanNoNil + +`func (o *BillingResponseLineItem) SetPlanNoNil(b bool)` + + SetPlanNoNil sets the value for PlanNo to be an explicit nil + +### UnsetPlanNo +`func (o *BillingResponseLineItem) UnsetPlanNo()` + +UnsetPlanNo ensures that no value is present for PlanNo, not even an explicit nil ### GetRatePerUnit `func (o *BillingResponseLineItem) GetRatePerUnit() float32` @@ -514,6 +584,16 @@ SetServiceName sets ServiceName field to given value. HasServiceName returns a boolean if a field has been set. +### SetServiceNameNil + +`func (o *BillingResponseLineItem) SetServiceNameNil(b bool)` + + SetServiceNameNil sets the value for ServiceName to be an explicit nil + +### UnsetServiceName +`func (o *BillingResponseLineItem) UnsetServiceName()` + +UnsetServiceName ensures that no value is present for ServiceName, not even an explicit nil ### GetServiceNo `func (o *BillingResponseLineItem) GetServiceNo() float32` @@ -539,6 +619,16 @@ SetServiceNo sets ServiceNo field to given value. HasServiceNo returns a boolean if a field has been set. +### SetServiceNoNil + +`func (o *BillingResponseLineItem) SetServiceNoNil(b bool)` + + SetServiceNoNil sets the value for ServiceNo to be an explicit nil + +### UnsetServiceNo +`func (o *BillingResponseLineItem) UnsetServiceNo()` + +UnsetServiceNo ensures that no value is present for ServiceNo, not even an explicit nil ### GetUnits `func (o *BillingResponseLineItem) GetUnits() float32` @@ -564,6 +654,16 @@ SetUnits sets Units field to given value. HasUnits returns a boolean if a field has been set. +### SetUnitsNil + +`func (o *BillingResponseLineItem) SetUnitsNil(b bool)` + + SetUnitsNil sets the value for Units to be an explicit nil + +### UnsetUnits +`func (o *BillingResponseLineItem) UnsetUnits()` + +UnsetUnits ensures that no value is present for Units, not even an explicit nil ### GetUsageTypeCd `func (o *BillingResponseLineItem) GetUsageTypeCd() string` diff --git a/docs/ComputeAclCreateAclsRequest.md b/docs/ComputeAclCreateAclsRequest.md new file mode 100644 index 0000000..663020c --- /dev/null +++ b/docs/ComputeAclCreateAclsRequest.md @@ -0,0 +1,54 @@ +# ComputeACLCreateAclsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | Human readable name of store | [optional] + +## Methods + +### NewComputeACLCreateAclsRequest + +`func NewComputeACLCreateAclsRequest() *ComputeACLCreateAclsRequest` + +NewComputeACLCreateAclsRequest instantiates a new ComputeACLCreateAclsRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewComputeACLCreateAclsRequestWithDefaults + +`func NewComputeACLCreateAclsRequestWithDefaults() *ComputeACLCreateAclsRequest` + +NewComputeACLCreateAclsRequestWithDefaults instantiates a new ComputeACLCreateAclsRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ComputeACLCreateAclsRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ComputeACLCreateAclsRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ComputeACLCreateAclsRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ComputeACLCreateAclsRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ComputeAclCreateAclsResponse.md b/docs/ComputeAclCreateAclsResponse.md new file mode 100644 index 0000000..2ead3be --- /dev/null +++ b/docs/ComputeAclCreateAclsResponse.md @@ -0,0 +1,80 @@ +# ComputeACLCreateAclsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | Human readable name of store | [optional] +**ID** | Pointer to **string** | An example identifier (UUID). | [optional] + +## Methods + +### NewComputeACLCreateAclsResponse + +`func NewComputeACLCreateAclsResponse() *ComputeACLCreateAclsResponse` + +NewComputeACLCreateAclsResponse instantiates a new ComputeACLCreateAclsResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewComputeACLCreateAclsResponseWithDefaults + +`func NewComputeACLCreateAclsResponseWithDefaults() *ComputeACLCreateAclsResponse` + +NewComputeACLCreateAclsResponseWithDefaults instantiates a new ComputeACLCreateAclsResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *ComputeACLCreateAclsResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ComputeACLCreateAclsResponse) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ComputeACLCreateAclsResponse) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *ComputeACLCreateAclsResponse) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetID + +`func (o *ComputeACLCreateAclsResponse) GetID() string` + +GetID returns the ID field if non-nil, zero value otherwise. + +### GetIDOk + +`func (o *ComputeACLCreateAclsResponse) GetIDOk() (*string, bool)` + +GetIDOk returns a tuple with the ID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetID + +`func (o *ComputeACLCreateAclsResponse) SetID(v string)` + +SetID sets ID field to given value. + +### HasID + +`func (o *ComputeACLCreateAclsResponse) HasID() bool` + +HasID returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ComputeAclListEntries.md b/docs/ComputeAclListEntries.md new file mode 100644 index 0000000..515dbec --- /dev/null +++ b/docs/ComputeAclListEntries.md @@ -0,0 +1,80 @@ +# ComputeACLListEntries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Meta** | Pointer to [**ComputeACLListEntriesMeta**](ComputeACLListEntriesMeta.md) | | [optional] +**Entries** | Pointer to [**[]ComputeACLListEntriesItem**](ComputeACLListEntriesItem.md) | | [optional] + +## Methods + +### NewComputeACLListEntries + +`func NewComputeACLListEntries() *ComputeACLListEntries` + +NewComputeACLListEntries instantiates a new ComputeACLListEntries object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewComputeACLListEntriesWithDefaults + +`func NewComputeACLListEntriesWithDefaults() *ComputeACLListEntries` + +NewComputeACLListEntriesWithDefaults instantiates a new ComputeACLListEntries object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMeta + +`func (o *ComputeACLListEntries) GetMeta() ComputeACLListEntriesMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *ComputeACLListEntries) GetMetaOk() (*ComputeACLListEntriesMeta, bool)` + +GetMetaOk returns a tuple with the Meta field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMeta + +`func (o *ComputeACLListEntries) SetMeta(v ComputeACLListEntriesMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *ComputeACLListEntries) HasMeta() bool` + +HasMeta returns a boolean if a field has been set. + +### GetEntries + +`func (o *ComputeACLListEntries) GetEntries() []ComputeACLListEntriesItem` + +GetEntries returns the Entries field if non-nil, zero value otherwise. + +### GetEntriesOk + +`func (o *ComputeACLListEntries) GetEntriesOk() (*[]ComputeACLListEntriesItem, bool)` + +GetEntriesOk returns a tuple with the Entries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEntries + +`func (o *ComputeACLListEntries) SetEntries(v []ComputeACLListEntriesItem)` + +SetEntries sets Entries field to given value. + +### HasEntries + +`func (o *ComputeACLListEntries) HasEntries() bool` + +HasEntries returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ComputeAclListEntriesItem.md b/docs/ComputeAclListEntriesItem.md new file mode 100644 index 0000000..094e934 --- /dev/null +++ b/docs/ComputeAclListEntriesItem.md @@ -0,0 +1,80 @@ +# ComputeACLListEntriesItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prefix** | Pointer to **string** | An IP prefix defined in Classless Inter-Domain Routing (CIDR) format, i.e. a valid IP address (v4 or v6) followed by a forward slash (/) and a prefix length (0-32 or 0-128, depending on address family). | [optional] +**Action** | Pointer to **string** | One of \"ALLOW\" or \"BLOCK\". | [optional] + +## Methods + +### NewComputeACLListEntriesItem + +`func NewComputeACLListEntriesItem() *ComputeACLListEntriesItem` + +NewComputeACLListEntriesItem instantiates a new ComputeACLListEntriesItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewComputeACLListEntriesItemWithDefaults + +`func NewComputeACLListEntriesItemWithDefaults() *ComputeACLListEntriesItem` + +NewComputeACLListEntriesItemWithDefaults instantiates a new ComputeACLListEntriesItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPrefix + +`func (o *ComputeACLListEntriesItem) GetPrefix() string` + +GetPrefix returns the Prefix field if non-nil, zero value otherwise. + +### GetPrefixOk + +`func (o *ComputeACLListEntriesItem) GetPrefixOk() (*string, bool)` + +GetPrefixOk returns a tuple with the Prefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefix + +`func (o *ComputeACLListEntriesItem) SetPrefix(v string)` + +SetPrefix sets Prefix field to given value. + +### HasPrefix + +`func (o *ComputeACLListEntriesItem) HasPrefix() bool` + +HasPrefix returns a boolean if a field has been set. + +### GetAction + +`func (o *ComputeACLListEntriesItem) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *ComputeACLListEntriesItem) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *ComputeACLListEntriesItem) SetAction(v string)` + +SetAction sets Action field to given value. + +### HasAction + +`func (o *ComputeACLListEntriesItem) HasAction() bool` + +HasAction returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ComputeAclListEntriesMeta.md b/docs/ComputeAclListEntriesMeta.md new file mode 100644 index 0000000..cc8e53b --- /dev/null +++ b/docs/ComputeAclListEntriesMeta.md @@ -0,0 +1,80 @@ +# ComputeACLListEntriesMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Limit** | Pointer to **string** | The maximum number of results shown in this response. | [optional] +**NextCursor** | Pointer to **string** | Used for pagination, supply to the next request to get the next block of results. | [optional] + +## Methods + +### NewComputeACLListEntriesMeta + +`func NewComputeACLListEntriesMeta() *ComputeACLListEntriesMeta` + +NewComputeACLListEntriesMeta instantiates a new ComputeACLListEntriesMeta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewComputeACLListEntriesMetaWithDefaults + +`func NewComputeACLListEntriesMetaWithDefaults() *ComputeACLListEntriesMeta` + +NewComputeACLListEntriesMetaWithDefaults instantiates a new ComputeACLListEntriesMeta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLimit + +`func (o *ComputeACLListEntriesMeta) GetLimit() string` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *ComputeACLListEntriesMeta) GetLimitOk() (*string, bool)` + +GetLimitOk returns a tuple with the Limit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimit + +`func (o *ComputeACLListEntriesMeta) SetLimit(v string)` + +SetLimit sets Limit field to given value. + +### HasLimit + +`func (o *ComputeACLListEntriesMeta) HasLimit() bool` + +HasLimit returns a boolean if a field has been set. + +### GetNextCursor + +`func (o *ComputeACLListEntriesMeta) GetNextCursor() string` + +GetNextCursor returns the NextCursor field if non-nil, zero value otherwise. + +### GetNextCursorOk + +`func (o *ComputeACLListEntriesMeta) GetNextCursorOk() (*string, bool)` + +GetNextCursorOk returns a tuple with the NextCursor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextCursor + +`func (o *ComputeACLListEntriesMeta) SetNextCursor(v string)` + +SetNextCursor sets NextCursor field to given value. + +### HasNextCursor + +`func (o *ComputeACLListEntriesMeta) HasNextCursor() bool` + +HasNextCursor returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ComputeAclLookup.md b/docs/ComputeAclLookup.md new file mode 100644 index 0000000..9356a5b --- /dev/null +++ b/docs/ComputeAclLookup.md @@ -0,0 +1,106 @@ +# ComputeACLLookup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Prefix** | Pointer to **string** | A valid IPv4 or IPv6 address. | [optional] +**Length** | Pointer to **int32** | The length of address in the IP addressing space. | [optional] +**Action** | Pointer to **string** | One of \"ALLOW\" or \"BLOCK\". | [optional] + +## Methods + +### NewComputeACLLookup + +`func NewComputeACLLookup() *ComputeACLLookup` + +NewComputeACLLookup instantiates a new ComputeACLLookup object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewComputeACLLookupWithDefaults + +`func NewComputeACLLookupWithDefaults() *ComputeACLLookup` + +NewComputeACLLookupWithDefaults instantiates a new ComputeACLLookup object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPrefix + +`func (o *ComputeACLLookup) GetPrefix() string` + +GetPrefix returns the Prefix field if non-nil, zero value otherwise. + +### GetPrefixOk + +`func (o *ComputeACLLookup) GetPrefixOk() (*string, bool)` + +GetPrefixOk returns a tuple with the Prefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefix + +`func (o *ComputeACLLookup) SetPrefix(v string)` + +SetPrefix sets Prefix field to given value. + +### HasPrefix + +`func (o *ComputeACLLookup) HasPrefix() bool` + +HasPrefix returns a boolean if a field has been set. + +### GetLength + +`func (o *ComputeACLLookup) GetLength() int32` + +GetLength returns the Length field if non-nil, zero value otherwise. + +### GetLengthOk + +`func (o *ComputeACLLookup) GetLengthOk() (*int32, bool)` + +GetLengthOk returns a tuple with the Length field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLength + +`func (o *ComputeACLLookup) SetLength(v int32)` + +SetLength sets Length field to given value. + +### HasLength + +`func (o *ComputeACLLookup) HasLength() bool` + +HasLength returns a boolean if a field has been set. + +### GetAction + +`func (o *ComputeACLLookup) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *ComputeACLLookup) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *ComputeACLLookup) SetAction(v string)` + +SetAction sets Action field to given value. + +### HasAction + +`func (o *ComputeACLLookup) HasAction() bool` + +HasAction returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ComputeAclUpdateEntry.md b/docs/ComputeAclUpdateEntry.md new file mode 100644 index 0000000..ef6d83a --- /dev/null +++ b/docs/ComputeAclUpdateEntry.md @@ -0,0 +1,106 @@ +# ComputeACLUpdateEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Op** | Pointer to **string** | One of \"create\" or \"update\", indicating that the rest of this entry is to be added to/updated in the ACL. | [optional] +**Prefix** | Pointer to **string** | An IP prefix defined in Classless Inter-Domain Routing (CIDR) format, i.e. a valid IP address (v4 or v6) followed by a forward slash (/) and a prefix length (0-32 or 0-128, depending on address family). | [optional] +**Action** | Pointer to **string** | The action taken on the IP address, either \"block\" or \"allow\". | [optional] + +## Methods + +### NewComputeACLUpdateEntry + +`func NewComputeACLUpdateEntry() *ComputeACLUpdateEntry` + +NewComputeACLUpdateEntry instantiates a new ComputeACLUpdateEntry object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewComputeACLUpdateEntryWithDefaults + +`func NewComputeACLUpdateEntryWithDefaults() *ComputeACLUpdateEntry` + +NewComputeACLUpdateEntryWithDefaults instantiates a new ComputeACLUpdateEntry object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOp + +`func (o *ComputeACLUpdateEntry) GetOp() string` + +GetOp returns the Op field if non-nil, zero value otherwise. + +### GetOpOk + +`func (o *ComputeACLUpdateEntry) GetOpOk() (*string, bool)` + +GetOpOk returns a tuple with the Op field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOp + +`func (o *ComputeACLUpdateEntry) SetOp(v string)` + +SetOp sets Op field to given value. + +### HasOp + +`func (o *ComputeACLUpdateEntry) HasOp() bool` + +HasOp returns a boolean if a field has been set. + +### GetPrefix + +`func (o *ComputeACLUpdateEntry) GetPrefix() string` + +GetPrefix returns the Prefix field if non-nil, zero value otherwise. + +### GetPrefixOk + +`func (o *ComputeACLUpdateEntry) GetPrefixOk() (*string, bool)` + +GetPrefixOk returns a tuple with the Prefix field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrefix + +`func (o *ComputeACLUpdateEntry) SetPrefix(v string)` + +SetPrefix sets Prefix field to given value. + +### HasPrefix + +`func (o *ComputeACLUpdateEntry) HasPrefix() bool` + +HasPrefix returns a boolean if a field has been set. + +### GetAction + +`func (o *ComputeACLUpdateEntry) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *ComputeACLUpdateEntry) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *ComputeACLUpdateEntry) SetAction(v string)` + +SetAction sets Action field to given value. + +### HasAction + +`func (o *ComputeACLUpdateEntry) HasAction() bool` + +HasAction returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ConfiguredProductResponse.md b/docs/ConfiguredProductResponse.md new file mode 100644 index 0000000..aa4c2a4 --- /dev/null +++ b/docs/ConfiguredProductResponse.md @@ -0,0 +1,132 @@ +# ConfiguredProductResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Product** | Pointer to [**ConfiguredProductResponseProduct**](ConfiguredProductResponseProduct.md) | | [optional] +**Service** | Pointer to [**EnabledProductResponseService**](EnabledProductResponseService.md) | | [optional] +**Configuration** | Pointer to [**ConfiguredProductResponseConfiguration**](ConfiguredProductResponseConfiguration.md) | | [optional] +**Links** | Pointer to [**ConfiguredProductResponseLinks**](ConfiguredProductResponseLinks.md) | | [optional] + +## Methods + +### NewConfiguredProductResponse + +`func NewConfiguredProductResponse() *ConfiguredProductResponse` + +NewConfiguredProductResponse instantiates a new ConfiguredProductResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConfiguredProductResponseWithDefaults + +`func NewConfiguredProductResponseWithDefaults() *ConfiguredProductResponse` + +NewConfiguredProductResponseWithDefaults instantiates a new ConfiguredProductResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProduct + +`func (o *ConfiguredProductResponse) GetProduct() ConfiguredProductResponseProduct` + +GetProduct returns the Product field if non-nil, zero value otherwise. + +### GetProductOk + +`func (o *ConfiguredProductResponse) GetProductOk() (*ConfiguredProductResponseProduct, bool)` + +GetProductOk returns a tuple with the Product field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProduct + +`func (o *ConfiguredProductResponse) SetProduct(v ConfiguredProductResponseProduct)` + +SetProduct sets Product field to given value. + +### HasProduct + +`func (o *ConfiguredProductResponse) HasProduct() bool` + +HasProduct returns a boolean if a field has been set. + +### GetService + +`func (o *ConfiguredProductResponse) GetService() EnabledProductResponseService` + +GetService returns the Service field if non-nil, zero value otherwise. + +### GetServiceOk + +`func (o *ConfiguredProductResponse) GetServiceOk() (*EnabledProductResponseService, bool)` + +GetServiceOk returns a tuple with the Service field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetService + +`func (o *ConfiguredProductResponse) SetService(v EnabledProductResponseService)` + +SetService sets Service field to given value. + +### HasService + +`func (o *ConfiguredProductResponse) HasService() bool` + +HasService returns a boolean if a field has been set. + +### GetConfiguration + +`func (o *ConfiguredProductResponse) GetConfiguration() ConfiguredProductResponseConfiguration` + +GetConfiguration returns the Configuration field if non-nil, zero value otherwise. + +### GetConfigurationOk + +`func (o *ConfiguredProductResponse) GetConfigurationOk() (*ConfiguredProductResponseConfiguration, bool)` + +GetConfigurationOk returns a tuple with the Configuration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConfiguration + +`func (o *ConfiguredProductResponse) SetConfiguration(v ConfiguredProductResponseConfiguration)` + +SetConfiguration sets Configuration field to given value. + +### HasConfiguration + +`func (o *ConfiguredProductResponse) HasConfiguration() bool` + +HasConfiguration returns a boolean if a field has been set. + +### GetLinks + +`func (o *ConfiguredProductResponse) GetLinks() ConfiguredProductResponseLinks` + +GetLinks returns the Links field if non-nil, zero value otherwise. + +### GetLinksOk + +`func (o *ConfiguredProductResponse) GetLinksOk() (*ConfiguredProductResponseLinks, bool)` + +GetLinksOk returns a tuple with the Links field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLinks + +`func (o *ConfiguredProductResponse) SetLinks(v ConfiguredProductResponseLinks)` + +SetLinks sets Links field to given value. + +### HasLinks + +`func (o *ConfiguredProductResponse) HasLinks() bool` + +HasLinks returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ConfiguredProductResponseConfiguration.md b/docs/ConfiguredProductResponseConfiguration.md new file mode 100644 index 0000000..4d8cf78 --- /dev/null +++ b/docs/ConfiguredProductResponseConfiguration.md @@ -0,0 +1,80 @@ +# ConfiguredProductResponseConfiguration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**WorkspaceID** | Pointer to **string** | Workspace ID | [optional] +**TrafficRamp** | Pointer to **string** | Traffic ramp | [optional] + +## Methods + +### NewConfiguredProductResponseConfiguration + +`func NewConfiguredProductResponseConfiguration() *ConfiguredProductResponseConfiguration` + +NewConfiguredProductResponseConfiguration instantiates a new ConfiguredProductResponseConfiguration object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConfiguredProductResponseConfigurationWithDefaults + +`func NewConfiguredProductResponseConfigurationWithDefaults() *ConfiguredProductResponseConfiguration` + +NewConfiguredProductResponseConfigurationWithDefaults instantiates a new ConfiguredProductResponseConfiguration object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetWorkspaceID + +`func (o *ConfiguredProductResponseConfiguration) GetWorkspaceID() string` + +GetWorkspaceID returns the WorkspaceID field if non-nil, zero value otherwise. + +### GetWorkspaceIDOk + +`func (o *ConfiguredProductResponseConfiguration) GetWorkspaceIDOk() (*string, bool)` + +GetWorkspaceIDOk returns a tuple with the WorkspaceID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkspaceID + +`func (o *ConfiguredProductResponseConfiguration) SetWorkspaceID(v string)` + +SetWorkspaceID sets WorkspaceID field to given value. + +### HasWorkspaceID + +`func (o *ConfiguredProductResponseConfiguration) HasWorkspaceID() bool` + +HasWorkspaceID returns a boolean if a field has been set. + +### GetTrafficRamp + +`func (o *ConfiguredProductResponseConfiguration) GetTrafficRamp() string` + +GetTrafficRamp returns the TrafficRamp field if non-nil, zero value otherwise. + +### GetTrafficRampOk + +`func (o *ConfiguredProductResponseConfiguration) GetTrafficRampOk() (*string, bool)` + +GetTrafficRampOk returns a tuple with the TrafficRamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrafficRamp + +`func (o *ConfiguredProductResponseConfiguration) SetTrafficRamp(v string)` + +SetTrafficRamp sets TrafficRamp field to given value. + +### HasTrafficRamp + +`func (o *ConfiguredProductResponseConfiguration) HasTrafficRamp() bool` + +HasTrafficRamp returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ConfiguredProductResponseLinks.md b/docs/ConfiguredProductResponseLinks.md new file mode 100644 index 0000000..17b37d5 --- /dev/null +++ b/docs/ConfiguredProductResponseLinks.md @@ -0,0 +1,80 @@ +# ConfiguredProductResponseLinks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Self** | Pointer to **string** | Location of resource | [optional] +**Service** | Pointer to **string** | Location of the service resource | [optional] + +## Methods + +### NewConfiguredProductResponseLinks + +`func NewConfiguredProductResponseLinks() *ConfiguredProductResponseLinks` + +NewConfiguredProductResponseLinks instantiates a new ConfiguredProductResponseLinks object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConfiguredProductResponseLinksWithDefaults + +`func NewConfiguredProductResponseLinksWithDefaults() *ConfiguredProductResponseLinks` + +NewConfiguredProductResponseLinksWithDefaults instantiates a new ConfiguredProductResponseLinks object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSelf + +`func (o *ConfiguredProductResponseLinks) GetSelf() string` + +GetSelf returns the Self field if non-nil, zero value otherwise. + +### GetSelfOk + +`func (o *ConfiguredProductResponseLinks) GetSelfOk() (*string, bool)` + +GetSelfOk returns a tuple with the Self field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelf + +`func (o *ConfiguredProductResponseLinks) SetSelf(v string)` + +SetSelf sets Self field to given value. + +### HasSelf + +`func (o *ConfiguredProductResponseLinks) HasSelf() bool` + +HasSelf returns a boolean if a field has been set. + +### GetService + +`func (o *ConfiguredProductResponseLinks) GetService() string` + +GetService returns the Service field if non-nil, zero value otherwise. + +### GetServiceOk + +`func (o *ConfiguredProductResponseLinks) GetServiceOk() (*string, bool)` + +GetServiceOk returns a tuple with the Service field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetService + +`func (o *ConfiguredProductResponseLinks) SetService(v string)` + +SetService sets Service field to given value. + +### HasService + +`func (o *ConfiguredProductResponseLinks) HasService() bool` + +HasService returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ConfiguredProductResponseProduct.md b/docs/ConfiguredProductResponseProduct.md new file mode 100644 index 0000000..ed02aab --- /dev/null +++ b/docs/ConfiguredProductResponseProduct.md @@ -0,0 +1,80 @@ +# ConfiguredProductResponseProduct + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ID** | Pointer to **string** | Product identifier | [optional] +**Object** | Pointer to **string** | Name of the object | [optional] + +## Methods + +### NewConfiguredProductResponseProduct + +`func NewConfiguredProductResponseProduct() *ConfiguredProductResponseProduct` + +NewConfiguredProductResponseProduct instantiates a new ConfiguredProductResponseProduct object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewConfiguredProductResponseProductWithDefaults + +`func NewConfiguredProductResponseProductWithDefaults() *ConfiguredProductResponseProduct` + +NewConfiguredProductResponseProductWithDefaults instantiates a new ConfiguredProductResponseProduct object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetID + +`func (o *ConfiguredProductResponseProduct) GetID() string` + +GetID returns the ID field if non-nil, zero value otherwise. + +### GetIDOk + +`func (o *ConfiguredProductResponseProduct) GetIDOk() (*string, bool)` + +GetIDOk returns a tuple with the ID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetID + +`func (o *ConfiguredProductResponseProduct) SetID(v string)` + +SetID sets ID field to given value. + +### HasID + +`func (o *ConfiguredProductResponseProduct) HasID() bool` + +HasID returns a boolean if a field has been set. + +### GetObject + +`func (o *ConfiguredProductResponseProduct) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *ConfiguredProductResponseProduct) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *ConfiguredProductResponseProduct) SetObject(v string)` + +SetObject sets Object field to given value. + +### HasObject + +`func (o *ConfiguredProductResponseProduct) HasObject() bool` + +HasObject returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ContactAPI.md b/docs/ContactAPI.md index ed470a7..fd1d15a 100644 --- a/docs/ContactAPI.md +++ b/docs/ContactAPI.md @@ -6,7 +6,7 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**CreateContacts**](ContactAPI.md#CreateContacts) | **POST** `/customer/{customer_id}/contacts` | Add a new customer contact -[**DeleteContact**](ContactAPI.md#DeleteContact) | **DELETE** `/customer/{customer_id}/contact/{contact_id}` | Delete a contact +[**DeleteContact**](ContactAPI.md#DeleteContact) | **DELETE** `/customer/{customer_id}/contacts/{contact_id}` | Delete a contact [**ListContacts**](ContactAPI.md#ListContacts) | **GET** `/customer/{customer_id}/contacts` | List contacts diff --git a/docs/CustomerAddress.md b/docs/CustomerAddress.md new file mode 100644 index 0000000..df323ef --- /dev/null +++ b/docs/CustomerAddress.md @@ -0,0 +1,210 @@ +# CustomerAddress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | Pointer to **string** | The type of the address. | [optional] +**Address1** | Pointer to **string** | The street number and name of the address. | [optional] +**Address2** | Pointer to **string** | Additional address line for unit number, P.O. Box, etc. | [optional] +**Locality** | Pointer to **string** | City, town, or locality name the address is located. | [optional] +**Region** | Pointer to **string** | State, province, or region of the address. | [optional] +**Country** | Pointer to **string** | ISO 3166-1 alpha-2 country code (e.g., \"US\", \"CA\", \"NZ\") | [optional] +**PostalCode** | Pointer to **string** | Postal or Zip code of the address. | [optional] + +## Methods + +### NewCustomerAddress + +`func NewCustomerAddress() *CustomerAddress` + +NewCustomerAddress instantiates a new CustomerAddress object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCustomerAddressWithDefaults + +`func NewCustomerAddressWithDefaults() *CustomerAddress` + +NewCustomerAddressWithDefaults instantiates a new CustomerAddress object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *CustomerAddress) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *CustomerAddress) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *CustomerAddress) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *CustomerAddress) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetAddress1 + +`func (o *CustomerAddress) GetAddress1() string` + +GetAddress1 returns the Address1 field if non-nil, zero value otherwise. + +### GetAddress1Ok + +`func (o *CustomerAddress) GetAddress1Ok() (*string, bool)` + +GetAddress1Ok returns a tuple with the Address1 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress1 + +`func (o *CustomerAddress) SetAddress1(v string)` + +SetAddress1 sets Address1 field to given value. + +### HasAddress1 + +`func (o *CustomerAddress) HasAddress1() bool` + +HasAddress1 returns a boolean if a field has been set. + +### GetAddress2 + +`func (o *CustomerAddress) GetAddress2() string` + +GetAddress2 returns the Address2 field if non-nil, zero value otherwise. + +### GetAddress2Ok + +`func (o *CustomerAddress) GetAddress2Ok() (*string, bool)` + +GetAddress2Ok returns a tuple with the Address2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress2 + +`func (o *CustomerAddress) SetAddress2(v string)` + +SetAddress2 sets Address2 field to given value. + +### HasAddress2 + +`func (o *CustomerAddress) HasAddress2() bool` + +HasAddress2 returns a boolean if a field has been set. + +### GetLocality + +`func (o *CustomerAddress) GetLocality() string` + +GetLocality returns the Locality field if non-nil, zero value otherwise. + +### GetLocalityOk + +`func (o *CustomerAddress) GetLocalityOk() (*string, bool)` + +GetLocalityOk returns a tuple with the Locality field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLocality + +`func (o *CustomerAddress) SetLocality(v string)` + +SetLocality sets Locality field to given value. + +### HasLocality + +`func (o *CustomerAddress) HasLocality() bool` + +HasLocality returns a boolean if a field has been set. + +### GetRegion + +`func (o *CustomerAddress) GetRegion() string` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *CustomerAddress) GetRegionOk() (*string, bool)` + +GetRegionOk returns a tuple with the Region field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegion + +`func (o *CustomerAddress) SetRegion(v string)` + +SetRegion sets Region field to given value. + +### HasRegion + +`func (o *CustomerAddress) HasRegion() bool` + +HasRegion returns a boolean if a field has been set. + +### GetCountry + +`func (o *CustomerAddress) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *CustomerAddress) GetCountryOk() (*string, bool)` + +GetCountryOk returns a tuple with the Country field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountry + +`func (o *CustomerAddress) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *CustomerAddress) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetPostalCode + +`func (o *CustomerAddress) GetPostalCode() string` + +GetPostalCode returns the PostalCode field if non-nil, zero value otherwise. + +### GetPostalCodeOk + +`func (o *CustomerAddress) GetPostalCodeOk() (*string, bool)` + +GetPostalCodeOk returns a tuple with the PostalCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostalCode + +`func (o *CustomerAddress) SetPostalCode(v string)` + +SetPostalCode sets PostalCode field to given value. + +### HasPostalCode + +`func (o *CustomerAddress) HasPostalCode() bool` + +HasPostalCode returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/CustomerAddressesAPI.md b/docs/CustomerAddressesAPI.md new file mode 100644 index 0000000..f3bd8ec --- /dev/null +++ b/docs/CustomerAddressesAPI.md @@ -0,0 +1,199 @@ +# CustomerAddressesAPI + +> [!NOTE] +> All URIs are relative to `https://api.fastly.com` + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateCustomerAddress**](CustomerAddressesAPI.md#CreateCustomerAddress) | **POST** `/billing/v3/customer-addresses` | Creates an address associated with a customer account. +[**ListCustomerAddresses**](CustomerAddressesAPI.md#ListCustomerAddresses) | **GET** `/billing/v3/customer-addresses` | Return the list of addresses associated with a customer account. +[**UpdateCustomerAddress**](CustomerAddressesAPI.md#UpdateCustomerAddress) | **PUT** `/billing/v3/customer-addresses/{type}` | Updates an address associated with a customer account. + + + +## CreateCustomerAddress + +Creates an address associated with a customer account. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + customerAddress := *openapiclient.NewCustomerAddress() // CustomerAddress | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.CustomerAddressesAPI.CreateCustomerAddress(ctx).CustomerAddress(customerAddress).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CustomerAddressesAPI.CreateCustomerAddress`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateCustomerAddress`: InlineResponse201 + fmt.Fprintf(os.Stdout, "Response from `CustomerAddressesAPI.CreateCustomerAddress`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateCustomerAddressRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customerAddress** | [**CustomerAddress**](CustomerAddress.md) | | + +### Return type + +[**InlineResponse201**](InlineResponse201.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## ListCustomerAddresses + +Return the list of addresses associated with a customer account. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.CustomerAddressesAPI.ListCustomerAddresses(ctx).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CustomerAddressesAPI.ListCustomerAddresses`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListCustomerAddresses`: ListCustomerAddressesResponse + fmt.Fprintf(os.Stdout, "Response from `CustomerAddressesAPI.ListCustomerAddresses`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiListCustomerAddressesRequest struct via the builder pattern + + + +### Return type + +[**ListCustomerAddressesResponse**](ListCustomerAddressesResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## UpdateCustomerAddress + +Updates an address associated with a customer account. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + resourceType := "resourceType_example" // string | Alphanumeric type of the address being modified. + customerAddress := *openapiclient.NewCustomerAddress() // CustomerAddress | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.CustomerAddressesAPI.UpdateCustomerAddress(ctx, resourceType).CustomerAddress(customerAddress).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CustomerAddressesAPI.UpdateCustomerAddress`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**resourceType** | **string** | Alphanumeric type of the address being modified. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateCustomerAddressRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customerAddress** | [**CustomerAddress**](CustomerAddress.md) | | + +### Return type + + (empty response body) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/DomainInspector.md b/docs/DomainInspector.md index 66c6572..dc67c4b 100644 --- a/docs/DomainInspector.md +++ b/docs/DomainInspector.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Timestamp** | Pointer to [**SubsequentRequestTimestamp**](SubsequentRequestTimestamp.md) | | [optional] +**Timestamp** | Pointer to **int32** | Value to use for subsequent requests. | [optional] **AggregateDelay** | Pointer to **int32** | Offset of entry timestamps from the current time due to processing time. | [optional] **Data** | Pointer to [**[]DomainInspectorRealtimeEntry**](DomainInspectorRealtimeEntry.md) | A list of report [entries](#entry-data-model), each representing one second of time. | [optional] @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetTimestamp -`func (o *DomainInspector) GetTimestamp() SubsequentRequestTimestamp` +`func (o *DomainInspector) GetTimestamp() int32` GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. ### GetTimestampOk -`func (o *DomainInspector) GetTimestampOk() (*SubsequentRequestTimestamp, bool)` +`func (o *DomainInspector) GetTimestampOk() (*int32, bool)` GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTimestamp -`func (o *DomainInspector) SetTimestamp(v SubsequentRequestTimestamp)` +`func (o *DomainInspector) SetTimestamp(v int32)` SetTimestamp sets Timestamp field to given value. diff --git a/docs/DomainInspectorRealtimeEntry.md b/docs/DomainInspectorRealtimeEntry.md index a1a8779..16be3f6 100644 --- a/docs/DomainInspectorRealtimeEntry.md +++ b/docs/DomainInspectorRealtimeEntry.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Recorded** | Pointer to [**RecordedTimestamp**](RecordedTimestamp.md) | | [optional] +**Recorded** | Pointer to **int32** | The Unix timestamp at which this record's data was generated. | [optional] **Aggregated** | Pointer to [**map[string]DomainInspectorMeasurements**](domain_inspector_measurements.md) | Groups [measurements](#measurements-data-model) by backend name and then by IP address. | [optional] **Datacenter** | Pointer to [**map[string]map[string]DomainInspectorMeasurements**](map.md) | Groups [measurements](#measurements-data-model) by POP, then backend name, and then IP address. See the [POPs API](https://www.fastly.com/documentation/reference/api/utils/pops/) for details about POP identifiers. | [optional] @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetRecorded -`func (o *DomainInspectorRealtimeEntry) GetRecorded() RecordedTimestamp` +`func (o *DomainInspectorRealtimeEntry) GetRecorded() int32` GetRecorded returns the Recorded field if non-nil, zero value otherwise. ### GetRecordedOk -`func (o *DomainInspectorRealtimeEntry) GetRecordedOk() (*RecordedTimestamp, bool)` +`func (o *DomainInspectorRealtimeEntry) GetRecordedOk() (*int32, bool)` GetRecordedOk returns a tuple with the Recorded field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRecorded -`func (o *DomainInspectorRealtimeEntry) SetRecorded(v RecordedTimestamp)` +`func (o *DomainInspectorRealtimeEntry) SetRecorded(v int32)` SetRecorded sets Recorded field to given value. diff --git a/docs/EnabledProductsAPI.md b/docs/EnabledProductsAPI.md index 77aef67..6fe9b54 100644 --- a/docs/EnabledProductsAPI.md +++ b/docs/EnabledProductsAPI.md @@ -5,9 +5,11 @@ Method | HTTP request | Description ------------- | ------------- | ------------- -[**DisableProduct**](EnabledProductsAPI.md#DisableProduct) | **DELETE** `/enabled-products/{product_id}/services/{service_id}` | Disable a product -[**EnableProduct**](EnabledProductsAPI.md#EnableProduct) | **PUT** `/enabled-products/{product_id}/services/{service_id}` | Enable a product -[**GetEnabledProduct**](EnabledProductsAPI.md#GetEnabledProduct) | **GET** `/enabled-products/{product_id}/services/{service_id}` | Get enabled product +[**DisableProduct**](EnabledProductsAPI.md#DisableProduct) | **DELETE** `/enabled-products/v1/{product_id}/services/{service_id}` | Disable a product +[**EnableProduct**](EnabledProductsAPI.md#EnableProduct) | **PUT** `/enabled-products/v1/{product_id}/services/{service_id}` | Enable a product +[**GetEnabledProduct**](EnabledProductsAPI.md#GetEnabledProduct) | **GET** `/enabled-products/v1/{product_id}/services/{service_id}` | Get enabled product +[**GetProductConfiguration**](EnabledProductsAPI.md#GetProductConfiguration) | **GET** `/enabled-products/v1/{product_id}/services/{service_id}/configuration` | Get configuration for a product +[**SetProductConfiguration**](EnabledProductsAPI.md#SetProductConfiguration) | **PATCH** `/enabled-products/v1/{product_id}/services/{service_id}/configuration` | Update configuration for a product @@ -30,7 +32,7 @@ import ( ) func main() { - productID := "origin_inspector" // string | + productID := "ngwaf" // string | serviceID := "serviceId_example" // string | Alphanumeric string identifying the service. cfg := fastly.NewConfiguration() @@ -97,13 +99,14 @@ import ( ) func main() { - productID := "origin_inspector" // string | + productID := "ngwaf" // string | serviceID := "serviceId_example" // string | Alphanumeric string identifying the service. + setWorkspaceID := *openapiclient.NewSetWorkspaceID() // SetWorkspaceID | (optional) cfg := fastly.NewConfiguration() apiClient := fastly.NewAPIClient(cfg) ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") - resp, r, err := apiClient.EnabledProductsAPI.EnableProduct(ctx, productID, serviceID).Execute() + resp, r, err := apiClient.EnabledProductsAPI.EnableProduct(ctx, productID, serviceID).SetWorkspaceID(setWorkspaceID).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `EnabledProductsAPI.EnableProduct`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -129,7 +132,7 @@ Other parameters are passed through a pointer to a apiEnableProductRequest struc Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - + **setWorkspaceID** | [**SetWorkspaceID**](SetWorkspaceID.md) | | ### Return type @@ -141,7 +144,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) @@ -166,7 +169,7 @@ import ( ) func main() { - productID := "origin_inspector" // string | + productID := "ngwaf" // string | serviceID := "serviceId_example" // string | Alphanumeric string identifying the service. cfg := fastly.NewConfiguration() @@ -214,3 +217,142 @@ Name | Type | Description | Notes - **Accept**: application/json [Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## GetProductConfiguration + +Get configuration for a product + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + productID := "ngwaf" // string | + serviceID := "serviceId_example" // string | Alphanumeric string identifying the service. + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.EnabledProductsAPI.GetProductConfiguration(ctx, productID, serviceID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EnabledProductsAPI.GetProductConfiguration`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetProductConfiguration`: ConfiguredProductResponse + fmt.Fprintf(os.Stdout, "Response from `EnabledProductsAPI.GetProductConfiguration`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**productID** | **string** | | +**serviceID** | **string** | Alphanumeric string identifying the service. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetProductConfigurationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ConfiguredProductResponse**](ConfiguredProductResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## SetProductConfiguration + +Update configuration for a product + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + productID := "ngwaf" // string | + serviceID := "serviceId_example" // string | Alphanumeric string identifying the service. + setConfiguration := *openapiclient.NewSetConfiguration() // SetConfiguration | (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.EnabledProductsAPI.SetProductConfiguration(ctx, productID, serviceID).SetConfiguration(setConfiguration).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EnabledProductsAPI.SetProductConfiguration`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetProductConfiguration`: ConfiguredProductResponse + fmt.Fprintf(os.Stdout, "Response from `EnabledProductsAPI.SetProductConfiguration`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**productID** | **string** | | +**serviceID** | **string** | Alphanumeric string identifying the service. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSetProductConfigurationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **setConfiguration** | [**SetConfiguration**](SetConfiguration.md) | | + +### Return type + +[**ConfiguredProductResponse**](ConfiguredProductResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/Environment.md b/docs/Environment.md new file mode 100644 index 0000000..20bb7fe --- /dev/null +++ b/docs/Environment.md @@ -0,0 +1,106 @@ +# Environment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] [readonly] +**ServiceID** | Pointer to **string** | Alphanumeric string identifying the service. | [optional] [readonly] +**ActiveVersion** | Pointer to **int32** | | [optional] [readonly] + +## Methods + +### NewEnvironment + +`func NewEnvironment() *Environment` + +NewEnvironment instantiates a new Environment object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEnvironmentWithDefaults + +`func NewEnvironmentWithDefaults() *Environment` + +NewEnvironmentWithDefaults instantiates a new Environment object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Environment) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Environment) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Environment) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Environment) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetServiceID + +`func (o *Environment) GetServiceID() string` + +GetServiceID returns the ServiceID field if non-nil, zero value otherwise. + +### GetServiceIDOk + +`func (o *Environment) GetServiceIDOk() (*string, bool)` + +GetServiceIDOk returns a tuple with the ServiceID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceID + +`func (o *Environment) SetServiceID(v string)` + +SetServiceID sets ServiceID field to given value. + +### HasServiceID + +`func (o *Environment) HasServiceID() bool` + +HasServiceID returns a boolean if a field has been set. + +### GetActiveVersion + +`func (o *Environment) GetActiveVersion() int32` + +GetActiveVersion returns the ActiveVersion field if non-nil, zero value otherwise. + +### GetActiveVersionOk + +`func (o *Environment) GetActiveVersionOk() (*int32, bool)` + +GetActiveVersionOk returns a tuple with the ActiveVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActiveVersion + +`func (o *Environment) SetActiveVersion(v int32)` + +SetActiveVersion sets ActiveVersion field to given value. + +### HasActiveVersion + +`func (o *Environment) HasActiveVersion() bool` + +HasActiveVersion returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/EnvironmentName.md b/docs/EnvironmentName.md new file mode 100644 index 0000000..1e91c2b --- /dev/null +++ b/docs/EnvironmentName.md @@ -0,0 +1,9 @@ +# EnvironmentName + +## Enum + + +* `STAGING` (value: `"staging"`) + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/InlineResponse201.md b/docs/InlineResponse201.md new file mode 100644 index 0000000..9a3f111 --- /dev/null +++ b/docs/InlineResponse201.md @@ -0,0 +1,54 @@ +# InlineResponse201 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ID** | Pointer to **string** | Alphanumeric string identifying the address. | [optional] + +## Methods + +### NewInlineResponse201 + +`func NewInlineResponse201() *InlineResponse201` + +NewInlineResponse201 instantiates a new InlineResponse201 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse201WithDefaults + +`func NewInlineResponse201WithDefaults() *InlineResponse201` + +NewInlineResponse201WithDefaults instantiates a new InlineResponse201 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetID + +`func (o *InlineResponse201) GetID() string` + +GetID returns the ID field if non-nil, zero value otherwise. + +### GetIDOk + +`func (o *InlineResponse201) GetIDOk() (*string, bool)` + +GetIDOk returns a tuple with the ID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetID + +`func (o *InlineResponse201) SetID(v string)` + +SetID sets ID field to given value. + +### HasID + +`func (o *InlineResponse201) HasID() bool` + +HasID returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/LineItemData.md b/docs/LineItemData.md index 4ce5201..1644958 100644 --- a/docs/LineItemData.md +++ b/docs/LineItemData.md @@ -4,21 +4,21 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Amount** | Pointer to **float32** | | [optional] -**AriaInvoiceID** | Pointer to **string** | An alphanumeric string identifying the invoice. | [optional] [readonly] -**ClientServiceID** | Pointer to **string** | | [optional] +**Amount** | Pointer to **NullableFloat32** | | [optional] +**AriaInvoiceID** | Pointer to **NullableString** | An alphanumeric string identifying the invoice. | [optional] [readonly] +**ClientServiceID** | Pointer to **NullableString** | | [optional] **CreditCouponCode** | Pointer to **NullableString** | | [optional] -**Description** | Pointer to **string** | | [optional] +**Description** | Pointer to **NullableString** | | [optional] **ID** | Pointer to **string** | | [optional] -**LineNumber** | Pointer to **int32** | | [optional] -**PlanName** | Pointer to **string** | | [optional] -**PlanNo** | Pointer to **float32** | | [optional] +**LineNumber** | Pointer to **NullableInt32** | | [optional] +**PlanName** | Pointer to **NullableString** | | [optional] +**PlanNo** | Pointer to **NullableFloat32** | | [optional] **RatePerUnit** | Pointer to **NullableFloat32** | | [optional] **RateScheduleNo** | Pointer to **NullableFloat32** | | [optional] **RateScheduleTierNo** | Pointer to **NullableFloat32** | | [optional] -**ServiceName** | Pointer to **string** | | [optional] -**ServiceNo** | Pointer to **float32** | | [optional] -**Units** | Pointer to **float32** | | [optional] +**ServiceName** | Pointer to **NullableString** | | [optional] +**ServiceNo** | Pointer to **NullableFloat32** | | [optional] +**Units** | Pointer to **NullableFloat32** | | [optional] **UsageTypeCd** | Pointer to **NullableString** | | [optional] **UsageTypeNo** | Pointer to **NullableFloat32** | | [optional] @@ -66,6 +66,16 @@ SetAmount sets Amount field to given value. HasAmount returns a boolean if a field has been set. +### SetAmountNil + +`func (o *LineItemData) SetAmountNil(b bool)` + + SetAmountNil sets the value for Amount to be an explicit nil + +### UnsetAmount +`func (o *LineItemData) UnsetAmount()` + +UnsetAmount ensures that no value is present for Amount, not even an explicit nil ### GetAriaInvoiceID `func (o *LineItemData) GetAriaInvoiceID() string` @@ -91,6 +101,16 @@ SetAriaInvoiceID sets AriaInvoiceID field to given value. HasAriaInvoiceID returns a boolean if a field has been set. +### SetAriaInvoiceIDNil + +`func (o *LineItemData) SetAriaInvoiceIDNil(b bool)` + + SetAriaInvoiceIDNil sets the value for AriaInvoiceID to be an explicit nil + +### UnsetAriaInvoiceID +`func (o *LineItemData) UnsetAriaInvoiceID()` + +UnsetAriaInvoiceID ensures that no value is present for AriaInvoiceID, not even an explicit nil ### GetClientServiceID `func (o *LineItemData) GetClientServiceID() string` @@ -116,6 +136,16 @@ SetClientServiceID sets ClientServiceID field to given value. HasClientServiceID returns a boolean if a field has been set. +### SetClientServiceIDNil + +`func (o *LineItemData) SetClientServiceIDNil(b bool)` + + SetClientServiceIDNil sets the value for ClientServiceID to be an explicit nil + +### UnsetClientServiceID +`func (o *LineItemData) UnsetClientServiceID()` + +UnsetClientServiceID ensures that no value is present for ClientServiceID, not even an explicit nil ### GetCreditCouponCode `func (o *LineItemData) GetCreditCouponCode() string` @@ -176,6 +206,16 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### SetDescriptionNil + +`func (o *LineItemData) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *LineItemData) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil ### GetID `func (o *LineItemData) GetID() string` @@ -226,6 +266,16 @@ SetLineNumber sets LineNumber field to given value. HasLineNumber returns a boolean if a field has been set. +### SetLineNumberNil + +`func (o *LineItemData) SetLineNumberNil(b bool)` + + SetLineNumberNil sets the value for LineNumber to be an explicit nil + +### UnsetLineNumber +`func (o *LineItemData) UnsetLineNumber()` + +UnsetLineNumber ensures that no value is present for LineNumber, not even an explicit nil ### GetPlanName `func (o *LineItemData) GetPlanName() string` @@ -251,6 +301,16 @@ SetPlanName sets PlanName field to given value. HasPlanName returns a boolean if a field has been set. +### SetPlanNameNil + +`func (o *LineItemData) SetPlanNameNil(b bool)` + + SetPlanNameNil sets the value for PlanName to be an explicit nil + +### UnsetPlanName +`func (o *LineItemData) UnsetPlanName()` + +UnsetPlanName ensures that no value is present for PlanName, not even an explicit nil ### GetPlanNo `func (o *LineItemData) GetPlanNo() float32` @@ -276,6 +336,16 @@ SetPlanNo sets PlanNo field to given value. HasPlanNo returns a boolean if a field has been set. +### SetPlanNoNil + +`func (o *LineItemData) SetPlanNoNil(b bool)` + + SetPlanNoNil sets the value for PlanNo to be an explicit nil + +### UnsetPlanNo +`func (o *LineItemData) UnsetPlanNo()` + +UnsetPlanNo ensures that no value is present for PlanNo, not even an explicit nil ### GetRatePerUnit `func (o *LineItemData) GetRatePerUnit() float32` @@ -406,6 +476,16 @@ SetServiceName sets ServiceName field to given value. HasServiceName returns a boolean if a field has been set. +### SetServiceNameNil + +`func (o *LineItemData) SetServiceNameNil(b bool)` + + SetServiceNameNil sets the value for ServiceName to be an explicit nil + +### UnsetServiceName +`func (o *LineItemData) UnsetServiceName()` + +UnsetServiceName ensures that no value is present for ServiceName, not even an explicit nil ### GetServiceNo `func (o *LineItemData) GetServiceNo() float32` @@ -431,6 +511,16 @@ SetServiceNo sets ServiceNo field to given value. HasServiceNo returns a boolean if a field has been set. +### SetServiceNoNil + +`func (o *LineItemData) SetServiceNoNil(b bool)` + + SetServiceNoNil sets the value for ServiceNo to be an explicit nil + +### UnsetServiceNo +`func (o *LineItemData) UnsetServiceNo()` + +UnsetServiceNo ensures that no value is present for ServiceNo, not even an explicit nil ### GetUnits `func (o *LineItemData) GetUnits() float32` @@ -456,6 +546,16 @@ SetUnits sets Units field to given value. HasUnits returns a boolean if a field has been set. +### SetUnitsNil + +`func (o *LineItemData) SetUnitsNil(b bool)` + + SetUnitsNil sets the value for Units to be an explicit nil + +### UnsetUnits +`func (o *LineItemData) UnsetUnits()` + +UnsetUnits ensures that no value is present for Units, not even an explicit nil ### GetUsageTypeCd `func (o *LineItemData) GetUsageTypeCd() string` diff --git a/docs/ListCustomerAddressesResponse.md b/docs/ListCustomerAddressesResponse.md new file mode 100644 index 0000000..e54c2c9 --- /dev/null +++ b/docs/ListCustomerAddressesResponse.md @@ -0,0 +1,54 @@ +# ListCustomerAddressesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**[]CustomerAddress**](CustomerAddress.md) | | [optional] + +## Methods + +### NewListCustomerAddressesResponse + +`func NewListCustomerAddressesResponse() *ListCustomerAddressesResponse` + +NewListCustomerAddressesResponse instantiates a new ListCustomerAddressesResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListCustomerAddressesResponseWithDefaults + +`func NewListCustomerAddressesResponseWithDefaults() *ListCustomerAddressesResponse` + +NewListCustomerAddressesResponseWithDefaults instantiates a new ListCustomerAddressesResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetData + +`func (o *ListCustomerAddressesResponse) GetData() []CustomerAddress` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *ListCustomerAddressesResponse) GetDataOk() (*[]CustomerAddress, bool)` + +GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetData + +`func (o *ListCustomerAddressesResponse) SetData(v []CustomerAddress)` + +SetData sets Data field to given value. + +### HasData + +`func (o *ListCustomerAddressesResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/OriginInspector.md b/docs/OriginInspector.md index 94670ab..d622763 100644 --- a/docs/OriginInspector.md +++ b/docs/OriginInspector.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Timestamp** | Pointer to [**OriginInspectorSubsequentRequestTimestamp**](OriginInspectorSubsequentRequestTimestamp.md) | | [optional] +**Timestamp** | Pointer to **int32** | Value to use for subsequent requests. | [optional] **AggregateDelay** | Pointer to **int32** | Offset of entry timestamps from the current time due to processing time. | [optional] **Data** | Pointer to [**[]OriginInspectorRealtimeEntry**](OriginInspectorRealtimeEntry.md) | A list of report [entries](#entry-data-model), each representing one second of time. | [optional] @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetTimestamp -`func (o *OriginInspector) GetTimestamp() OriginInspectorSubsequentRequestTimestamp` +`func (o *OriginInspector) GetTimestamp() int32` GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. ### GetTimestampOk -`func (o *OriginInspector) GetTimestampOk() (*OriginInspectorSubsequentRequestTimestamp, bool)` +`func (o *OriginInspector) GetTimestampOk() (*int32, bool)` GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTimestamp -`func (o *OriginInspector) SetTimestamp(v OriginInspectorSubsequentRequestTimestamp)` +`func (o *OriginInspector) SetTimestamp(v int32)` SetTimestamp sets Timestamp field to given value. diff --git a/docs/OriginInspectorRealtimeEntry.md b/docs/OriginInspectorRealtimeEntry.md index d5847bb..e60687f 100644 --- a/docs/OriginInspectorRealtimeEntry.md +++ b/docs/OriginInspectorRealtimeEntry.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Recorded** | Pointer to [**OriginInspectorRealtimeEntryRecorded**](OriginInspectorRealtimeEntryRecorded.md) | | [optional] +**Recorded** | Pointer to **int32** | The Unix timestamp at which this record's data was generated. | [optional] **Aggregated** | Pointer to [**map[string]OriginInspectorMeasurements**](OriginInspectorMeasurements.md) | Groups [measurements](#measurements-data-model) by backend name. | [optional] **Datacenter** | Pointer to [**map[string]map[string]OriginInspectorMeasurements**](map.md) | Groups [measurements](#measurements-data-model) by POP, then backend name. See the [POPs API](https://www.fastly.com/documentation/reference/api/utils/pops/) for details about POP identifiers. | [optional] @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetRecorded -`func (o *OriginInspectorRealtimeEntry) GetRecorded() OriginInspectorRealtimeEntryRecorded` +`func (o *OriginInspectorRealtimeEntry) GetRecorded() int32` GetRecorded returns the Recorded field if non-nil, zero value otherwise. ### GetRecordedOk -`func (o *OriginInspectorRealtimeEntry) GetRecordedOk() (*OriginInspectorRealtimeEntryRecorded, bool)` +`func (o *OriginInspectorRealtimeEntry) GetRecordedOk() (*int32, bool)` GetRecordedOk returns a tuple with the Recorded field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRecorded -`func (o *OriginInspectorRealtimeEntry) SetRecorded(v OriginInspectorRealtimeEntryRecorded)` +`func (o *OriginInspectorRealtimeEntry) SetRecorded(v int32)` SetRecorded sets Recorded field to given value. diff --git a/docs/OriginInspectorRealtimeEntryRecorded.md b/docs/OriginInspectorRealtimeEntryRecorded.md deleted file mode 100644 index acc7259..0000000 --- a/docs/OriginInspectorRealtimeEntryRecorded.md +++ /dev/null @@ -1,28 +0,0 @@ -# OriginInspectorRealtimeEntryRecorded - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Methods - -### NewOriginInspectorRealtimeEntryRecorded - -`func NewOriginInspectorRealtimeEntryRecorded() *OriginInspectorRealtimeEntryRecorded` - -NewOriginInspectorRealtimeEntryRecorded instantiates a new OriginInspectorRealtimeEntryRecorded object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewOriginInspectorRealtimeEntryRecordedWithDefaults - -`func NewOriginInspectorRealtimeEntryRecordedWithDefaults() *OriginInspectorRealtimeEntryRecorded` - -NewOriginInspectorRealtimeEntryRecordedWithDefaults instantiates a new OriginInspectorRealtimeEntryRecorded object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - - -[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/OriginInspectorSubsequentRequestTimestamp.md b/docs/OriginInspectorSubsequentRequestTimestamp.md deleted file mode 100644 index adda4e7..0000000 --- a/docs/OriginInspectorSubsequentRequestTimestamp.md +++ /dev/null @@ -1,28 +0,0 @@ -# OriginInspectorSubsequentRequestTimestamp - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Methods - -### NewOriginInspectorSubsequentRequestTimestamp - -`func NewOriginInspectorSubsequentRequestTimestamp() *OriginInspectorSubsequentRequestTimestamp` - -NewOriginInspectorSubsequentRequestTimestamp instantiates a new OriginInspectorSubsequentRequestTimestamp object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewOriginInspectorSubsequentRequestTimestampWithDefaults - -`func NewOriginInspectorSubsequentRequestTimestampWithDefaults() *OriginInspectorSubsequentRequestTimestamp` - -NewOriginInspectorSubsequentRequestTimestampWithDefaults instantiates a new OriginInspectorSubsequentRequestTimestamp object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - - -[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/RealtimeEntryAggregated.md b/docs/RealtimeEntryAggregated.md index 4f43c3d..f297d88 100644 --- a/docs/RealtimeEntryAggregated.md +++ b/docs/RealtimeEntryAggregated.md @@ -253,6 +253,7 @@ Name | Type | Description | Notes **AllStatus4xx** | Pointer to **int32** | Number of \"Client Error\" codes delivered for all sources. | [optional] **AllStatus5xx** | Pointer to **int32** | Number of \"Server Error\" codes delivered for all sources. | [optional] **OriginOffload** | Pointer to **float32** | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). | [optional] +**RequestDeniedGetHeadBody** | Pointer to **int32** | Number of requests where Fastly responded with 400 due to the request being a GET or HEAD request containing a body. | [optional] ## Methods @@ -6498,5 +6499,30 @@ SetOriginOffload sets OriginOffload field to given value. HasOriginOffload returns a boolean if a field has been set. +### GetRequestDeniedGetHeadBody + +`func (o *RealtimeEntryAggregated) GetRequestDeniedGetHeadBody() int32` + +GetRequestDeniedGetHeadBody returns the RequestDeniedGetHeadBody field if non-nil, zero value otherwise. + +### GetRequestDeniedGetHeadBodyOk + +`func (o *RealtimeEntryAggregated) GetRequestDeniedGetHeadBodyOk() (*int32, bool)` + +GetRequestDeniedGetHeadBodyOk returns a tuple with the RequestDeniedGetHeadBody field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestDeniedGetHeadBody + +`func (o *RealtimeEntryAggregated) SetRequestDeniedGetHeadBody(v int32)` + +SetRequestDeniedGetHeadBody sets RequestDeniedGetHeadBody field to given value. + +### HasRequestDeniedGetHeadBody + +`func (o *RealtimeEntryAggregated) HasRequestDeniedGetHeadBody() bool` + +HasRequestDeniedGetHeadBody returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/RealtimeMeasurements.md b/docs/RealtimeMeasurements.md index 3afc473..7f85a95 100644 --- a/docs/RealtimeMeasurements.md +++ b/docs/RealtimeMeasurements.md @@ -253,6 +253,7 @@ Name | Type | Description | Notes **AllStatus4xx** | Pointer to **int32** | Number of \"Client Error\" codes delivered for all sources. | [optional] **AllStatus5xx** | Pointer to **int32** | Number of \"Server Error\" codes delivered for all sources. | [optional] **OriginOffload** | Pointer to **float32** | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). | [optional] +**RequestDeniedGetHeadBody** | Pointer to **int32** | Number of requests where Fastly responded with 400 due to the request being a GET or HEAD request containing a body. | [optional] ## Methods @@ -6498,5 +6499,30 @@ SetOriginOffload sets OriginOffload field to given value. HasOriginOffload returns a boolean if a field has been set. +### GetRequestDeniedGetHeadBody + +`func (o *RealtimeMeasurements) GetRequestDeniedGetHeadBody() int32` + +GetRequestDeniedGetHeadBody returns the RequestDeniedGetHeadBody field if non-nil, zero value otherwise. + +### GetRequestDeniedGetHeadBodyOk + +`func (o *RealtimeMeasurements) GetRequestDeniedGetHeadBodyOk() (*int32, bool)` + +GetRequestDeniedGetHeadBodyOk returns a tuple with the RequestDeniedGetHeadBody field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestDeniedGetHeadBody + +`func (o *RealtimeMeasurements) SetRequestDeniedGetHeadBody(v int32)` + +SetRequestDeniedGetHeadBody sets RequestDeniedGetHeadBody field to given value. + +### HasRequestDeniedGetHeadBody + +`func (o *RealtimeMeasurements) HasRequestDeniedGetHeadBody() bool` + +HasRequestDeniedGetHeadBody returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/RecordedTimestamp.md b/docs/RecordedTimestamp.md deleted file mode 100644 index 486222a..0000000 --- a/docs/RecordedTimestamp.md +++ /dev/null @@ -1,28 +0,0 @@ -# RecordedTimestamp - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Methods - -### NewRecordedTimestamp - -`func NewRecordedTimestamp() *RecordedTimestamp` - -NewRecordedTimestamp instantiates a new RecordedTimestamp object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRecordedTimestampWithDefaults - -`func NewRecordedTimestampWithDefaults() *RecordedTimestamp` - -NewRecordedTimestampWithDefaults instantiates a new RecordedTimestamp object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - - -[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/Results.md b/docs/Results.md index 1358342..cbdb7be 100644 --- a/docs/Results.md +++ b/docs/Results.md @@ -253,6 +253,7 @@ Name | Type | Description | Notes **AllStatus4xx** | Pointer to **int32** | Number of \"Client Error\" codes delivered for all sources. | [optional] **AllStatus5xx** | Pointer to **int32** | Number of \"Server Error\" codes delivered for all sources. | [optional] **OriginOffload** | Pointer to **float32** | Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). | [optional] +**RequestDeniedGetHeadBody** | Pointer to **int32** | Number of requests where Fastly responded with 400 due to the request being a GET or HEAD request containing a body. | [optional] **ServiceID** | Pointer to **string** | | [optional] [readonly] **StartTime** | Pointer to **int32** | Timestamp for the start of the time period being reported | [optional] @@ -6510,6 +6511,31 @@ SetOriginOffload sets OriginOffload field to given value. HasOriginOffload returns a boolean if a field has been set. +### GetRequestDeniedGetHeadBody + +`func (o *Results) GetRequestDeniedGetHeadBody() int32` + +GetRequestDeniedGetHeadBody returns the RequestDeniedGetHeadBody field if non-nil, zero value otherwise. + +### GetRequestDeniedGetHeadBodyOk + +`func (o *Results) GetRequestDeniedGetHeadBodyOk() (*int32, bool)` + +GetRequestDeniedGetHeadBodyOk returns a tuple with the RequestDeniedGetHeadBody field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestDeniedGetHeadBody + +`func (o *Results) SetRequestDeniedGetHeadBody(v int32)` + +SetRequestDeniedGetHeadBody sets RequestDeniedGetHeadBody field to given value. + +### HasRequestDeniedGetHeadBody + +`func (o *Results) HasRequestDeniedGetHeadBody() bool` + +HasRequestDeniedGetHeadBody returns a boolean if a field has been set. + ### GetServiceID `func (o *Results) GetServiceID() string` diff --git a/docs/SchemasVersionResponse.md b/docs/SchemasVersionResponse.md index 3120069..dd9f0a1 100644 --- a/docs/SchemasVersionResponse.md +++ b/docs/SchemasVersionResponse.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **DeletedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **UpdatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **ServiceID** | Pointer to **string** | | [optional] [readonly] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] ## Methods @@ -350,5 +351,30 @@ SetServiceID sets ServiceID field to given value. HasServiceID returns a boolean if a field has been set. +### GetEnvironments + +`func (o *SchemasVersionResponse) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *SchemasVersionResponse) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *SchemasVersionResponse) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *SchemasVersionResponse) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ServiceDetail.md b/docs/ServiceDetail.md index f0107a6..0a5c42d 100644 --- a/docs/ServiceDetail.md +++ b/docs/ServiceDetail.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **PublishKey** | Pointer to **string** | Unused at this time. | [optional] **Paused** | Pointer to **bool** | Whether the service is paused. Services are paused due to a lack of traffic for an extended period of time. Services are resumed either when a draft version is activated or a locked version is cloned and reactivated. | [optional] **Versions** | Pointer to [**[]SchemasVersionResponse**](SchemasVersionResponse.md) | A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. | [optional] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] **ActiveVersion** | Pointer to [**NullableServiceVersionDetailOrNull**](ServiceVersionDetailOrNull.md) | | [optional] **Version** | Pointer to [**ServiceVersionDetail**](ServiceVersionDetail.md) | | [optional] @@ -352,6 +353,31 @@ SetVersions sets Versions field to given value. HasVersions returns a boolean if a field has been set. +### GetEnvironments + +`func (o *ServiceDetail) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *ServiceDetail) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *ServiceDetail) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *ServiceDetail) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + ### GetActiveVersion `func (o *ServiceDetail) GetActiveVersion() ServiceVersionDetailOrNull` diff --git a/docs/ServiceListResponse.md b/docs/ServiceListResponse.md index ce7d1d6..66f9e5f 100644 --- a/docs/ServiceListResponse.md +++ b/docs/ServiceListResponse.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **ID** | Pointer to **string** | | [optional] [readonly] **Version** | Pointer to **int32** | Current [version](https://www.fastly.com/documentation/reference/api/services/version/) of the service. | [optional] **Versions** | Pointer to [**[]SchemasVersionResponse**](SchemasVersionResponse.md) | A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. | [optional] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] ## Methods @@ -324,5 +325,30 @@ SetVersions sets Versions field to given value. HasVersions returns a boolean if a field has been set. +### GetEnvironments + +`func (o *ServiceListResponse) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *ServiceListResponse) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *ServiceListResponse) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *ServiceListResponse) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ServiceListResponseAllOf.md b/docs/ServiceListResponseAllOf.md index 2337e0e..f3fbb08 100644 --- a/docs/ServiceListResponseAllOf.md +++ b/docs/ServiceListResponseAllOf.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **ID** | Pointer to **string** | | [optional] [readonly] **Version** | Pointer to **int32** | Current [version](https://www.fastly.com/documentation/reference/api/services/version/) of the service. | [optional] **Versions** | Pointer to [**[]SchemasVersionResponse**](SchemasVersionResponse.md) | A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. | [optional] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] ## Methods @@ -102,5 +103,30 @@ SetVersions sets Versions field to given value. HasVersions returns a boolean if a field has been set. +### GetEnvironments + +`func (o *ServiceListResponseAllOf) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *ServiceListResponseAllOf) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *ServiceListResponseAllOf) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *ServiceListResponseAllOf) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ServiceResponse.md b/docs/ServiceResponse.md index 2aab2b1..4376b88 100644 --- a/docs/ServiceResponse.md +++ b/docs/ServiceResponse.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **PublishKey** | Pointer to **string** | Unused at this time. | [optional] **Paused** | Pointer to **bool** | Whether the service is paused. Services are paused due to a lack of traffic for an extended period of time. Services are resumed either when a draft version is activated or a locked version is cloned and reactivated. | [optional] **Versions** | Pointer to [**[]SchemasVersionResponse**](SchemasVersionResponse.md) | A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. | [optional] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] ## Methods @@ -350,5 +351,30 @@ SetVersions sets Versions field to given value. HasVersions returns a boolean if a field has been set. +### GetEnvironments + +`func (o *ServiceResponse) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *ServiceResponse) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *ServiceResponse) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *ServiceResponse) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ServiceResponseAllOf.md b/docs/ServiceResponseAllOf.md index f8a26fb..20b34f7 100644 --- a/docs/ServiceResponseAllOf.md +++ b/docs/ServiceResponseAllOf.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **PublishKey** | Pointer to **string** | Unused at this time. | [optional] **Paused** | Pointer to **bool** | Whether the service is paused. Services are paused due to a lack of traffic for an extended period of time. Services are resumed either when a draft version is activated or a locked version is cloned and reactivated. | [optional] **Versions** | Pointer to [**[]SchemasVersionResponse**](SchemasVersionResponse.md) | A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. | [optional] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] ## Methods @@ -128,5 +129,30 @@ SetVersions sets Versions field to given value. HasVersions returns a boolean if a field has been set. +### GetEnvironments + +`func (o *ServiceResponseAllOf) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *ServiceResponseAllOf) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *ServiceResponseAllOf) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *ServiceResponseAllOf) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/ServiceVersionDetail.md b/docs/ServiceVersionDetail.md index dc42a16..c924182 100644 --- a/docs/ServiceVersionDetail.md +++ b/docs/ServiceVersionDetail.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **DeletedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **UpdatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **ServiceID** | Pointer to **string** | | [optional] [readonly] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] **Backends** | Pointer to [**[]BackendResponse**](BackendResponse.md) | List of backends associated to this service. | [optional] **CacheSettings** | Pointer to [**[]CacheSettingResponse**](CacheSettingResponse.md) | List of cache settings associated to this service. | [optional] **Conditions** | Pointer to [**[]ConditionResponse**](ConditionResponse.md) | List of conditions associated to this service. | [optional] @@ -364,6 +365,31 @@ SetServiceID sets ServiceID field to given value. HasServiceID returns a boolean if a field has been set. +### GetEnvironments + +`func (o *ServiceVersionDetail) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *ServiceVersionDetail) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *ServiceVersionDetail) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *ServiceVersionDetail) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + ### GetBackends `func (o *ServiceVersionDetail) GetBackends() []BackendResponse` diff --git a/docs/ServiceVersionDetailOrNull.md b/docs/ServiceVersionDetailOrNull.md index 67ebae9..4b8014a 100644 --- a/docs/ServiceVersionDetailOrNull.md +++ b/docs/ServiceVersionDetailOrNull.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **DeletedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **UpdatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **ServiceID** | Pointer to **string** | | [optional] [readonly] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] **Backends** | Pointer to [**[]BackendResponse**](BackendResponse.md) | List of backends associated to this service. | [optional] **CacheSettings** | Pointer to [**[]CacheSettingResponse**](CacheSettingResponse.md) | List of cache settings associated to this service. | [optional] **Conditions** | Pointer to [**[]ConditionResponse**](ConditionResponse.md) | List of conditions associated to this service. | [optional] @@ -364,6 +365,31 @@ SetServiceID sets ServiceID field to given value. HasServiceID returns a boolean if a field has been set. +### GetEnvironments + +`func (o *ServiceVersionDetailOrNull) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *ServiceVersionDetailOrNull) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *ServiceVersionDetailOrNull) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *ServiceVersionDetailOrNull) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + ### GetBackends `func (o *ServiceVersionDetailOrNull) GetBackends() []BackendResponse` diff --git a/docs/SetConfiguration.md b/docs/SetConfiguration.md new file mode 100644 index 0000000..defdcce --- /dev/null +++ b/docs/SetConfiguration.md @@ -0,0 +1,80 @@ +# SetConfiguration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**WorkspaceID** | Pointer to **string** | The new workspace_id. Required in the `PUT` request body when `product_id` is `ngwaf`. Optional in the `PATCH` request body for `ngwaf`. | [optional] +**TrafficRamp** | Pointer to **string** | The new traffic ramp. Optional in the `PATCH` request body for `ngwaf`. | [optional] + +## Methods + +### NewSetConfiguration + +`func NewSetConfiguration() *SetConfiguration` + +NewSetConfiguration instantiates a new SetConfiguration object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSetConfigurationWithDefaults + +`func NewSetConfigurationWithDefaults() *SetConfiguration` + +NewSetConfigurationWithDefaults instantiates a new SetConfiguration object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetWorkspaceID + +`func (o *SetConfiguration) GetWorkspaceID() string` + +GetWorkspaceID returns the WorkspaceID field if non-nil, zero value otherwise. + +### GetWorkspaceIDOk + +`func (o *SetConfiguration) GetWorkspaceIDOk() (*string, bool)` + +GetWorkspaceIDOk returns a tuple with the WorkspaceID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkspaceID + +`func (o *SetConfiguration) SetWorkspaceID(v string)` + +SetWorkspaceID sets WorkspaceID field to given value. + +### HasWorkspaceID + +`func (o *SetConfiguration) HasWorkspaceID() bool` + +HasWorkspaceID returns a boolean if a field has been set. + +### GetTrafficRamp + +`func (o *SetConfiguration) GetTrafficRamp() string` + +GetTrafficRamp returns the TrafficRamp field if non-nil, zero value otherwise. + +### GetTrafficRampOk + +`func (o *SetConfiguration) GetTrafficRampOk() (*string, bool)` + +GetTrafficRampOk returns a tuple with the TrafficRamp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTrafficRamp + +`func (o *SetConfiguration) SetTrafficRamp(v string)` + +SetTrafficRamp sets TrafficRamp field to given value. + +### HasTrafficRamp + +`func (o *SetConfiguration) HasTrafficRamp() bool` + +HasTrafficRamp returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/SetWorkspaceId.md b/docs/SetWorkspaceId.md new file mode 100644 index 0000000..abbf030 --- /dev/null +++ b/docs/SetWorkspaceId.md @@ -0,0 +1,54 @@ +# SetWorkspaceID + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**WorkspaceID** | Pointer to **string** | The workspace to link with the Next-Gen WAF product. Note this body is only supported and required when `product_id` is `ngwaf` | [optional] + +## Methods + +### NewSetWorkspaceID + +`func NewSetWorkspaceID() *SetWorkspaceID` + +NewSetWorkspaceID instantiates a new SetWorkspaceID object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSetWorkspaceIDWithDefaults + +`func NewSetWorkspaceIDWithDefaults() *SetWorkspaceID` + +NewSetWorkspaceIDWithDefaults instantiates a new SetWorkspaceID object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetWorkspaceID + +`func (o *SetWorkspaceID) GetWorkspaceID() string` + +GetWorkspaceID returns the WorkspaceID field if non-nil, zero value otherwise. + +### GetWorkspaceIDOk + +`func (o *SetWorkspaceID) GetWorkspaceIDOk() (*string, bool)` + +GetWorkspaceIDOk returns a tuple with the WorkspaceID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkspaceID + +`func (o *SetWorkspaceID) SetWorkspaceID(v string)` + +SetWorkspaceID sets WorkspaceID field to given value. + +### HasWorkspaceID + +`func (o *SetWorkspaceID) HasWorkspaceID() bool` + +HasWorkspaceID returns a boolean if a field has been set. + + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/SubsequentRequestTimestamp.md b/docs/SubsequentRequestTimestamp.md deleted file mode 100644 index e2d3741..0000000 --- a/docs/SubsequentRequestTimestamp.md +++ /dev/null @@ -1,28 +0,0 @@ -# SubsequentRequestTimestamp - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Methods - -### NewSubsequentRequestTimestamp - -`func NewSubsequentRequestTimestamp() *SubsequentRequestTimestamp` - -NewSubsequentRequestTimestamp instantiates a new SubsequentRequestTimestamp object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewSubsequentRequestTimestampWithDefaults - -`func NewSubsequentRequestTimestampWithDefaults() *SubsequentRequestTimestamp` - -NewSubsequentRequestTimestampWithDefaults instantiates a new SubsequentRequestTimestamp object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - - -[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/TlsCertificatesAPI.md b/docs/TlsCertificatesAPI.md index 66bdb65..b388852 100644 --- a/docs/TlsCertificatesAPI.md +++ b/docs/TlsCertificatesAPI.md @@ -299,14 +299,14 @@ func main() { filterNotAfter := "filterNotAfter_example" // string | Limit the returned certificates to those that expire prior to the specified date in UTC. Accepts parameters: lte (e.g., filter[not_after][lte]=2020-05-05). (optional) filterTLSDomainsID := "filterTLSDomainsId_example" // string | Limit the returned certificates to those that include the specific domain. (optional) include := "include_example" // string | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`. (optional) + sort := "sort_example" // string | The order in which to list the results. (optional) (default to "-created_at") pageNumber := int32(1) // int32 | Current page. (optional) pageSize := int32(20) // int32 | Number of records per page. (optional) (default to 20) - sort := "created_at" // string | The order in which to list the results by creation date. (optional) (default to "created_at") cfg := fastly.NewConfiguration() apiClient := fastly.NewAPIClient(cfg) ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") - resp, r, err := apiClient.TLSCertificatesAPI.ListTLSCerts(ctx).FilterInUse(filterInUse).FilterNotAfter(filterNotAfter).FilterTLSDomainsID(filterTLSDomainsID).Include(include).PageNumber(pageNumber).PageSize(pageSize).Sort(sort).Execute() + resp, r, err := apiClient.TLSCertificatesAPI.ListTLSCerts(ctx).FilterInUse(filterInUse).FilterNotAfter(filterNotAfter).FilterTLSDomainsID(filterTLSDomainsID).Include(include).Sort(sort).PageNumber(pageNumber).PageSize(pageSize).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `TLSCertificatesAPI.ListTLSCerts`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -327,7 +327,7 @@ Other parameters are passed through a pointer to a apiListTLSCertsRequest struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filterInUse** | **string** | Optional. Limit the returned certificates to those currently using Fastly to terminate TLS (that is, certificates associated with an activation). Permitted values: true, false. | **filterNotAfter** | **string** | Limit the returned certificates to those that expire prior to the specified date in UTC. Accepts parameters: lte (e.g., filter[not_after][lte]=2020-05-05). | **filterTLSDomainsID** | **string** | Limit the returned certificates to those that include the specific domain. | **include** | **string** | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`. | **pageNumber** | **int32** | Current page. | **pageSize** | **int32** | Number of records per page. | [default to 20] **sort** | **string** | The order in which to list the results by creation date. | [default to "created_at"] + **filterInUse** | **string** | Optional. Limit the returned certificates to those currently using Fastly to terminate TLS (that is, certificates associated with an activation). Permitted values: true, false. | **filterNotAfter** | **string** | Limit the returned certificates to those that expire prior to the specified date in UTC. Accepts parameters: lte (e.g., filter[not_after][lte]=2020-05-05). | **filterTLSDomainsID** | **string** | Limit the returned certificates to those that include the specific domain. | **include** | **string** | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`. | **sort** | **string** | The order in which to list the results. | [default to "-created_at"] **pageNumber** | **int32** | Current page. | **pageSize** | **int32** | Number of records per page. | [default to 20] ### Return type diff --git a/docs/TlsDomainsAPI.md b/docs/TlsDomainsAPI.md index c2edcad..b72e32d 100644 --- a/docs/TlsDomainsAPI.md +++ b/docs/TlsDomainsAPI.md @@ -32,14 +32,14 @@ func main() { filterTLSCertificatesID := "filterTLSCertificatesId_example" // string | Optional. Limit the returned domains to those listed in the given TLS certificate's SAN list. (optional) filterTLSSubscriptionsID := "filterTLSSubscriptionsId_example" // string | Optional. Limit the returned domains to those for a given TLS subscription. (optional) include := "include_example" // string | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. (optional) + sort := "sort_example" // string | The order in which to list the results. (optional) (default to "id") pageNumber := int32(1) // int32 | Current page. (optional) pageSize := int32(20) // int32 | Number of records per page. (optional) (default to 20) - sort := "created_at" // string | The order in which to list the results by creation date. (optional) (default to "created_at") cfg := fastly.NewConfiguration() apiClient := fastly.NewAPIClient(cfg) ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") - resp, r, err := apiClient.TLSDomainsAPI.ListTLSDomains(ctx).FilterInUse(filterInUse).FilterTLSCertificatesID(filterTLSCertificatesID).FilterTLSSubscriptionsID(filterTLSSubscriptionsID).Include(include).PageNumber(pageNumber).PageSize(pageSize).Sort(sort).Execute() + resp, r, err := apiClient.TLSDomainsAPI.ListTLSDomains(ctx).FilterInUse(filterInUse).FilterTLSCertificatesID(filterTLSCertificatesID).FilterTLSSubscriptionsID(filterTLSSubscriptionsID).Include(include).Sort(sort).PageNumber(pageNumber).PageSize(pageSize).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `TLSDomainsAPI.ListTLSDomains`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -60,7 +60,7 @@ Other parameters are passed through a pointer to a apiListTLSDomainsRequest stru Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filterInUse** | **string** | Optional. Limit the returned domains to those currently using Fastly to terminate TLS with SNI (that is, domains considered \"in use\") Permitted values: true, false. | **filterTLSCertificatesID** | **string** | Optional. Limit the returned domains to those listed in the given TLS certificate's SAN list. | **filterTLSSubscriptionsID** | **string** | Optional. Limit the returned domains to those for a given TLS subscription. | **include** | **string** | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. | **pageNumber** | **int32** | Current page. | **pageSize** | **int32** | Number of records per page. | [default to 20] **sort** | **string** | The order in which to list the results by creation date. | [default to "created_at"] + **filterInUse** | **string** | Optional. Limit the returned domains to those currently using Fastly to terminate TLS with SNI (that is, domains considered \"in use\") Permitted values: true, false. | **filterTLSCertificatesID** | **string** | Optional. Limit the returned domains to those listed in the given TLS certificate's SAN list. | **filterTLSSubscriptionsID** | **string** | Optional. Limit the returned domains to those for a given TLS subscription. | **include** | **string** | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. | **sort** | **string** | The order in which to list the results. | [default to "id"] **pageNumber** | **int32** | Current page. | **pageSize** | **int32** | Number of records per page. | [default to 20] ### Return type diff --git a/docs/TlsSubscriptionsAPI.md b/docs/TlsSubscriptionsAPI.md index b16ec78..c87b090 100644 --- a/docs/TlsSubscriptionsAPI.md +++ b/docs/TlsSubscriptionsAPI.md @@ -374,15 +374,15 @@ func main() { filterTLSDomainsID := "filterTLSDomainsId_example" // string | Limit the returned subscriptions to those that include the specific domain. (optional) filterHasActiveOrder := true // bool | Limit the returned subscriptions to those that have currently active orders. Permitted values: `true`. (optional) filterCertificateAuthority := "filterCertificateAuthority_example" // string | Limit the returned subscriptions to a specific certification authority. Values may include `certainly`, `lets-encrypt`, or `globalsign`. (optional) + sort := "sort_example" // string | The order in which to list the results. (optional) (default to "-created_at") include := "tls_authorizations" // string | Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, `tls_authorizations.self_managed_http_challenge`, and `tls_certificates`. (optional) pageNumber := int32(1) // int32 | Current page. (optional) pageSize := int32(20) // int32 | Number of records per page. (optional) (default to 20) - sort := "created_at" // string | The order in which to list the results by creation date. (optional) (default to "created_at") cfg := fastly.NewConfiguration() apiClient := fastly.NewAPIClient(cfg) ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") - resp, r, err := apiClient.TLSSubscriptionsAPI.ListTLSSubs(ctx).FilterState(filterState).FilterTLSDomainsID(filterTLSDomainsID).FilterHasActiveOrder(filterHasActiveOrder).FilterCertificateAuthority(filterCertificateAuthority).Include(include).PageNumber(pageNumber).PageSize(pageSize).Sort(sort).Execute() + resp, r, err := apiClient.TLSSubscriptionsAPI.ListTLSSubs(ctx).FilterState(filterState).FilterTLSDomainsID(filterTLSDomainsID).FilterHasActiveOrder(filterHasActiveOrder).FilterCertificateAuthority(filterCertificateAuthority).Sort(sort).Include(include).PageNumber(pageNumber).PageSize(pageSize).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `TLSSubscriptionsAPI.ListTLSSubs`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -403,7 +403,7 @@ Other parameters are passed through a pointer to a apiListTLSSubsRequest struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filterState** | **string** | Limit the returned subscriptions by state. Valid values are `pending`, `processing`, `issued`, `renewing`, and `failed`. Accepts parameters: `not` (e.g., `filter[state][not]=renewing`). | **filterTLSDomainsID** | **string** | Limit the returned subscriptions to those that include the specific domain. | **filterHasActiveOrder** | **bool** | Limit the returned subscriptions to those that have currently active orders. Permitted values: `true`. | **filterCertificateAuthority** | **string** | Limit the returned subscriptions to a specific certification authority. Values may include `certainly`, `lets-encrypt`, or `globalsign`. | **include** | **string** | Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, `tls_authorizations.self_managed_http_challenge`, and `tls_certificates`. | **pageNumber** | **int32** | Current page. | **pageSize** | **int32** | Number of records per page. | [default to 20] **sort** | **string** | The order in which to list the results by creation date. | [default to "created_at"] + **filterState** | **string** | Limit the returned subscriptions by state. Valid values are `pending`, `processing`, `issued`, `renewing`, and `failed`. Accepts parameters: `not` (e.g., `filter[state][not]=renewing`). | **filterTLSDomainsID** | **string** | Limit the returned subscriptions to those that include the specific domain. | **filterHasActiveOrder** | **bool** | Limit the returned subscriptions to those that have currently active orders. Permitted values: `true`. | **filterCertificateAuthority** | **string** | Limit the returned subscriptions to a specific certification authority. Values may include `certainly`, `lets-encrypt`, or `globalsign`. | **sort** | **string** | The order in which to list the results. | [default to "-created_at"] **include** | **string** | Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, `tls_authorizations.self_managed_http_challenge`, and `tls_certificates`. | **pageNumber** | **int32** | Current page. | **pageSize** | **int32** | Number of records per page. | [default to 20] ### Return type diff --git a/docs/VersionAPI.md b/docs/VersionAPI.md index 6f34dfe..cdf1b25 100644 --- a/docs/VersionAPI.md +++ b/docs/VersionAPI.md @@ -6,9 +6,11 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**ActivateServiceVersion**](VersionAPI.md#ActivateServiceVersion) | **PUT** `/service/{service_id}/version/{version_id}/activate` | Activate a service version +[**ActivateServiceVersionEnvironment**](VersionAPI.md#ActivateServiceVersionEnvironment) | **PUT** `/service/{service_id}/version/{version_id}/activate/{environment_name}` | Activate a service version on the specified environment [**CloneServiceVersion**](VersionAPI.md#CloneServiceVersion) | **PUT** `/service/{service_id}/version/{version_id}/clone` | Clone a service version [**CreateServiceVersion**](VersionAPI.md#CreateServiceVersion) | **POST** `/service/{service_id}/version` | Create a service version [**DeactivateServiceVersion**](VersionAPI.md#DeactivateServiceVersion) | **PUT** `/service/{service_id}/version/{version_id}/deactivate` | Deactivate a service version +[**DeactivateServiceVersionEnvironment**](VersionAPI.md#DeactivateServiceVersionEnvironment) | **PUT** `/service/{service_id}/version/{version_id}/deactivate/{environment_name}` | Deactivate a service version on an environment [**GetServiceVersion**](VersionAPI.md#GetServiceVersion) | **GET** `/service/{service_id}/version/{version_id}` | Get a version of a service [**ListServiceVersions**](VersionAPI.md#ListServiceVersions) | **GET** `/service/{service_id}/version` | List versions of a service [**LockServiceVersion**](VersionAPI.md#LockServiceVersion) | **PUT** `/service/{service_id}/version/{version_id}/lock` | Lock a service version @@ -86,6 +88,77 @@ Name | Type | Description | Notes [Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) +## ActivateServiceVersionEnvironment + +Activate a service version on the specified environment + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + serviceID := "serviceId_example" // string | Alphanumeric string identifying the service. + versionID := int32(56) // int32 | Integer identifying a service version. + environmentName := openapiclient.environment_name("staging") // EnvironmentName | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.VersionAPI.ActivateServiceVersionEnvironment(ctx, serviceID, versionID, environmentName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VersionAPI.ActivateServiceVersionEnvironment`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ActivateServiceVersionEnvironment`: VersionResponse + fmt.Fprintf(os.Stdout, "Response from `VersionAPI.ActivateServiceVersionEnvironment`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**serviceID** | **string** | Alphanumeric string identifying the service. | +**versionID** | **int32** | Integer identifying a service version. | +**environmentName** | [**EnvironmentName**](.md) | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiActivateServiceVersionEnvironmentRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**VersionResponse**](VersionResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + ## CloneServiceVersion Clone a service version @@ -291,6 +364,77 @@ Name | Type | Description | Notes [Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) +## DeactivateServiceVersionEnvironment + +Deactivate a service version on an environment + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + serviceID := "serviceId_example" // string | Alphanumeric string identifying the service. + versionID := int32(56) // int32 | Integer identifying a service version. + environmentName := openapiclient.environment_name("staging") // EnvironmentName | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.VersionAPI.DeactivateServiceVersionEnvironment(ctx, serviceID, versionID, environmentName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VersionAPI.DeactivateServiceVersionEnvironment`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeactivateServiceVersionEnvironment`: VersionResponse + fmt.Fprintf(os.Stdout, "Response from `VersionAPI.DeactivateServiceVersionEnvironment`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**serviceID** | **string** | Alphanumeric string identifying the service. | +**versionID** | **int32** | Integer identifying a service version. | +**environmentName** | [**EnvironmentName**](.md) | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeactivateServiceVersionEnvironmentRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**VersionResponse**](VersionResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + ## GetServiceVersion Get a version of a service diff --git a/docs/VersionResponse.md b/docs/VersionResponse.md index 39fecb8..aa2bb9b 100644 --- a/docs/VersionResponse.md +++ b/docs/VersionResponse.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **DeletedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **UpdatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] **ServiceID** | Pointer to **string** | | [optional] [readonly] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] ## Methods @@ -350,5 +351,30 @@ SetServiceID sets ServiceID field to given value. HasServiceID returns a boolean if a field has been set. +### GetEnvironments + +`func (o *VersionResponse) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *VersionResponse) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *VersionResponse) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *VersionResponse) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/VersionResponseAllOf.md b/docs/VersionResponseAllOf.md index 7c57f17..0acab47 100644 --- a/docs/VersionResponseAllOf.md +++ b/docs/VersionResponseAllOf.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ServiceID** | Pointer to **string** | | [optional] [readonly] +**Environments** | Pointer to [**[]Environment**](Environment.md) | A list of environments where the service has been deployed. | [optional] ## Methods @@ -50,5 +51,30 @@ SetServiceID sets ServiceID field to given value. HasServiceID returns a boolean if a field has been set. +### GetEnvironments + +`func (o *VersionResponseAllOf) GetEnvironments() []Environment` + +GetEnvironments returns the Environments field if non-nil, zero value otherwise. + +### GetEnvironmentsOk + +`func (o *VersionResponseAllOf) GetEnvironmentsOk() (*[]Environment, bool)` + +GetEnvironmentsOk returns a tuple with the Environments field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnvironments + +`func (o *VersionResponseAllOf) SetEnvironments(v []Environment)` + +SetEnvironments sets Environments field to given value. + +### HasEnvironments + +`func (o *VersionResponseAllOf) HasEnvironments() bool` + +HasEnvironments returns a boolean if a field has been set. + [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/fastly/api_acls_in_compute.go b/fastly/api_acls_in_compute.go new file mode 100644 index 0000000..4658036 --- /dev/null +++ b/fastly/api_acls_in_compute.go @@ -0,0 +1,1084 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + gourl "net/url" + "strconv" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +// ACLsInComputeAPI defines an interface for interacting with the resource. +type ACLsInComputeAPI interface { + + /* + ComputeACLCreateAcls Create a new ACL + + Create a new ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIComputeACLCreateAclsRequest + */ + ComputeACLCreateAcls(ctx context.Context) APIComputeACLCreateAclsRequest + + // ComputeACLCreateAclsExecute executes the request + // @return ComputeACLCreateAclsResponse + ComputeACLCreateAclsExecute(r APIComputeACLCreateAclsRequest) (*ComputeACLCreateAclsResponse, *http.Response, error) + + /* + ComputeACLDeleteSAclID Delete an ACL + + Delete an ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @return APIComputeACLDeleteSAclIDRequest + */ + ComputeACLDeleteSAclID(ctx context.Context, aclID string) APIComputeACLDeleteSAclIDRequest + + // ComputeACLDeleteSAclIDExecute executes the request + ComputeACLDeleteSAclIDExecute(r APIComputeACLDeleteSAclIDRequest) (*http.Response, error) + + /* + ComputeACLListAclEntries List an ACL + + List an ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @return APIComputeACLListAclEntriesRequest + */ + ComputeACLListAclEntries(ctx context.Context, aclID string) APIComputeACLListAclEntriesRequest + + // ComputeACLListAclEntriesExecute executes the request + // @return ComputeACLListEntries + ComputeACLListAclEntriesExecute(r APIComputeACLListAclEntriesRequest) (*ComputeACLListEntries, *http.Response, error) + + /* + ComputeACLListAcls List ACLs + + List all ACLs. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIComputeACLListAclsRequest + */ + ComputeACLListAcls(ctx context.Context) APIComputeACLListAclsRequest + + // ComputeACLListAclsExecute executes the request + // @return []ComputeACLCreateAclsResponse + ComputeACLListAclsExecute(r APIComputeACLListAclsRequest) ([]ComputeACLCreateAclsResponse, *http.Response, error) + + /* + ComputeACLListAclsSAclID Describe an ACL + + Describe an ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @return APIComputeACLListAclsSAclIDRequest + */ + ComputeACLListAclsSAclID(ctx context.Context, aclID string) APIComputeACLListAclsSAclIDRequest + + // ComputeACLListAclsSAclIDExecute executes the request + // @return ComputeACLCreateAclsResponse + ComputeACLListAclsSAclIDExecute(r APIComputeACLListAclsSAclIDRequest) (*ComputeACLCreateAclsResponse, *http.Response, error) + + /* + ComputeACLLookupAcls Lookup an ACL + + Find a matching ACL entry for an IP address. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @param aclIP + @return APIComputeACLLookupAclsRequest + */ + ComputeACLLookupAcls(ctx context.Context, aclID string, aclIP string) APIComputeACLLookupAclsRequest + + // ComputeACLLookupAclsExecute executes the request + // @return ComputeACLLookup + ComputeACLLookupAclsExecute(r APIComputeACLLookupAclsRequest) (*ComputeACLLookup, *http.Response, error) + + /* + ComputeACLUpdateAcls Update an ACL + + Update an ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @return APIComputeACLUpdateAclsRequest + */ + ComputeACLUpdateAcls(ctx context.Context, aclID string) APIComputeACLUpdateAclsRequest + + // ComputeACLUpdateAclsExecute executes the request + ComputeACLUpdateAclsExecute(r APIComputeACLUpdateAclsRequest) (*http.Response, error) +} + +// ACLsInComputeAPIService ACLsInComputeAPI service +type ACLsInComputeAPIService service + +// APIComputeACLCreateAclsRequest represents a request for the resource. +type APIComputeACLCreateAclsRequest struct { + ctx context.Context + APIService ACLsInComputeAPI + computeACLCreateAclsRequest *ComputeACLCreateAclsRequest +} + +// ComputeACLCreateAclsRequest returns a pointer to a request. +func (r *APIComputeACLCreateAclsRequest) ComputeACLCreateAclsRequest(computeACLCreateAclsRequest ComputeACLCreateAclsRequest) *APIComputeACLCreateAclsRequest { + r.computeACLCreateAclsRequest = &computeACLCreateAclsRequest + return r +} + +// Execute calls the API using the request data configured. +func (r APIComputeACLCreateAclsRequest) Execute() (*ComputeACLCreateAclsResponse, *http.Response, error) { + return r.APIService.ComputeACLCreateAclsExecute(r) +} + +/* +ComputeACLCreateAcls Create a new ACL + +Create a new ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIComputeACLCreateAclsRequest +*/ +func (a *ACLsInComputeAPIService) ComputeACLCreateAcls(ctx context.Context) APIComputeACLCreateAclsRequest { + return APIComputeACLCreateAclsRequest{ + APIService: a, + ctx: ctx, + } +} + +// ComputeACLCreateAclsExecute executes the request +// @return ComputeACLCreateAclsResponse +func (a *ACLsInComputeAPIService) ComputeACLCreateAclsExecute(r APIComputeACLCreateAclsRequest) (*ComputeACLCreateAclsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *ComputeACLCreateAclsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLsInComputeAPIService.ComputeACLCreateAcls") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/acls" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.computeACLCreateAclsRequest + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIComputeACLDeleteSAclIDRequest represents a request for the resource. +type APIComputeACLDeleteSAclIDRequest struct { + ctx context.Context + APIService ACLsInComputeAPI + aclID string +} + + +// Execute calls the API using the request data configured. +func (r APIComputeACLDeleteSAclIDRequest) Execute() (*http.Response, error) { + return r.APIService.ComputeACLDeleteSAclIDExecute(r) +} + +/* +ComputeACLDeleteSAclID Delete an ACL + +Delete an ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @return APIComputeACLDeleteSAclIDRequest +*/ +func (a *ACLsInComputeAPIService) ComputeACLDeleteSAclID(ctx context.Context, aclID string) APIComputeACLDeleteSAclIDRequest { + return APIComputeACLDeleteSAclIDRequest{ + APIService: a, + ctx: ctx, + aclID: aclID, + } +} + +// ComputeACLDeleteSAclIDExecute executes the request +func (a *ACLsInComputeAPIService) ComputeACLDeleteSAclIDExecute(r APIComputeACLDeleteSAclIDRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLsInComputeAPIService.ComputeACLDeleteSAclID") + if err != nil { + return nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/acls/{acl_id}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"acl_id"+"}", gourl.PathEscape(parameterToString(r.aclID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarHTTPResponse, nil +} + +// APIComputeACLListAclEntriesRequest represents a request for the resource. +type APIComputeACLListAclEntriesRequest struct { + ctx context.Context + APIService ACLsInComputeAPI + aclID string + cursor *string + limit *int32 +} + +// Cursor returns a pointer to a request. +func (r *APIComputeACLListAclEntriesRequest) Cursor(cursor string) *APIComputeACLListAclEntriesRequest { + r.cursor = &cursor + return r +} +// Limit returns a pointer to a request. +func (r *APIComputeACLListAclEntriesRequest) Limit(limit int32) *APIComputeACLListAclEntriesRequest { + r.limit = &limit + return r +} + +// Execute calls the API using the request data configured. +func (r APIComputeACLListAclEntriesRequest) Execute() (*ComputeACLListEntries, *http.Response, error) { + return r.APIService.ComputeACLListAclEntriesExecute(r) +} + +/* +ComputeACLListAclEntries List an ACL + +List an ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @return APIComputeACLListAclEntriesRequest +*/ +func (a *ACLsInComputeAPIService) ComputeACLListAclEntries(ctx context.Context, aclID string) APIComputeACLListAclEntriesRequest { + return APIComputeACLListAclEntriesRequest{ + APIService: a, + ctx: ctx, + aclID: aclID, + } +} + +// ComputeACLListAclEntriesExecute executes the request +// @return ComputeACLListEntries +func (a *ACLsInComputeAPIService) ComputeACLListAclEntriesExecute(r APIComputeACLListAclEntriesRequest) (*ComputeACLListEntries, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *ComputeACLListEntries + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLsInComputeAPIService.ComputeACLListAclEntries") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/acls/{acl_id}/entries" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"acl_id"+"}", gourl.PathEscape(parameterToString(r.aclID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + if r.cursor != nil { + localVarQueryParams.Add("cursor", parameterToString(*r.cursor, "")) + } + if r.limit != nil { + localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIComputeACLListAclsRequest represents a request for the resource. +type APIComputeACLListAclsRequest struct { + ctx context.Context + APIService ACLsInComputeAPI +} + + +// Execute calls the API using the request data configured. +func (r APIComputeACLListAclsRequest) Execute() ([]ComputeACLCreateAclsResponse, *http.Response, error) { + return r.APIService.ComputeACLListAclsExecute(r) +} + +/* +ComputeACLListAcls List ACLs + +List all ACLs. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIComputeACLListAclsRequest +*/ +func (a *ACLsInComputeAPIService) ComputeACLListAcls(ctx context.Context) APIComputeACLListAclsRequest { + return APIComputeACLListAclsRequest{ + APIService: a, + ctx: ctx, + } +} + +// ComputeACLListAclsExecute executes the request +// @return []ComputeACLCreateAclsResponse +func (a *ACLsInComputeAPIService) ComputeACLListAclsExecute(r APIComputeACLListAclsRequest) ([]ComputeACLCreateAclsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue []ComputeACLCreateAclsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLsInComputeAPIService.ComputeACLListAcls") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/acls" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIComputeACLListAclsSAclIDRequest represents a request for the resource. +type APIComputeACLListAclsSAclIDRequest struct { + ctx context.Context + APIService ACLsInComputeAPI + aclID string +} + + +// Execute calls the API using the request data configured. +func (r APIComputeACLListAclsSAclIDRequest) Execute() (*ComputeACLCreateAclsResponse, *http.Response, error) { + return r.APIService.ComputeACLListAclsSAclIDExecute(r) +} + +/* +ComputeACLListAclsSAclID Describe an ACL + +Describe an ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @return APIComputeACLListAclsSAclIDRequest +*/ +func (a *ACLsInComputeAPIService) ComputeACLListAclsSAclID(ctx context.Context, aclID string) APIComputeACLListAclsSAclIDRequest { + return APIComputeACLListAclsSAclIDRequest{ + APIService: a, + ctx: ctx, + aclID: aclID, + } +} + +// ComputeACLListAclsSAclIDExecute executes the request +// @return ComputeACLCreateAclsResponse +func (a *ACLsInComputeAPIService) ComputeACLListAclsSAclIDExecute(r APIComputeACLListAclsSAclIDRequest) (*ComputeACLCreateAclsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *ComputeACLCreateAclsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLsInComputeAPIService.ComputeACLListAclsSAclID") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/acls/{acl_id}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"acl_id"+"}", gourl.PathEscape(parameterToString(r.aclID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIComputeACLLookupAclsRequest represents a request for the resource. +type APIComputeACLLookupAclsRequest struct { + ctx context.Context + APIService ACLsInComputeAPI + aclID string + aclIP string +} + + +// Execute calls the API using the request data configured. +func (r APIComputeACLLookupAclsRequest) Execute() (*ComputeACLLookup, *http.Response, error) { + return r.APIService.ComputeACLLookupAclsExecute(r) +} + +/* +ComputeACLLookupAcls Lookup an ACL + +Find a matching ACL entry for an IP address. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @param aclIP + @return APIComputeACLLookupAclsRequest +*/ +func (a *ACLsInComputeAPIService) ComputeACLLookupAcls(ctx context.Context, aclID string, aclIP string) APIComputeACLLookupAclsRequest { + return APIComputeACLLookupAclsRequest{ + APIService: a, + ctx: ctx, + aclID: aclID, + aclIP: aclIP, + } +} + +// ComputeACLLookupAclsExecute executes the request +// @return ComputeACLLookup +func (a *ACLsInComputeAPIService) ComputeACLLookupAclsExecute(r APIComputeACLLookupAclsRequest) (*ComputeACLLookup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *ComputeACLLookup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLsInComputeAPIService.ComputeACLLookupAcls") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/acls/{acl_id}/entry/{acl_ip}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"acl_id"+"}", gourl.PathEscape(parameterToString(r.aclID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"acl_ip"+"}", gourl.PathEscape(parameterToString(r.aclIP, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIComputeACLUpdateAclsRequest represents a request for the resource. +type APIComputeACLUpdateAclsRequest struct { + ctx context.Context + APIService ACLsInComputeAPI + aclID string + computeACLUpdateEntry *[]ComputeACLUpdateEntry +} + +// ComputeACLUpdateEntry returns a pointer to a request. +func (r *APIComputeACLUpdateAclsRequest) ComputeACLUpdateEntry(computeACLUpdateEntry []ComputeACLUpdateEntry) *APIComputeACLUpdateAclsRequest { + r.computeACLUpdateEntry = &computeACLUpdateEntry + return r +} + +// Execute calls the API using the request data configured. +func (r APIComputeACLUpdateAclsRequest) Execute() (*http.Response, error) { + return r.APIService.ComputeACLUpdateAclsExecute(r) +} + +/* +ComputeACLUpdateAcls Update an ACL + +Update an ACL. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aclID + @return APIComputeACLUpdateAclsRequest +*/ +func (a *ACLsInComputeAPIService) ComputeACLUpdateAcls(ctx context.Context, aclID string) APIComputeACLUpdateAclsRequest { + return APIComputeACLUpdateAclsRequest{ + APIService: a, + ctx: ctx, + aclID: aclID, + } +} + +// ComputeACLUpdateAclsExecute executes the request +func (a *ACLsInComputeAPIService) ComputeACLUpdateAclsExecute(r APIComputeACLUpdateAclsRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ACLsInComputeAPIService.ComputeACLUpdateAcls") + if err != nil { + return nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/acls/{acl_id}/entries" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"acl_id"+"}", gourl.PathEscape(parameterToString(r.aclID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.computeACLUpdateEntry + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarHTTPResponse, nil +} diff --git a/fastly/api_contact.go b/fastly/api_contact.go index 00d33de..b793a3a 100644 --- a/fastly/api_contact.go +++ b/fastly/api_contact.go @@ -317,7 +317,7 @@ func (a *ContactAPIService) DeleteContactExecute(r APIDeleteContactRequest) (*In return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} } - localVarPath := localBasePath + "/customer/{customer_id}/contact/{contact_id}" + localVarPath := localBasePath + "/customer/{customer_id}/contacts/{contact_id}" localVarPath = strings.ReplaceAll(localVarPath, "{"+"customer_id"+"}", gourl.PathEscape(parameterToString(r.customerID, ""))) localVarPath = strings.ReplaceAll(localVarPath, "{"+"contact_id"+"}", gourl.PathEscape(parameterToString(r.contactID, ""))) diff --git a/fastly/api_customer_addresses.go b/fastly/api_customer_addresses.go new file mode 100644 index 0000000..770b1c0 --- /dev/null +++ b/fastly/api_customer_addresses.go @@ -0,0 +1,600 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + gourl "net/url" + "strconv" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +// CustomerAddressesAPI defines an interface for interacting with the resource. +type CustomerAddressesAPI interface { + + /* + CreateCustomerAddress Creates an address associated with a customer account. + + Creates an address associated with a customer account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APICreateCustomerAddressRequest + */ + CreateCustomerAddress(ctx context.Context) APICreateCustomerAddressRequest + + // CreateCustomerAddressExecute executes the request + // @return InlineResponse201 + CreateCustomerAddressExecute(r APICreateCustomerAddressRequest) (*InlineResponse201, *http.Response, error) + + /* + ListCustomerAddresses Return the list of addresses associated with a customer account. + + Return the list of addresses associated with a customer account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIListCustomerAddressesRequest + */ + ListCustomerAddresses(ctx context.Context) APIListCustomerAddressesRequest + + // ListCustomerAddressesExecute executes the request + // @return ListCustomerAddressesResponse + ListCustomerAddressesExecute(r APIListCustomerAddressesRequest) (*ListCustomerAddressesResponse, *http.Response, error) + + /* + UpdateCustomerAddress Updates an address associated with a customer account. + + Updates an address associated with a customer account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param resourceType Alphanumeric type of the address being modified. + @return APIUpdateCustomerAddressRequest + */ + UpdateCustomerAddress(ctx context.Context, resourceType string) APIUpdateCustomerAddressRequest + + // UpdateCustomerAddressExecute executes the request + UpdateCustomerAddressExecute(r APIUpdateCustomerAddressRequest) (*http.Response, error) +} + +// CustomerAddressesAPIService CustomerAddressesAPI service +type CustomerAddressesAPIService service + +// APICreateCustomerAddressRequest represents a request for the resource. +type APICreateCustomerAddressRequest struct { + ctx context.Context + APIService CustomerAddressesAPI + customerAddress *CustomerAddress +} + +// CustomerAddress returns a pointer to a request. +func (r *APICreateCustomerAddressRequest) CustomerAddress(customerAddress CustomerAddress) *APICreateCustomerAddressRequest { + r.customerAddress = &customerAddress + return r +} + +// Execute calls the API using the request data configured. +func (r APICreateCustomerAddressRequest) Execute() (*InlineResponse201, *http.Response, error) { + return r.APIService.CreateCustomerAddressExecute(r) +} + +/* +CreateCustomerAddress Creates an address associated with a customer account. + +Creates an address associated with a customer account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APICreateCustomerAddressRequest +*/ +func (a *CustomerAddressesAPIService) CreateCustomerAddress(ctx context.Context) APICreateCustomerAddressRequest { + return APICreateCustomerAddressRequest{ + APIService: a, + ctx: ctx, + } +} + +// CreateCustomerAddressExecute executes the request +// @return InlineResponse201 +func (a *CustomerAddressesAPIService) CreateCustomerAddressExecute(r APICreateCustomerAddressRequest) (*InlineResponse201, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *InlineResponse201 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CustomerAddressesAPIService.CreateCustomerAddress") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/billing/v3/customer-addresses" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + if r.customerAddress == nil { + return localVarReturnValue, nil, reportError("customerAddress is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customerAddress + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIListCustomerAddressesRequest represents a request for the resource. +type APIListCustomerAddressesRequest struct { + ctx context.Context + APIService CustomerAddressesAPI +} + + +// Execute calls the API using the request data configured. +func (r APIListCustomerAddressesRequest) Execute() (*ListCustomerAddressesResponse, *http.Response, error) { + return r.APIService.ListCustomerAddressesExecute(r) +} + +/* +ListCustomerAddresses Return the list of addresses associated with a customer account. + +Return the list of addresses associated with a customer account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIListCustomerAddressesRequest +*/ +func (a *CustomerAddressesAPIService) ListCustomerAddresses(ctx context.Context) APIListCustomerAddressesRequest { + return APIListCustomerAddressesRequest{ + APIService: a, + ctx: ctx, + } +} + +// ListCustomerAddressesExecute executes the request +// @return ListCustomerAddressesResponse +func (a *CustomerAddressesAPIService) ListCustomerAddressesExecute(r APIListCustomerAddressesRequest) (*ListCustomerAddressesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *ListCustomerAddressesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CustomerAddressesAPIService.ListCustomerAddresses") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/billing/v3/customer-addresses" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIUpdateCustomerAddressRequest represents a request for the resource. +type APIUpdateCustomerAddressRequest struct { + ctx context.Context + APIService CustomerAddressesAPI + resourceType string + customerAddress *CustomerAddress +} + +// CustomerAddress returns a pointer to a request. +func (r *APIUpdateCustomerAddressRequest) CustomerAddress(customerAddress CustomerAddress) *APIUpdateCustomerAddressRequest { + r.customerAddress = &customerAddress + return r +} + +// Execute calls the API using the request data configured. +func (r APIUpdateCustomerAddressRequest) Execute() (*http.Response, error) { + return r.APIService.UpdateCustomerAddressExecute(r) +} + +/* +UpdateCustomerAddress Updates an address associated with a customer account. + +Updates an address associated with a customer account. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param resourceType Alphanumeric type of the address being modified. + @return APIUpdateCustomerAddressRequest +*/ +func (a *CustomerAddressesAPIService) UpdateCustomerAddress(ctx context.Context, resourceType string) APIUpdateCustomerAddressRequest { + return APIUpdateCustomerAddressRequest{ + APIService: a, + ctx: ctx, + resourceType: resourceType, + } +} + +// UpdateCustomerAddressExecute executes the request +func (a *CustomerAddressesAPIService) UpdateCustomerAddressExecute(r APIUpdateCustomerAddressRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CustomerAddressesAPIService.UpdateCustomerAddress") + if err != nil { + return nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/billing/v3/customer-addresses/{type}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"type"+"}", gourl.PathEscape(parameterToString(r.resourceType, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + if r.customerAddress == nil { + return nil, reportError("customerAddress is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.customerAddress + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarHTTPResponse, nil +} diff --git a/fastly/api_enabled_products.go b/fastly/api_enabled_products.go index 70c45f2..74b1c9e 100644 --- a/fastly/api_enabled_products.go +++ b/fastly/api_enabled_products.go @@ -34,7 +34,7 @@ type EnabledProductsAPI interface { /* DisableProduct Disable a product - Disable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, and `websockets`. + Disable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, and `ngwaf`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -49,7 +49,7 @@ type EnabledProductsAPI interface { /* EnableProduct Enable a product - Enable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, and `websockets`. + Enable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, and `ngwaf`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -65,7 +65,7 @@ type EnabledProductsAPI interface { /* GetEnabledProduct Get enabled product - Get enabled product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, and `websockets`. + Get enabled product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, and `ngwaf`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -77,6 +77,38 @@ type EnabledProductsAPI interface { // GetEnabledProductExecute executes the request // @return EnabledProductResponse GetEnabledProductExecute(r APIGetEnabledProductRequest) (*EnabledProductResponse, *http.Response, error) + + /* + GetProductConfiguration Get configuration for a product + + Get configuration for an enabled product on a service. Supported product IDs: `ngwaf`. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param productID + @param serviceID Alphanumeric string identifying the service. + @return APIGetProductConfigurationRequest + */ + GetProductConfiguration(ctx context.Context, productID string, serviceID string) APIGetProductConfigurationRequest + + // GetProductConfigurationExecute executes the request + // @return ConfiguredProductResponse + GetProductConfigurationExecute(r APIGetProductConfigurationRequest) (*ConfiguredProductResponse, *http.Response, error) + + /* + SetProductConfiguration Update configuration for a product + + Update configuration for an enabled product on a service. Supported product IDs: `ngwaf`. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param productID + @param serviceID Alphanumeric string identifying the service. + @return APISetProductConfigurationRequest + */ + SetProductConfiguration(ctx context.Context, productID string, serviceID string) APISetProductConfigurationRequest + + // SetProductConfigurationExecute executes the request + // @return ConfiguredProductResponse + SetProductConfigurationExecute(r APISetProductConfigurationRequest) (*ConfiguredProductResponse, *http.Response, error) } // EnabledProductsAPIService EnabledProductsAPI service @@ -99,7 +131,7 @@ func (r APIDisableProductRequest) Execute() (*http.Response, error) { /* DisableProduct Disable a product -Disable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, and `websockets`. +Disable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, and `ngwaf`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -128,7 +160,7 @@ func (a *EnabledProductsAPIService) DisableProductExecute(r APIDisableProductReq return nil, &GenericAPIError{error: err.Error()} } - localVarPath := localBasePath + "/enabled-products/{product_id}/services/{service_id}" + localVarPath := localBasePath + "/enabled-products/v1/{product_id}/services/{service_id}" localVarPath = strings.ReplaceAll(localVarPath, "{"+"product_id"+"}", gourl.PathEscape(parameterToString(r.productID, ""))) localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) @@ -215,8 +247,14 @@ type APIEnableProductRequest struct { APIService EnabledProductsAPI productID string serviceID string + setWorkspaceID *SetWorkspaceID } +// SetWorkspaceID returns a pointer to a request. +func (r *APIEnableProductRequest) SetWorkspaceID(setWorkspaceID SetWorkspaceID) *APIEnableProductRequest { + r.setWorkspaceID = &setWorkspaceID + return r +} // Execute calls the API using the request data configured. func (r APIEnableProductRequest) Execute() (*EnabledProductResponse, *http.Response, error) { @@ -226,7 +264,7 @@ func (r APIEnableProductRequest) Execute() (*EnabledProductResponse, *http.Respo /* EnableProduct Enable a product -Enable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, and `websockets`. +Enable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, and `ngwaf`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -257,7 +295,7 @@ func (a *EnabledProductsAPIService) EnableProductExecute(r APIEnableProductReque return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} } - localVarPath := localBasePath + "/enabled-products/{product_id}/services/{service_id}" + localVarPath := localBasePath + "/enabled-products/v1/{product_id}/services/{service_id}" localVarPath = strings.ReplaceAll(localVarPath, "{"+"product_id"+"}", gourl.PathEscape(parameterToString(r.productID, ""))) localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) @@ -266,7 +304,7 @@ func (a *EnabledProductsAPIService) EnableProductExecute(r APIEnableProductReque localVarFormParams := gourl.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -282,6 +320,8 @@ func (a *EnabledProductsAPIService) EnableProductExecute(r APIEnableProductReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.setWorkspaceID if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -364,7 +404,7 @@ func (r APIGetEnabledProductRequest) Execute() (*EnabledProductResponse, *http.R /* GetEnabledProduct Get enabled product -Get enabled product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, and `websockets`. +Get enabled product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, and `ngwaf`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -395,7 +435,7 @@ func (a *EnabledProductsAPIService) GetEnabledProductExecute(r APIGetEnabledProd return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} } - localVarPath := localBasePath + "/enabled-products/{product_id}/services/{service_id}" + localVarPath := localBasePath + "/enabled-products/v1/{product_id}/services/{service_id}" localVarPath = strings.ReplaceAll(localVarPath, "{"+"product_id"+"}", gourl.PathEscape(parameterToString(r.productID, ""))) localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) @@ -469,6 +509,290 @@ func (a *EnabledProductsAPIService) GetEnabledProductExecute(r APIGetEnabledProd } + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APIGetProductConfigurationRequest represents a request for the resource. +type APIGetProductConfigurationRequest struct { + ctx context.Context + APIService EnabledProductsAPI + productID string + serviceID string +} + + +// Execute calls the API using the request data configured. +func (r APIGetProductConfigurationRequest) Execute() (*ConfiguredProductResponse, *http.Response, error) { + return r.APIService.GetProductConfigurationExecute(r) +} + +/* +GetProductConfiguration Get configuration for a product + +Get configuration for an enabled product on a service. Supported product IDs: `ngwaf`. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param productID + @param serviceID Alphanumeric string identifying the service. + @return APIGetProductConfigurationRequest +*/ +func (a *EnabledProductsAPIService) GetProductConfiguration(ctx context.Context, productID string, serviceID string) APIGetProductConfigurationRequest { + return APIGetProductConfigurationRequest{ + APIService: a, + ctx: ctx, + productID: productID, + serviceID: serviceID, + } +} + +// GetProductConfigurationExecute executes the request +// @return ConfiguredProductResponse +func (a *EnabledProductsAPIService) GetProductConfigurationExecute(r APIGetProductConfigurationRequest) (*ConfiguredProductResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *ConfiguredProductResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnabledProductsAPIService.GetProductConfiguration") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enabled-products/v1/{product_id}/services/{service_id}/configuration" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"product_id"+"}", gourl.PathEscape(parameterToString(r.productID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// APISetProductConfigurationRequest represents a request for the resource. +type APISetProductConfigurationRequest struct { + ctx context.Context + APIService EnabledProductsAPI + productID string + serviceID string + setConfiguration *SetConfiguration +} + +// SetConfiguration returns a pointer to a request. +func (r *APISetProductConfigurationRequest) SetConfiguration(setConfiguration SetConfiguration) *APISetProductConfigurationRequest { + r.setConfiguration = &setConfiguration + return r +} + +// Execute calls the API using the request data configured. +func (r APISetProductConfigurationRequest) Execute() (*ConfiguredProductResponse, *http.Response, error) { + return r.APIService.SetProductConfigurationExecute(r) +} + +/* +SetProductConfiguration Update configuration for a product + +Update configuration for an enabled product on a service. Supported product IDs: `ngwaf`. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param productID + @param serviceID Alphanumeric string identifying the service. + @return APISetProductConfigurationRequest +*/ +func (a *EnabledProductsAPIService) SetProductConfiguration(ctx context.Context, productID string, serviceID string) APISetProductConfigurationRequest { + return APISetProductConfigurationRequest{ + APIService: a, + ctx: ctx, + productID: productID, + serviceID: serviceID, + } +} + +// SetProductConfigurationExecute executes the request +// @return ConfiguredProductResponse +func (a *EnabledProductsAPIService) SetProductConfigurationExecute(r APISetProductConfigurationRequest) (*ConfiguredProductResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody any + formFiles []formFile + localVarReturnValue *ConfiguredProductResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnabledProductsAPIService.SetProductConfiguration") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enabled-products/v1/{product_id}/services/{service_id}/configuration" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"product_id"+"}", gourl.PathEscape(parameterToString(r.productID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setConfiguration + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { if i, err := strconv.Atoi(remaining); err == nil { diff --git a/fastly/api_tls_certificates.go b/fastly/api_tls_certificates.go index da6a920..2e18d15 100644 --- a/fastly/api_tls_certificates.go +++ b/fastly/api_tls_certificates.go @@ -659,9 +659,9 @@ type APIListTLSCertsRequest struct { filterNotAfter *string filterTLSDomainsID *string include *string + sort *string pageNumber *int32 pageSize *int32 - sort *string } // FilterInUse Optional. Limit the returned certificates to those currently using Fastly to terminate TLS (that is, certificates associated with an activation). Permitted values: true, false. @@ -684,6 +684,11 @@ func (r *APIListTLSCertsRequest) Include(include string) *APIListTLSCertsRequest r.include = &include return r } +// Sort The order in which to list the results. +func (r *APIListTLSCertsRequest) Sort(sort string) *APIListTLSCertsRequest { + r.sort = &sort + return r +} // PageNumber Current page. func (r *APIListTLSCertsRequest) PageNumber(pageNumber int32) *APIListTLSCertsRequest { r.pageNumber = &pageNumber @@ -694,11 +699,6 @@ func (r *APIListTLSCertsRequest) PageSize(pageSize int32) *APIListTLSCertsReques r.pageSize = &pageSize return r } -// Sort The order in which to list the results by creation date. -func (r *APIListTLSCertsRequest) Sort(sort string) *APIListTLSCertsRequest { - r.sort = &sort - return r -} // Execute calls the API using the request data configured. func (r APIListTLSCertsRequest) Execute() (*TLSCertificatesResponse, *http.Response, error) { @@ -753,15 +753,15 @@ func (a *TLSCertificatesAPIService) ListTLSCertsExecute(r APIListTLSCertsRequest if r.include != nil { localVarQueryParams.Add("include", parameterToString(*r.include, "")) } + if r.sort != nil { + localVarQueryParams.Add("sort", parameterToString(*r.sort, "")) + } if r.pageNumber != nil { localVarQueryParams.Add("page[number]", parameterToString(*r.pageNumber, "")) } if r.pageSize != nil { localVarQueryParams.Add("page[size]", parameterToString(*r.pageSize, "")) } - if r.sort != nil { - localVarQueryParams.Add("sort", parameterToString(*r.sort, "")) - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/fastly/api_tls_domains.go b/fastly/api_tls_domains.go index be4b6f6..01865d5 100644 --- a/fastly/api_tls_domains.go +++ b/fastly/api_tls_domains.go @@ -56,9 +56,9 @@ type APIListTLSDomainsRequest struct { filterTLSCertificatesID *string filterTLSSubscriptionsID *string include *string + sort *string pageNumber *int32 pageSize *int32 - sort *string } // FilterInUse Optional. Limit the returned domains to those currently using Fastly to terminate TLS with SNI (that is, domains considered \"in use\") Permitted values: true, false. @@ -81,6 +81,11 @@ func (r *APIListTLSDomainsRequest) Include(include string) *APIListTLSDomainsReq r.include = &include return r } +// Sort The order in which to list the results. +func (r *APIListTLSDomainsRequest) Sort(sort string) *APIListTLSDomainsRequest { + r.sort = &sort + return r +} // PageNumber Current page. func (r *APIListTLSDomainsRequest) PageNumber(pageNumber int32) *APIListTLSDomainsRequest { r.pageNumber = &pageNumber @@ -91,11 +96,6 @@ func (r *APIListTLSDomainsRequest) PageSize(pageSize int32) *APIListTLSDomainsRe r.pageSize = &pageSize return r } -// Sort The order in which to list the results by creation date. -func (r *APIListTLSDomainsRequest) Sort(sort string) *APIListTLSDomainsRequest { - r.sort = &sort - return r -} // Execute calls the API using the request data configured. func (r APIListTLSDomainsRequest) Execute() (*TLSDomainsResponse, *http.Response, error) { @@ -150,15 +150,15 @@ func (a *TLSDomainsAPIService) ListTLSDomainsExecute(r APIListTLSDomainsRequest) if r.include != nil { localVarQueryParams.Add("include", parameterToString(*r.include, "")) } + if r.sort != nil { + localVarQueryParams.Add("sort", parameterToString(*r.sort, "")) + } if r.pageNumber != nil { localVarQueryParams.Add("page[number]", parameterToString(*r.pageNumber, "")) } if r.pageSize != nil { localVarQueryParams.Add("page[size]", parameterToString(*r.pageSize, "")) } - if r.sort != nil { - localVarQueryParams.Add("sort", parameterToString(*r.sort, "")) - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/fastly/api_tls_subscriptions.go b/fastly/api_tls_subscriptions.go index c8e4e33..d4465f3 100644 --- a/fastly/api_tls_subscriptions.go +++ b/fastly/api_tls_subscriptions.go @@ -839,10 +839,10 @@ type APIListTLSSubsRequest struct { filterTLSDomainsID *string filterHasActiveOrder *bool filterCertificateAuthority *string + sort *string include *string pageNumber *int32 pageSize *int32 - sort *string } // FilterState Limit the returned subscriptions by state. Valid values are `pending`, `processing`, `issued`, `renewing`, and `failed`. Accepts parameters: `not` (e.g., `filter[state][not]=renewing`). @@ -865,6 +865,11 @@ func (r *APIListTLSSubsRequest) FilterCertificateAuthority(filterCertificateAuth r.filterCertificateAuthority = &filterCertificateAuthority return r } +// Sort The order in which to list the results. +func (r *APIListTLSSubsRequest) Sort(sort string) *APIListTLSSubsRequest { + r.sort = &sort + return r +} // Include Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, `tls_authorizations.self_managed_http_challenge`, and `tls_certificates`. func (r *APIListTLSSubsRequest) Include(include string) *APIListTLSSubsRequest { r.include = &include @@ -880,11 +885,6 @@ func (r *APIListTLSSubsRequest) PageSize(pageSize int32) *APIListTLSSubsRequest r.pageSize = &pageSize return r } -// Sort The order in which to list the results by creation date. -func (r *APIListTLSSubsRequest) Sort(sort string) *APIListTLSSubsRequest { - r.sort = &sort - return r -} // Execute calls the API using the request data configured. func (r APIListTLSSubsRequest) Execute() (*TLSSubscriptionsResponse, *http.Response, error) { @@ -939,6 +939,9 @@ func (a *TLSSubscriptionsAPIService) ListTLSSubsExecute(r APIListTLSSubsRequest) if r.filterCertificateAuthority != nil { localVarQueryParams.Add("filter[certificate_authority]", parameterToString(*r.filterCertificateAuthority, "")) } + if r.sort != nil { + localVarQueryParams.Add("sort", parameterToString(*r.sort, "")) + } if r.include != nil { localVarQueryParams.Add("include", parameterToString(*r.include, "")) } @@ -948,9 +951,6 @@ func (a *TLSSubscriptionsAPIService) ListTLSSubsExecute(r APIListTLSSubsRequest) if r.pageSize != nil { localVarQueryParams.Add("page[size]", parameterToString(*r.pageSize, "")) } - if r.sort != nil { - localVarQueryParams.Add("sort", parameterToString(*r.sort, "")) - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/fastly/api_version.go b/fastly/api_version.go index 2e76009..5c40619 100644 --- a/fastly/api_version.go +++ b/fastly/api_version.go @@ -47,6 +47,23 @@ type VersionAPI interface { // @return VersionResponse ActivateServiceVersionExecute(r APIActivateServiceVersionRequest) (*VersionResponse, *http.Response, error) + /* + ActivateServiceVersionEnvironment Activate a service version on the specified environment + + Activate a version on a given environment, i.e. "staging" + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param serviceID Alphanumeric string identifying the service. + @param versionID Integer identifying a service version. + @param environmentName + @return APIActivateServiceVersionEnvironmentRequest + */ + ActivateServiceVersionEnvironment(ctx context.Context, serviceID string, versionID int32, environmentName EnvironmentName) APIActivateServiceVersionEnvironmentRequest + + // ActivateServiceVersionEnvironmentExecute executes the request + // @return VersionResponse + ActivateServiceVersionEnvironmentExecute(r APIActivateServiceVersionEnvironmentRequest) (*VersionResponse, *http.Response, error) + /* CloneServiceVersion Clone a service version @@ -94,6 +111,23 @@ type VersionAPI interface { // @return VersionResponse DeactivateServiceVersionExecute(r APIDeactivateServiceVersionRequest) (*VersionResponse, *http.Response, error) + /* + DeactivateServiceVersionEnvironment Deactivate a service version on an environment + + Deactivate the current version on a given environment, i.e. "staging" + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param serviceID Alphanumeric string identifying the service. + @param versionID Integer identifying a service version. + @param environmentName + @return APIDeactivateServiceVersionEnvironmentRequest + */ + DeactivateServiceVersionEnvironment(ctx context.Context, serviceID string, versionID int32, environmentName EnvironmentName) APIDeactivateServiceVersionEnvironmentRequest + + // DeactivateServiceVersionEnvironmentExecute executes the request + // @return VersionResponse + DeactivateServiceVersionEnvironmentExecute(r APIDeactivateServiceVersionEnvironmentRequest) (*VersionResponse, *http.Response, error) + /* GetServiceVersion Get a version of a service @@ -315,6 +349,148 @@ func (a *VersionAPIService) ActivateServiceVersionExecute(r APIActivateServiceVe return localVarReturnValue, localVarHTTPResponse, nil } +// APIActivateServiceVersionEnvironmentRequest represents a request for the resource. +type APIActivateServiceVersionEnvironmentRequest struct { + ctx context.Context + APIService VersionAPI + serviceID string + versionID int32 + environmentName EnvironmentName +} + + +// Execute calls the API using the request data configured. +func (r APIActivateServiceVersionEnvironmentRequest) Execute() (*VersionResponse, *http.Response, error) { + return r.APIService.ActivateServiceVersionEnvironmentExecute(r) +} + +/* +ActivateServiceVersionEnvironment Activate a service version on the specified environment + +Activate a version on a given environment, i.e. "staging" + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param serviceID Alphanumeric string identifying the service. + @param versionID Integer identifying a service version. + @param environmentName + @return APIActivateServiceVersionEnvironmentRequest +*/ +func (a *VersionAPIService) ActivateServiceVersionEnvironment(ctx context.Context, serviceID string, versionID int32, environmentName EnvironmentName) APIActivateServiceVersionEnvironmentRequest { + return APIActivateServiceVersionEnvironmentRequest{ + APIService: a, + ctx: ctx, + serviceID: serviceID, + versionID: versionID, + environmentName: environmentName, + } +} + +// ActivateServiceVersionEnvironmentExecute executes the request +// @return VersionResponse +func (a *VersionAPIService) ActivateServiceVersionEnvironmentExecute(r APIActivateServiceVersionEnvironmentRequest) (*VersionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody any + formFiles []formFile + localVarReturnValue *VersionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VersionAPIService.ActivateServiceVersionEnvironment") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service/{service_id}/version/{version_id}/activate/{environment_name}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"version_id"+"}", gourl.PathEscape(parameterToString(r.versionID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"environment_name"+"}", gourl.PathEscape(parameterToString(r.environmentName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // APICloneServiceVersionRequest represents a request for the resource. type APICloneServiceVersionRequest struct { ctx context.Context @@ -725,6 +901,148 @@ func (a *VersionAPIService) DeactivateServiceVersionExecute(r APIDeactivateServi return localVarReturnValue, localVarHTTPResponse, nil } +// APIDeactivateServiceVersionEnvironmentRequest represents a request for the resource. +type APIDeactivateServiceVersionEnvironmentRequest struct { + ctx context.Context + APIService VersionAPI + serviceID string + versionID int32 + environmentName EnvironmentName +} + + +// Execute calls the API using the request data configured. +func (r APIDeactivateServiceVersionEnvironmentRequest) Execute() (*VersionResponse, *http.Response, error) { + return r.APIService.DeactivateServiceVersionEnvironmentExecute(r) +} + +/* +DeactivateServiceVersionEnvironment Deactivate a service version on an environment + +Deactivate the current version on a given environment, i.e. "staging" + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param serviceID Alphanumeric string identifying the service. + @param versionID Integer identifying a service version. + @param environmentName + @return APIDeactivateServiceVersionEnvironmentRequest +*/ +func (a *VersionAPIService) DeactivateServiceVersionEnvironment(ctx context.Context, serviceID string, versionID int32, environmentName EnvironmentName) APIDeactivateServiceVersionEnvironmentRequest { + return APIDeactivateServiceVersionEnvironmentRequest{ + APIService: a, + ctx: ctx, + serviceID: serviceID, + versionID: versionID, + environmentName: environmentName, + } +} + +// DeactivateServiceVersionEnvironmentExecute executes the request +// @return VersionResponse +func (a *VersionAPIService) DeactivateServiceVersionEnvironmentExecute(r APIDeactivateServiceVersionEnvironmentRequest) (*VersionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody any + formFiles []formFile + localVarReturnValue *VersionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VersionAPIService.DeactivateServiceVersionEnvironment") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service/{service_id}/version/{version_id}/deactivate/{environment_name}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"version_id"+"}", gourl.PathEscape(parameterToString(r.versionID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"environment_name"+"}", gourl.PathEscape(parameterToString(r.environmentName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["token"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Fastly-Key"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + _ = localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + + if localVarHTTPResponse.Request.Method != http.MethodGet && localVarHTTPResponse.Request.Method != http.MethodHead { + if remaining := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Remaining"); remaining != "" { + if i, err := strconv.Atoi(remaining); err == nil { + a.client.RateLimitRemaining = i + } + } + if reset := localVarHTTPResponse.Header.Get("Fastly-RateLimit-Reset"); reset != "" { + if i, err := strconv.Atoi(reset); err == nil { + a.client.RateLimitReset = i + } + } + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // APIGetServiceVersionRequest represents a request for the resource. type APIGetServiceVersionRequest struct { ctx context.Context diff --git a/fastly/client.go b/fastly/client.go index 771b724..0b07d6b 100644 --- a/fastly/client.go +++ b/fastly/client.go @@ -68,6 +68,8 @@ type APIClient struct { ACLEntryAPI ACLEntryAPI + ACLsInComputeAPI ACLsInComputeAPI + ApexRedirectAPI ApexRedirectAPI AutomationTokensAPI AutomationTokensAPI @@ -96,6 +98,8 @@ type APIClient struct { CustomerAPI CustomerAPI + CustomerAddressesAPI CustomerAddressesAPI + DictionaryAPI DictionaryAPI DictionaryInfoAPI DictionaryInfoAPI @@ -328,6 +332,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { // API Services c.ACLAPI = (*ACLAPIService)(&c.common) c.ACLEntryAPI = (*ACLEntryAPIService)(&c.common) + c.ACLsInComputeAPI = (*ACLsInComputeAPIService)(&c.common) c.ApexRedirectAPI = (*ApexRedirectAPIService)(&c.common) c.AutomationTokensAPI = (*AutomationTokensAPIService)(&c.common) c.BackendAPI = (*BackendAPIService)(&c.common) @@ -342,6 +347,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.ContactAPI = (*ContactAPIService)(&c.common) c.ContentAPI = (*ContentAPIService)(&c.common) c.CustomerAPI = (*CustomerAPIService)(&c.common) + c.CustomerAddressesAPI = (*CustomerAddressesAPIService)(&c.common) c.DictionaryAPI = (*DictionaryAPIService)(&c.common) c.DictionaryInfoAPI = (*DictionaryInfoAPIService)(&c.common) c.DictionaryItemAPI = (*DictionaryItemAPIService)(&c.common) diff --git a/fastly/configuration.go b/fastly/configuration.go index 3f3dfbb..5a61f13 100644 --- a/fastly/configuration.go +++ b/fastly/configuration.go @@ -105,7 +105,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "fastly-go/1.0.0-beta.34", + UserAgent: "fastly-go/1.0.0-beta.35", Debug: false, Servers: ServerConfigurations{ { @@ -184,6 +184,48 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "ACLsInComputeAPIService.ComputeACLCreateAcls": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ACLsInComputeAPIService.ComputeACLDeleteSAclID": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ACLsInComputeAPIService.ComputeACLListAclEntries": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ACLsInComputeAPIService.ComputeACLListAcls": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ACLsInComputeAPIService.ComputeACLListAclsSAclID": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ACLsInComputeAPIService.ComputeACLLookupAcls": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ACLsInComputeAPIService.ComputeACLUpdateAcls": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "ApexRedirectAPIService.CreateApexRedirect": { { URL: "https://api.fastly.com", @@ -544,6 +586,24 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "CustomerAddressesAPIService.CreateCustomerAddress": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "CustomerAddressesAPIService.ListCustomerAddresses": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "CustomerAddressesAPIService.UpdateCustomerAddress": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "DictionaryAPIService.CreateDictionary": { { URL: "https://api.fastly.com", @@ -766,6 +826,18 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "EnabledProductsAPIService.GetProductConfiguration": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "EnabledProductsAPIService.SetProductConfiguration": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "EventsAPIService.GetEvent": { { URL: "https://api.fastly.com", @@ -3142,6 +3214,12 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "VersionAPIService.ActivateServiceVersionEnvironment": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "VersionAPIService.CloneServiceVersion": { { URL: "https://api.fastly.com", @@ -3160,6 +3238,12 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "VersionAPIService.DeactivateServiceVersionEnvironment": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "VersionAPIService.GetServiceVersion": { { URL: "https://api.fastly.com", diff --git a/fastly/model_billing_response_line_item.go b/fastly/model_billing_response_line_item.go index 4792639..8be2b56 100644 --- a/fastly/model_billing_response_line_item.go +++ b/fastly/model_billing_response_line_item.go @@ -26,22 +26,22 @@ type BillingResponseLineItem struct { DeletedAt NullableTime `json:"deleted_at,omitempty"` // Date and time in ISO 8601 format. UpdatedAt NullableTime `json:"updated_at,omitempty"` - Amount *float32 `json:"amount,omitempty"` + Amount NullableFloat32 `json:"amount,omitempty"` // An alphanumeric string identifying the invoice. - AriaInvoiceID *string `json:"aria_invoice_id,omitempty"` - ClientServiceID *string `json:"client_service_id,omitempty"` + AriaInvoiceID NullableString `json:"aria_invoice_id,omitempty"` + ClientServiceID NullableString `json:"client_service_id,omitempty"` CreditCouponCode NullableString `json:"credit_coupon_code,omitempty"` - Description *string `json:"description,omitempty"` + Description NullableString `json:"description,omitempty"` ID *string `json:"id,omitempty"` - LineNumber *int32 `json:"line_number,omitempty"` - PlanName *string `json:"plan_name,omitempty"` - PlanNo *float32 `json:"plan_no,omitempty"` + LineNumber NullableInt32 `json:"line_number,omitempty"` + PlanName NullableString `json:"plan_name,omitempty"` + PlanNo NullableFloat32 `json:"plan_no,omitempty"` RatePerUnit NullableFloat32 `json:"rate_per_unit,omitempty"` RateScheduleNo NullableFloat32 `json:"rate_schedule_no,omitempty"` RateScheduleTierNo NullableFloat32 `json:"rate_schedule_tier_no,omitempty"` - ServiceName *string `json:"service_name,omitempty"` - ServiceNo *float32 `json:"service_no,omitempty"` - Units *float32 `json:"units,omitempty"` + ServiceName NullableString `json:"service_name,omitempty"` + ServiceNo NullableFloat32 `json:"service_no,omitempty"` + Units NullableFloat32 `json:"units,omitempty"` UsageTypeCd NullableString `json:"usage_type_cd,omitempty"` UsageTypeNo NullableFloat32 `json:"usage_type_no,omitempty"` AdditionalProperties map[string]any @@ -192,100 +192,130 @@ func (o *BillingResponseLineItem) UnsetUpdatedAt() { o.UpdatedAt.Unset() } -// GetAmount returns the Amount field value if set, zero value otherwise. +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetAmount() float32 { - if o == nil || o.Amount == nil { + if o == nil || o.Amount.Get() == nil { var ret float32 return ret } - return *o.Amount + return *o.Amount.Get() } // GetAmountOk returns a tuple with the Amount field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetAmountOk() (*float32, bool) { - if o == nil || o.Amount == nil { + if o == nil { return nil, false } - return o.Amount, true + return o.Amount.Get(), o.Amount.IsSet() } // HasAmount returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasAmount() bool { - if o != nil && o.Amount != nil { + if o != nil && o.Amount.IsSet() { return true } return false } -// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +// SetAmount gets a reference to the given NullableFloat32 and assigns it to the Amount field. func (o *BillingResponseLineItem) SetAmount(v float32) { - o.Amount = &v + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *BillingResponseLineItem) SetAmountNil() { + o.Amount.Set(nil) } -// GetAriaInvoiceID returns the AriaInvoiceID field value if set, zero value otherwise. +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *BillingResponseLineItem) UnsetAmount() { + o.Amount.Unset() +} + +// GetAriaInvoiceID returns the AriaInvoiceID field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetAriaInvoiceID() string { - if o == nil || o.AriaInvoiceID == nil { + if o == nil || o.AriaInvoiceID.Get() == nil { var ret string return ret } - return *o.AriaInvoiceID + return *o.AriaInvoiceID.Get() } // GetAriaInvoiceIDOk returns a tuple with the AriaInvoiceID field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetAriaInvoiceIDOk() (*string, bool) { - if o == nil || o.AriaInvoiceID == nil { + if o == nil { return nil, false } - return o.AriaInvoiceID, true + return o.AriaInvoiceID.Get(), o.AriaInvoiceID.IsSet() } // HasAriaInvoiceID returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasAriaInvoiceID() bool { - if o != nil && o.AriaInvoiceID != nil { + if o != nil && o.AriaInvoiceID.IsSet() { return true } return false } -// SetAriaInvoiceID gets a reference to the given string and assigns it to the AriaInvoiceID field. +// SetAriaInvoiceID gets a reference to the given NullableString and assigns it to the AriaInvoiceID field. func (o *BillingResponseLineItem) SetAriaInvoiceID(v string) { - o.AriaInvoiceID = &v + o.AriaInvoiceID.Set(&v) +} +// SetAriaInvoiceIDNil sets the value for AriaInvoiceID to be an explicit nil +func (o *BillingResponseLineItem) SetAriaInvoiceIDNil() { + o.AriaInvoiceID.Set(nil) +} + +// UnsetAriaInvoiceID ensures that no value is present for AriaInvoiceID, not even an explicit nil +func (o *BillingResponseLineItem) UnsetAriaInvoiceID() { + o.AriaInvoiceID.Unset() } -// GetClientServiceID returns the ClientServiceID field value if set, zero value otherwise. +// GetClientServiceID returns the ClientServiceID field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetClientServiceID() string { - if o == nil || o.ClientServiceID == nil { + if o == nil || o.ClientServiceID.Get() == nil { var ret string return ret } - return *o.ClientServiceID + return *o.ClientServiceID.Get() } // GetClientServiceIDOk returns a tuple with the ClientServiceID field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetClientServiceIDOk() (*string, bool) { - if o == nil || o.ClientServiceID == nil { + if o == nil { return nil, false } - return o.ClientServiceID, true + return o.ClientServiceID.Get(), o.ClientServiceID.IsSet() } // HasClientServiceID returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasClientServiceID() bool { - if o != nil && o.ClientServiceID != nil { + if o != nil && o.ClientServiceID.IsSet() { return true } return false } -// SetClientServiceID gets a reference to the given string and assigns it to the ClientServiceID field. +// SetClientServiceID gets a reference to the given NullableString and assigns it to the ClientServiceID field. func (o *BillingResponseLineItem) SetClientServiceID(v string) { - o.ClientServiceID = &v + o.ClientServiceID.Set(&v) +} +// SetClientServiceIDNil sets the value for ClientServiceID to be an explicit nil +func (o *BillingResponseLineItem) SetClientServiceIDNil() { + o.ClientServiceID.Set(nil) +} + +// UnsetClientServiceID ensures that no value is present for ClientServiceID, not even an explicit nil +func (o *BillingResponseLineItem) UnsetClientServiceID() { + o.ClientServiceID.Unset() } // GetCreditCouponCode returns the CreditCouponCode field value if set, zero value otherwise (both if not set or set to explicit null). @@ -330,36 +360,46 @@ func (o *BillingResponseLineItem) UnsetCreditCouponCode() { o.CreditCouponCode.Unset() } -// GetDescription returns the Description field value if set, zero value otherwise. +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || o.Description.Get() == nil { var ret string return ret } - return *o.Description + return *o.Description.Get() } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil { return nil, false } - return o.Description, true + return o.Description.Get(), o.Description.IsSet() } // HasDescription returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && o.Description.IsSet() { return true } return false } -// SetDescription gets a reference to the given string and assigns it to the Description field. +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. func (o *BillingResponseLineItem) SetDescription(v string) { - o.Description = &v + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *BillingResponseLineItem) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *BillingResponseLineItem) UnsetDescription() { + o.Description.Unset() } // GetID returns the ID field value if set, zero value otherwise. @@ -394,100 +434,130 @@ func (o *BillingResponseLineItem) SetID(v string) { o.ID = &v } -// GetLineNumber returns the LineNumber field value if set, zero value otherwise. +// GetLineNumber returns the LineNumber field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetLineNumber() int32 { - if o == nil || o.LineNumber == nil { + if o == nil || o.LineNumber.Get() == nil { var ret int32 return ret } - return *o.LineNumber + return *o.LineNumber.Get() } // GetLineNumberOk returns a tuple with the LineNumber field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetLineNumberOk() (*int32, bool) { - if o == nil || o.LineNumber == nil { + if o == nil { return nil, false } - return o.LineNumber, true + return o.LineNumber.Get(), o.LineNumber.IsSet() } // HasLineNumber returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasLineNumber() bool { - if o != nil && o.LineNumber != nil { + if o != nil && o.LineNumber.IsSet() { return true } return false } -// SetLineNumber gets a reference to the given int32 and assigns it to the LineNumber field. +// SetLineNumber gets a reference to the given NullableInt32 and assigns it to the LineNumber field. func (o *BillingResponseLineItem) SetLineNumber(v int32) { - o.LineNumber = &v + o.LineNumber.Set(&v) +} +// SetLineNumberNil sets the value for LineNumber to be an explicit nil +func (o *BillingResponseLineItem) SetLineNumberNil() { + o.LineNumber.Set(nil) +} + +// UnsetLineNumber ensures that no value is present for LineNumber, not even an explicit nil +func (o *BillingResponseLineItem) UnsetLineNumber() { + o.LineNumber.Unset() } -// GetPlanName returns the PlanName field value if set, zero value otherwise. +// GetPlanName returns the PlanName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetPlanName() string { - if o == nil || o.PlanName == nil { + if o == nil || o.PlanName.Get() == nil { var ret string return ret } - return *o.PlanName + return *o.PlanName.Get() } // GetPlanNameOk returns a tuple with the PlanName field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetPlanNameOk() (*string, bool) { - if o == nil || o.PlanName == nil { + if o == nil { return nil, false } - return o.PlanName, true + return o.PlanName.Get(), o.PlanName.IsSet() } // HasPlanName returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasPlanName() bool { - if o != nil && o.PlanName != nil { + if o != nil && o.PlanName.IsSet() { return true } return false } -// SetPlanName gets a reference to the given string and assigns it to the PlanName field. +// SetPlanName gets a reference to the given NullableString and assigns it to the PlanName field. func (o *BillingResponseLineItem) SetPlanName(v string) { - o.PlanName = &v + o.PlanName.Set(&v) +} +// SetPlanNameNil sets the value for PlanName to be an explicit nil +func (o *BillingResponseLineItem) SetPlanNameNil() { + o.PlanName.Set(nil) } -// GetPlanNo returns the PlanNo field value if set, zero value otherwise. +// UnsetPlanName ensures that no value is present for PlanName, not even an explicit nil +func (o *BillingResponseLineItem) UnsetPlanName() { + o.PlanName.Unset() +} + +// GetPlanNo returns the PlanNo field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetPlanNo() float32 { - if o == nil || o.PlanNo == nil { + if o == nil || o.PlanNo.Get() == nil { var ret float32 return ret } - return *o.PlanNo + return *o.PlanNo.Get() } // GetPlanNoOk returns a tuple with the PlanNo field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetPlanNoOk() (*float32, bool) { - if o == nil || o.PlanNo == nil { + if o == nil { return nil, false } - return o.PlanNo, true + return o.PlanNo.Get(), o.PlanNo.IsSet() } // HasPlanNo returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasPlanNo() bool { - if o != nil && o.PlanNo != nil { + if o != nil && o.PlanNo.IsSet() { return true } return false } -// SetPlanNo gets a reference to the given float32 and assigns it to the PlanNo field. +// SetPlanNo gets a reference to the given NullableFloat32 and assigns it to the PlanNo field. func (o *BillingResponseLineItem) SetPlanNo(v float32) { - o.PlanNo = &v + o.PlanNo.Set(&v) +} +// SetPlanNoNil sets the value for PlanNo to be an explicit nil +func (o *BillingResponseLineItem) SetPlanNoNil() { + o.PlanNo.Set(nil) +} + +// UnsetPlanNo ensures that no value is present for PlanNo, not even an explicit nil +func (o *BillingResponseLineItem) UnsetPlanNo() { + o.PlanNo.Unset() } // GetRatePerUnit returns the RatePerUnit field value if set, zero value otherwise (both if not set or set to explicit null). @@ -616,100 +686,130 @@ func (o *BillingResponseLineItem) UnsetRateScheduleTierNo() { o.RateScheduleTierNo.Unset() } -// GetServiceName returns the ServiceName field value if set, zero value otherwise. +// GetServiceName returns the ServiceName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetServiceName() string { - if o == nil || o.ServiceName == nil { + if o == nil || o.ServiceName.Get() == nil { var ret string return ret } - return *o.ServiceName + return *o.ServiceName.Get() } // GetServiceNameOk returns a tuple with the ServiceName field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetServiceNameOk() (*string, bool) { - if o == nil || o.ServiceName == nil { + if o == nil { return nil, false } - return o.ServiceName, true + return o.ServiceName.Get(), o.ServiceName.IsSet() } // HasServiceName returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasServiceName() bool { - if o != nil && o.ServiceName != nil { + if o != nil && o.ServiceName.IsSet() { return true } return false } -// SetServiceName gets a reference to the given string and assigns it to the ServiceName field. +// SetServiceName gets a reference to the given NullableString and assigns it to the ServiceName field. func (o *BillingResponseLineItem) SetServiceName(v string) { - o.ServiceName = &v + o.ServiceName.Set(&v) +} +// SetServiceNameNil sets the value for ServiceName to be an explicit nil +func (o *BillingResponseLineItem) SetServiceNameNil() { + o.ServiceName.Set(nil) } -// GetServiceNo returns the ServiceNo field value if set, zero value otherwise. +// UnsetServiceName ensures that no value is present for ServiceName, not even an explicit nil +func (o *BillingResponseLineItem) UnsetServiceName() { + o.ServiceName.Unset() +} + +// GetServiceNo returns the ServiceNo field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetServiceNo() float32 { - if o == nil || o.ServiceNo == nil { + if o == nil || o.ServiceNo.Get() == nil { var ret float32 return ret } - return *o.ServiceNo + return *o.ServiceNo.Get() } // GetServiceNoOk returns a tuple with the ServiceNo field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetServiceNoOk() (*float32, bool) { - if o == nil || o.ServiceNo == nil { + if o == nil { return nil, false } - return o.ServiceNo, true + return o.ServiceNo.Get(), o.ServiceNo.IsSet() } // HasServiceNo returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasServiceNo() bool { - if o != nil && o.ServiceNo != nil { + if o != nil && o.ServiceNo.IsSet() { return true } return false } -// SetServiceNo gets a reference to the given float32 and assigns it to the ServiceNo field. +// SetServiceNo gets a reference to the given NullableFloat32 and assigns it to the ServiceNo field. func (o *BillingResponseLineItem) SetServiceNo(v float32) { - o.ServiceNo = &v + o.ServiceNo.Set(&v) +} +// SetServiceNoNil sets the value for ServiceNo to be an explicit nil +func (o *BillingResponseLineItem) SetServiceNoNil() { + o.ServiceNo.Set(nil) +} + +// UnsetServiceNo ensures that no value is present for ServiceNo, not even an explicit nil +func (o *BillingResponseLineItem) UnsetServiceNo() { + o.ServiceNo.Unset() } -// GetUnits returns the Units field value if set, zero value otherwise. +// GetUnits returns the Units field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BillingResponseLineItem) GetUnits() float32 { - if o == nil || o.Units == nil { + if o == nil || o.Units.Get() == nil { var ret float32 return ret } - return *o.Units + return *o.Units.Get() } // GetUnitsOk returns a tuple with the Units field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BillingResponseLineItem) GetUnitsOk() (*float32, bool) { - if o == nil || o.Units == nil { + if o == nil { return nil, false } - return o.Units, true + return o.Units.Get(), o.Units.IsSet() } // HasUnits returns a boolean if a field has been set. func (o *BillingResponseLineItem) HasUnits() bool { - if o != nil && o.Units != nil { + if o != nil && o.Units.IsSet() { return true } return false } -// SetUnits gets a reference to the given float32 and assigns it to the Units field. +// SetUnits gets a reference to the given NullableFloat32 and assigns it to the Units field. func (o *BillingResponseLineItem) SetUnits(v float32) { - o.Units = &v + o.Units.Set(&v) +} +// SetUnitsNil sets the value for Units to be an explicit nil +func (o *BillingResponseLineItem) SetUnitsNil() { + o.Units.Set(nil) +} + +// UnsetUnits ensures that no value is present for Units, not even an explicit nil +func (o *BillingResponseLineItem) UnsetUnits() { + o.Units.Unset() } // GetUsageTypeCd returns the UsageTypeCd field value if set, zero value otherwise (both if not set or set to explicit null). @@ -809,32 +909,32 @@ func (o BillingResponseLineItem) MarshalJSON() ([]byte, error) { if o.UpdatedAt.IsSet() { toSerialize["updated_at"] = o.UpdatedAt.Get() } - if o.Amount != nil { - toSerialize["amount"] = o.Amount + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() } - if o.AriaInvoiceID != nil { - toSerialize["aria_invoice_id"] = o.AriaInvoiceID + if o.AriaInvoiceID.IsSet() { + toSerialize["aria_invoice_id"] = o.AriaInvoiceID.Get() } - if o.ClientServiceID != nil { - toSerialize["client_service_id"] = o.ClientServiceID + if o.ClientServiceID.IsSet() { + toSerialize["client_service_id"] = o.ClientServiceID.Get() } if o.CreditCouponCode.IsSet() { toSerialize["credit_coupon_code"] = o.CreditCouponCode.Get() } - if o.Description != nil { - toSerialize["description"] = o.Description + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() } if o.ID != nil { toSerialize["id"] = o.ID } - if o.LineNumber != nil { - toSerialize["line_number"] = o.LineNumber + if o.LineNumber.IsSet() { + toSerialize["line_number"] = o.LineNumber.Get() } - if o.PlanName != nil { - toSerialize["plan_name"] = o.PlanName + if o.PlanName.IsSet() { + toSerialize["plan_name"] = o.PlanName.Get() } - if o.PlanNo != nil { - toSerialize["plan_no"] = o.PlanNo + if o.PlanNo.IsSet() { + toSerialize["plan_no"] = o.PlanNo.Get() } if o.RatePerUnit.IsSet() { toSerialize["rate_per_unit"] = o.RatePerUnit.Get() @@ -845,14 +945,14 @@ func (o BillingResponseLineItem) MarshalJSON() ([]byte, error) { if o.RateScheduleTierNo.IsSet() { toSerialize["rate_schedule_tier_no"] = o.RateScheduleTierNo.Get() } - if o.ServiceName != nil { - toSerialize["service_name"] = o.ServiceName + if o.ServiceName.IsSet() { + toSerialize["service_name"] = o.ServiceName.Get() } - if o.ServiceNo != nil { - toSerialize["service_no"] = o.ServiceNo + if o.ServiceNo.IsSet() { + toSerialize["service_no"] = o.ServiceNo.Get() } - if o.Units != nil { - toSerialize["units"] = o.Units + if o.Units.IsSet() { + toSerialize["units"] = o.Units.Get() } if o.UsageTypeCd.IsSet() { toSerialize["usage_type_cd"] = o.UsageTypeCd.Get() diff --git a/fastly/model_compute_acl_create_acls_request.go b/fastly/model_compute_acl_create_acls_request.go new file mode 100644 index 0000000..6f7df0a --- /dev/null +++ b/fastly/model_compute_acl_create_acls_request.go @@ -0,0 +1,156 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ComputeACLCreateAclsRequest struct for ComputeACLCreateAclsRequest +type ComputeACLCreateAclsRequest struct { + // Human readable name of store + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]any +} + +type _ComputeACLCreateAclsRequest ComputeACLCreateAclsRequest + +// NewComputeACLCreateAclsRequest instantiates a new ComputeACLCreateAclsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComputeACLCreateAclsRequest() *ComputeACLCreateAclsRequest { + this := ComputeACLCreateAclsRequest{} + return &this +} + +// NewComputeACLCreateAclsRequestWithDefaults instantiates a new ComputeACLCreateAclsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComputeACLCreateAclsRequestWithDefaults() *ComputeACLCreateAclsRequest { + this := ComputeACLCreateAclsRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ComputeACLCreateAclsRequest) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLCreateAclsRequest) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ComputeACLCreateAclsRequest) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ComputeACLCreateAclsRequest) SetName(v string) { + o.Name = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ComputeACLCreateAclsRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ComputeACLCreateAclsRequest) UnmarshalJSON(bytes []byte) (err error) { + varComputeACLCreateAclsRequest := _ComputeACLCreateAclsRequest{} + + if err = json.Unmarshal(bytes, &varComputeACLCreateAclsRequest); err == nil { + *o = ComputeACLCreateAclsRequest(varComputeACLCreateAclsRequest) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableComputeACLCreateAclsRequest is a helper abstraction for handling nullable computeaclcreateaclsrequest types. +type NullableComputeACLCreateAclsRequest struct { + value *ComputeACLCreateAclsRequest + isSet bool +} + +// Get returns the value. +func (v NullableComputeACLCreateAclsRequest) Get() *ComputeACLCreateAclsRequest { + return v.value +} + +// Set modifies the value. +func (v *NullableComputeACLCreateAclsRequest) Set(val *ComputeACLCreateAclsRequest) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableComputeACLCreateAclsRequest) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableComputeACLCreateAclsRequest) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableComputeACLCreateAclsRequest returns a pointer to a new instance of NullableComputeACLCreateAclsRequest. +func NewNullableComputeACLCreateAclsRequest(val *ComputeACLCreateAclsRequest) *NullableComputeACLCreateAclsRequest { + return &NullableComputeACLCreateAclsRequest{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableComputeACLCreateAclsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableComputeACLCreateAclsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_compute_acl_create_acls_response.go b/fastly/model_compute_acl_create_acls_response.go new file mode 100644 index 0000000..d46a843 --- /dev/null +++ b/fastly/model_compute_acl_create_acls_response.go @@ -0,0 +1,194 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ComputeACLCreateAclsResponse struct for ComputeACLCreateAclsResponse +type ComputeACLCreateAclsResponse struct { + // Human readable name of store + Name *string `json:"name,omitempty"` + // An example identifier (UUID). + ID *string `json:"id,omitempty"` + AdditionalProperties map[string]any +} + +type _ComputeACLCreateAclsResponse ComputeACLCreateAclsResponse + +// NewComputeACLCreateAclsResponse instantiates a new ComputeACLCreateAclsResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComputeACLCreateAclsResponse() *ComputeACLCreateAclsResponse { + this := ComputeACLCreateAclsResponse{} + return &this +} + +// NewComputeACLCreateAclsResponseWithDefaults instantiates a new ComputeACLCreateAclsResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComputeACLCreateAclsResponseWithDefaults() *ComputeACLCreateAclsResponse { + this := ComputeACLCreateAclsResponse{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ComputeACLCreateAclsResponse) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLCreateAclsResponse) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *ComputeACLCreateAclsResponse) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ComputeACLCreateAclsResponse) SetName(v string) { + o.Name = &v +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *ComputeACLCreateAclsResponse) GetID() string { + if o == nil || o.ID == nil { + var ret string + return ret + } + return *o.ID +} + +// GetIDOk returns a tuple with the ID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLCreateAclsResponse) GetIDOk() (*string, bool) { + if o == nil || o.ID == nil { + return nil, false + } + return o.ID, true +} + +// HasID returns a boolean if a field has been set. +func (o *ComputeACLCreateAclsResponse) HasID() bool { + if o != nil && o.ID != nil { + return true + } + + return false +} + +// SetID gets a reference to the given string and assigns it to the ID field. +func (o *ComputeACLCreateAclsResponse) SetID(v string) { + o.ID = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ComputeACLCreateAclsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ID != nil { + toSerialize["id"] = o.ID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ComputeACLCreateAclsResponse) UnmarshalJSON(bytes []byte) (err error) { + varComputeACLCreateAclsResponse := _ComputeACLCreateAclsResponse{} + + if err = json.Unmarshal(bytes, &varComputeACLCreateAclsResponse); err == nil { + *o = ComputeACLCreateAclsResponse(varComputeACLCreateAclsResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableComputeACLCreateAclsResponse is a helper abstraction for handling nullable computeaclcreateaclsresponse types. +type NullableComputeACLCreateAclsResponse struct { + value *ComputeACLCreateAclsResponse + isSet bool +} + +// Get returns the value. +func (v NullableComputeACLCreateAclsResponse) Get() *ComputeACLCreateAclsResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableComputeACLCreateAclsResponse) Set(val *ComputeACLCreateAclsResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableComputeACLCreateAclsResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableComputeACLCreateAclsResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableComputeACLCreateAclsResponse returns a pointer to a new instance of NullableComputeACLCreateAclsResponse. +func NewNullableComputeACLCreateAclsResponse(val *ComputeACLCreateAclsResponse) *NullableComputeACLCreateAclsResponse { + return &NullableComputeACLCreateAclsResponse{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableComputeACLCreateAclsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableComputeACLCreateAclsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_compute_acl_list_entries.go b/fastly/model_compute_acl_list_entries.go new file mode 100644 index 0000000..ed0fa88 --- /dev/null +++ b/fastly/model_compute_acl_list_entries.go @@ -0,0 +1,192 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ComputeACLListEntries An example of an ACL List Response. +type ComputeACLListEntries struct { + Meta *ComputeACLListEntriesMeta `json:"meta,omitempty"` + Entries []ComputeACLListEntriesItem `json:"entries,omitempty"` + AdditionalProperties map[string]any +} + +type _ComputeACLListEntries ComputeACLListEntries + +// NewComputeACLListEntries instantiates a new ComputeACLListEntries object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComputeACLListEntries() *ComputeACLListEntries { + this := ComputeACLListEntries{} + return &this +} + +// NewComputeACLListEntriesWithDefaults instantiates a new ComputeACLListEntries object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComputeACLListEntriesWithDefaults() *ComputeACLListEntries { + this := ComputeACLListEntries{} + return &this +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *ComputeACLListEntries) GetMeta() ComputeACLListEntriesMeta { + if o == nil || o.Meta == nil { + var ret ComputeACLListEntriesMeta + return ret + } + return *o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLListEntries) GetMetaOk() (*ComputeACLListEntriesMeta, bool) { + if o == nil || o.Meta == nil { + return nil, false + } + return o.Meta, true +} + +// HasMeta returns a boolean if a field has been set. +func (o *ComputeACLListEntries) HasMeta() bool { + if o != nil && o.Meta != nil { + return true + } + + return false +} + +// SetMeta gets a reference to the given ComputeACLListEntriesMeta and assigns it to the Meta field. +func (o *ComputeACLListEntries) SetMeta(v ComputeACLListEntriesMeta) { + o.Meta = &v +} + +// GetEntries returns the Entries field value if set, zero value otherwise. +func (o *ComputeACLListEntries) GetEntries() []ComputeACLListEntriesItem { + if o == nil || o.Entries == nil { + var ret []ComputeACLListEntriesItem + return ret + } + return o.Entries +} + +// GetEntriesOk returns a tuple with the Entries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLListEntries) GetEntriesOk() ([]ComputeACLListEntriesItem, bool) { + if o == nil || o.Entries == nil { + return nil, false + } + return o.Entries, true +} + +// HasEntries returns a boolean if a field has been set. +func (o *ComputeACLListEntries) HasEntries() bool { + if o != nil && o.Entries != nil { + return true + } + + return false +} + +// SetEntries gets a reference to the given []ComputeACLListEntriesItem and assigns it to the Entries field. +func (o *ComputeACLListEntries) SetEntries(v []ComputeACLListEntriesItem) { + o.Entries = v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ComputeACLListEntries) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + if o.Entries != nil { + toSerialize["entries"] = o.Entries + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ComputeACLListEntries) UnmarshalJSON(bytes []byte) (err error) { + varComputeACLListEntries := _ComputeACLListEntries{} + + if err = json.Unmarshal(bytes, &varComputeACLListEntries); err == nil { + *o = ComputeACLListEntries(varComputeACLListEntries) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "meta") + delete(additionalProperties, "entries") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableComputeACLListEntries is a helper abstraction for handling nullable computeacllistentries types. +type NullableComputeACLListEntries struct { + value *ComputeACLListEntries + isSet bool +} + +// Get returns the value. +func (v NullableComputeACLListEntries) Get() *ComputeACLListEntries { + return v.value +} + +// Set modifies the value. +func (v *NullableComputeACLListEntries) Set(val *ComputeACLListEntries) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableComputeACLListEntries) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableComputeACLListEntries) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableComputeACLListEntries returns a pointer to a new instance of NullableComputeACLListEntries. +func NewNullableComputeACLListEntries(val *ComputeACLListEntries) *NullableComputeACLListEntries { + return &NullableComputeACLListEntries{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableComputeACLListEntries) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableComputeACLListEntries) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_compute_acl_list_entries_item.go b/fastly/model_compute_acl_list_entries_item.go new file mode 100644 index 0000000..cebb941 --- /dev/null +++ b/fastly/model_compute_acl_list_entries_item.go @@ -0,0 +1,194 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ComputeACLListEntriesItem struct for ComputeACLListEntriesItem +type ComputeACLListEntriesItem struct { + // An IP prefix defined in Classless Inter-Domain Routing (CIDR) format, i.e. a valid IP address (v4 or v6) followed by a forward slash (/) and a prefix length (0-32 or 0-128, depending on address family). + Prefix *string `json:"prefix,omitempty"` + // One of \"ALLOW\" or \"BLOCK\". + Action *string `json:"action,omitempty"` + AdditionalProperties map[string]any +} + +type _ComputeACLListEntriesItem ComputeACLListEntriesItem + +// NewComputeACLListEntriesItem instantiates a new ComputeACLListEntriesItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComputeACLListEntriesItem() *ComputeACLListEntriesItem { + this := ComputeACLListEntriesItem{} + return &this +} + +// NewComputeACLListEntriesItemWithDefaults instantiates a new ComputeACLListEntriesItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComputeACLListEntriesItemWithDefaults() *ComputeACLListEntriesItem { + this := ComputeACLListEntriesItem{} + return &this +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *ComputeACLListEntriesItem) GetPrefix() string { + if o == nil || o.Prefix == nil { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLListEntriesItem) GetPrefixOk() (*string, bool) { + if o == nil || o.Prefix == nil { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *ComputeACLListEntriesItem) HasPrefix() bool { + if o != nil && o.Prefix != nil { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *ComputeACLListEntriesItem) SetPrefix(v string) { + o.Prefix = &v +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *ComputeACLListEntriesItem) GetAction() string { + if o == nil || o.Action == nil { + var ret string + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLListEntriesItem) GetActionOk() (*string, bool) { + if o == nil || o.Action == nil { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *ComputeACLListEntriesItem) HasAction() bool { + if o != nil && o.Action != nil { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *ComputeACLListEntriesItem) SetAction(v string) { + o.Action = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ComputeACLListEntriesItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Prefix != nil { + toSerialize["prefix"] = o.Prefix + } + if o.Action != nil { + toSerialize["action"] = o.Action + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ComputeACLListEntriesItem) UnmarshalJSON(bytes []byte) (err error) { + varComputeACLListEntriesItem := _ComputeACLListEntriesItem{} + + if err = json.Unmarshal(bytes, &varComputeACLListEntriesItem); err == nil { + *o = ComputeACLListEntriesItem(varComputeACLListEntriesItem) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableComputeACLListEntriesItem is a helper abstraction for handling nullable computeacllistentriesitem types. +type NullableComputeACLListEntriesItem struct { + value *ComputeACLListEntriesItem + isSet bool +} + +// Get returns the value. +func (v NullableComputeACLListEntriesItem) Get() *ComputeACLListEntriesItem { + return v.value +} + +// Set modifies the value. +func (v *NullableComputeACLListEntriesItem) Set(val *ComputeACLListEntriesItem) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableComputeACLListEntriesItem) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableComputeACLListEntriesItem) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableComputeACLListEntriesItem returns a pointer to a new instance of NullableComputeACLListEntriesItem. +func NewNullableComputeACLListEntriesItem(val *ComputeACLListEntriesItem) *NullableComputeACLListEntriesItem { + return &NullableComputeACLListEntriesItem{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableComputeACLListEntriesItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableComputeACLListEntriesItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_compute_acl_list_entries_meta.go b/fastly/model_compute_acl_list_entries_meta.go new file mode 100644 index 0000000..62a32e9 --- /dev/null +++ b/fastly/model_compute_acl_list_entries_meta.go @@ -0,0 +1,194 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ComputeACLListEntriesMeta struct for ComputeACLListEntriesMeta +type ComputeACLListEntriesMeta struct { + // The maximum number of results shown in this response. + Limit *string `json:"limit,omitempty"` + // Used for pagination, supply to the next request to get the next block of results. + NextCursor *string `json:"next_cursor,omitempty"` + AdditionalProperties map[string]any +} + +type _ComputeACLListEntriesMeta ComputeACLListEntriesMeta + +// NewComputeACLListEntriesMeta instantiates a new ComputeACLListEntriesMeta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComputeACLListEntriesMeta() *ComputeACLListEntriesMeta { + this := ComputeACLListEntriesMeta{} + return &this +} + +// NewComputeACLListEntriesMetaWithDefaults instantiates a new ComputeACLListEntriesMeta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComputeACLListEntriesMetaWithDefaults() *ComputeACLListEntriesMeta { + this := ComputeACLListEntriesMeta{} + return &this +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *ComputeACLListEntriesMeta) GetLimit() string { + if o == nil || o.Limit == nil { + var ret string + return ret + } + return *o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLListEntriesMeta) GetLimitOk() (*string, bool) { + if o == nil || o.Limit == nil { + return nil, false + } + return o.Limit, true +} + +// HasLimit returns a boolean if a field has been set. +func (o *ComputeACLListEntriesMeta) HasLimit() bool { + if o != nil && o.Limit != nil { + return true + } + + return false +} + +// SetLimit gets a reference to the given string and assigns it to the Limit field. +func (o *ComputeACLListEntriesMeta) SetLimit(v string) { + o.Limit = &v +} + +// GetNextCursor returns the NextCursor field value if set, zero value otherwise. +func (o *ComputeACLListEntriesMeta) GetNextCursor() string { + if o == nil || o.NextCursor == nil { + var ret string + return ret + } + return *o.NextCursor +} + +// GetNextCursorOk returns a tuple with the NextCursor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLListEntriesMeta) GetNextCursorOk() (*string, bool) { + if o == nil || o.NextCursor == nil { + return nil, false + } + return o.NextCursor, true +} + +// HasNextCursor returns a boolean if a field has been set. +func (o *ComputeACLListEntriesMeta) HasNextCursor() bool { + if o != nil && o.NextCursor != nil { + return true + } + + return false +} + +// SetNextCursor gets a reference to the given string and assigns it to the NextCursor field. +func (o *ComputeACLListEntriesMeta) SetNextCursor(v string) { + o.NextCursor = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ComputeACLListEntriesMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + if o.NextCursor != nil { + toSerialize["next_cursor"] = o.NextCursor + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ComputeACLListEntriesMeta) UnmarshalJSON(bytes []byte) (err error) { + varComputeACLListEntriesMeta := _ComputeACLListEntriesMeta{} + + if err = json.Unmarshal(bytes, &varComputeACLListEntriesMeta); err == nil { + *o = ComputeACLListEntriesMeta(varComputeACLListEntriesMeta) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "limit") + delete(additionalProperties, "next_cursor") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableComputeACLListEntriesMeta is a helper abstraction for handling nullable computeacllistentriesmeta types. +type NullableComputeACLListEntriesMeta struct { + value *ComputeACLListEntriesMeta + isSet bool +} + +// Get returns the value. +func (v NullableComputeACLListEntriesMeta) Get() *ComputeACLListEntriesMeta { + return v.value +} + +// Set modifies the value. +func (v *NullableComputeACLListEntriesMeta) Set(val *ComputeACLListEntriesMeta) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableComputeACLListEntriesMeta) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableComputeACLListEntriesMeta) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableComputeACLListEntriesMeta returns a pointer to a new instance of NullableComputeACLListEntriesMeta. +func NewNullableComputeACLListEntriesMeta(val *ComputeACLListEntriesMeta) *NullableComputeACLListEntriesMeta { + return &NullableComputeACLListEntriesMeta{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableComputeACLListEntriesMeta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableComputeACLListEntriesMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_compute_acl_lookup.go b/fastly/model_compute_acl_lookup.go new file mode 100644 index 0000000..1caa5c3 --- /dev/null +++ b/fastly/model_compute_acl_lookup.go @@ -0,0 +1,232 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ComputeACLLookup An example of an ACL Lookup response. +type ComputeACLLookup struct { + // A valid IPv4 or IPv6 address. + Prefix *string `json:"prefix,omitempty"` + // The length of address in the IP addressing space. + Length *int32 `json:"length,omitempty"` + // One of \"ALLOW\" or \"BLOCK\". + Action *string `json:"action,omitempty"` + AdditionalProperties map[string]any +} + +type _ComputeACLLookup ComputeACLLookup + +// NewComputeACLLookup instantiates a new ComputeACLLookup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComputeACLLookup() *ComputeACLLookup { + this := ComputeACLLookup{} + return &this +} + +// NewComputeACLLookupWithDefaults instantiates a new ComputeACLLookup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComputeACLLookupWithDefaults() *ComputeACLLookup { + this := ComputeACLLookup{} + return &this +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *ComputeACLLookup) GetPrefix() string { + if o == nil || o.Prefix == nil { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLLookup) GetPrefixOk() (*string, bool) { + if o == nil || o.Prefix == nil { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *ComputeACLLookup) HasPrefix() bool { + if o != nil && o.Prefix != nil { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *ComputeACLLookup) SetPrefix(v string) { + o.Prefix = &v +} + +// GetLength returns the Length field value if set, zero value otherwise. +func (o *ComputeACLLookup) GetLength() int32 { + if o == nil || o.Length == nil { + var ret int32 + return ret + } + return *o.Length +} + +// GetLengthOk returns a tuple with the Length field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLLookup) GetLengthOk() (*int32, bool) { + if o == nil || o.Length == nil { + return nil, false + } + return o.Length, true +} + +// HasLength returns a boolean if a field has been set. +func (o *ComputeACLLookup) HasLength() bool { + if o != nil && o.Length != nil { + return true + } + + return false +} + +// SetLength gets a reference to the given int32 and assigns it to the Length field. +func (o *ComputeACLLookup) SetLength(v int32) { + o.Length = &v +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *ComputeACLLookup) GetAction() string { + if o == nil || o.Action == nil { + var ret string + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLLookup) GetActionOk() (*string, bool) { + if o == nil || o.Action == nil { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *ComputeACLLookup) HasAction() bool { + if o != nil && o.Action != nil { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *ComputeACLLookup) SetAction(v string) { + o.Action = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ComputeACLLookup) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Prefix != nil { + toSerialize["prefix"] = o.Prefix + } + if o.Length != nil { + toSerialize["length"] = o.Length + } + if o.Action != nil { + toSerialize["action"] = o.Action + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ComputeACLLookup) UnmarshalJSON(bytes []byte) (err error) { + varComputeACLLookup := _ComputeACLLookup{} + + if err = json.Unmarshal(bytes, &varComputeACLLookup); err == nil { + *o = ComputeACLLookup(varComputeACLLookup) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "prefix") + delete(additionalProperties, "length") + delete(additionalProperties, "action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableComputeACLLookup is a helper abstraction for handling nullable computeacllookup types. +type NullableComputeACLLookup struct { + value *ComputeACLLookup + isSet bool +} + +// Get returns the value. +func (v NullableComputeACLLookup) Get() *ComputeACLLookup { + return v.value +} + +// Set modifies the value. +func (v *NullableComputeACLLookup) Set(val *ComputeACLLookup) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableComputeACLLookup) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableComputeACLLookup) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableComputeACLLookup returns a pointer to a new instance of NullableComputeACLLookup. +func NewNullableComputeACLLookup(val *ComputeACLLookup) *NullableComputeACLLookup { + return &NullableComputeACLLookup{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableComputeACLLookup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableComputeACLLookup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_compute_acl_update_entry.go b/fastly/model_compute_acl_update_entry.go new file mode 100644 index 0000000..219e1fb --- /dev/null +++ b/fastly/model_compute_acl_update_entry.go @@ -0,0 +1,232 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ComputeACLUpdateEntry An example of an ACL update request entry. +type ComputeACLUpdateEntry struct { + // One of \"create\" or \"update\", indicating that the rest of this entry is to be added to/updated in the ACL. + Op *string `json:"op,omitempty"` + // An IP prefix defined in Classless Inter-Domain Routing (CIDR) format, i.e. a valid IP address (v4 or v6) followed by a forward slash (/) and a prefix length (0-32 or 0-128, depending on address family). + Prefix *string `json:"prefix,omitempty"` + // The action taken on the IP address, either \"block\" or \"allow\". + Action *string `json:"action,omitempty"` + AdditionalProperties map[string]any +} + +type _ComputeACLUpdateEntry ComputeACLUpdateEntry + +// NewComputeACLUpdateEntry instantiates a new ComputeACLUpdateEntry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewComputeACLUpdateEntry() *ComputeACLUpdateEntry { + this := ComputeACLUpdateEntry{} + return &this +} + +// NewComputeACLUpdateEntryWithDefaults instantiates a new ComputeACLUpdateEntry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewComputeACLUpdateEntryWithDefaults() *ComputeACLUpdateEntry { + this := ComputeACLUpdateEntry{} + return &this +} + +// GetOp returns the Op field value if set, zero value otherwise. +func (o *ComputeACLUpdateEntry) GetOp() string { + if o == nil || o.Op == nil { + var ret string + return ret + } + return *o.Op +} + +// GetOpOk returns a tuple with the Op field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLUpdateEntry) GetOpOk() (*string, bool) { + if o == nil || o.Op == nil { + return nil, false + } + return o.Op, true +} + +// HasOp returns a boolean if a field has been set. +func (o *ComputeACLUpdateEntry) HasOp() bool { + if o != nil && o.Op != nil { + return true + } + + return false +} + +// SetOp gets a reference to the given string and assigns it to the Op field. +func (o *ComputeACLUpdateEntry) SetOp(v string) { + o.Op = &v +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *ComputeACLUpdateEntry) GetPrefix() string { + if o == nil || o.Prefix == nil { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLUpdateEntry) GetPrefixOk() (*string, bool) { + if o == nil || o.Prefix == nil { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *ComputeACLUpdateEntry) HasPrefix() bool { + if o != nil && o.Prefix != nil { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *ComputeACLUpdateEntry) SetPrefix(v string) { + o.Prefix = &v +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *ComputeACLUpdateEntry) GetAction() string { + if o == nil || o.Action == nil { + var ret string + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ComputeACLUpdateEntry) GetActionOk() (*string, bool) { + if o == nil || o.Action == nil { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *ComputeACLUpdateEntry) HasAction() bool { + if o != nil && o.Action != nil { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *ComputeACLUpdateEntry) SetAction(v string) { + o.Action = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ComputeACLUpdateEntry) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Op != nil { + toSerialize["op"] = o.Op + } + if o.Prefix != nil { + toSerialize["prefix"] = o.Prefix + } + if o.Action != nil { + toSerialize["action"] = o.Action + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ComputeACLUpdateEntry) UnmarshalJSON(bytes []byte) (err error) { + varComputeACLUpdateEntry := _ComputeACLUpdateEntry{} + + if err = json.Unmarshal(bytes, &varComputeACLUpdateEntry); err == nil { + *o = ComputeACLUpdateEntry(varComputeACLUpdateEntry) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "op") + delete(additionalProperties, "prefix") + delete(additionalProperties, "action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableComputeACLUpdateEntry is a helper abstraction for handling nullable computeaclupdateentry types. +type NullableComputeACLUpdateEntry struct { + value *ComputeACLUpdateEntry + isSet bool +} + +// Get returns the value. +func (v NullableComputeACLUpdateEntry) Get() *ComputeACLUpdateEntry { + return v.value +} + +// Set modifies the value. +func (v *NullableComputeACLUpdateEntry) Set(val *ComputeACLUpdateEntry) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableComputeACLUpdateEntry) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableComputeACLUpdateEntry) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableComputeACLUpdateEntry returns a pointer to a new instance of NullableComputeACLUpdateEntry. +func NewNullableComputeACLUpdateEntry(val *ComputeACLUpdateEntry) *NullableComputeACLUpdateEntry { + return &NullableComputeACLUpdateEntry{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableComputeACLUpdateEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableComputeACLUpdateEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_configured_product_response.go b/fastly/model_configured_product_response.go new file mode 100644 index 0000000..7d197b6 --- /dev/null +++ b/fastly/model_configured_product_response.go @@ -0,0 +1,266 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ConfiguredProductResponse struct for ConfiguredProductResponse +type ConfiguredProductResponse struct { + Product *ConfiguredProductResponseProduct `json:"product,omitempty"` + Service *EnabledProductResponseService `json:"service,omitempty"` + Configuration *ConfiguredProductResponseConfiguration `json:"configuration,omitempty"` + Links *ConfiguredProductResponseLinks `json:"_links,omitempty"` + AdditionalProperties map[string]any +} + +type _ConfiguredProductResponse ConfiguredProductResponse + +// NewConfiguredProductResponse instantiates a new ConfiguredProductResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfiguredProductResponse() *ConfiguredProductResponse { + this := ConfiguredProductResponse{} + return &this +} + +// NewConfiguredProductResponseWithDefaults instantiates a new ConfiguredProductResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfiguredProductResponseWithDefaults() *ConfiguredProductResponse { + this := ConfiguredProductResponse{} + return &this +} + +// GetProduct returns the Product field value if set, zero value otherwise. +func (o *ConfiguredProductResponse) GetProduct() ConfiguredProductResponseProduct { + if o == nil || o.Product == nil { + var ret ConfiguredProductResponseProduct + return ret + } + return *o.Product +} + +// GetProductOk returns a tuple with the Product field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponse) GetProductOk() (*ConfiguredProductResponseProduct, bool) { + if o == nil || o.Product == nil { + return nil, false + } + return o.Product, true +} + +// HasProduct returns a boolean if a field has been set. +func (o *ConfiguredProductResponse) HasProduct() bool { + if o != nil && o.Product != nil { + return true + } + + return false +} + +// SetProduct gets a reference to the given ConfiguredProductResponseProduct and assigns it to the Product field. +func (o *ConfiguredProductResponse) SetProduct(v ConfiguredProductResponseProduct) { + o.Product = &v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *ConfiguredProductResponse) GetService() EnabledProductResponseService { + if o == nil || o.Service == nil { + var ret EnabledProductResponseService + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponse) GetServiceOk() (*EnabledProductResponseService, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *ConfiguredProductResponse) HasService() bool { + if o != nil && o.Service != nil { + return true + } + + return false +} + +// SetService gets a reference to the given EnabledProductResponseService and assigns it to the Service field. +func (o *ConfiguredProductResponse) SetService(v EnabledProductResponseService) { + o.Service = &v +} + +// GetConfiguration returns the Configuration field value if set, zero value otherwise. +func (o *ConfiguredProductResponse) GetConfiguration() ConfiguredProductResponseConfiguration { + if o == nil || o.Configuration == nil { + var ret ConfiguredProductResponseConfiguration + return ret + } + return *o.Configuration +} + +// GetConfigurationOk returns a tuple with the Configuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponse) GetConfigurationOk() (*ConfiguredProductResponseConfiguration, bool) { + if o == nil || o.Configuration == nil { + return nil, false + } + return o.Configuration, true +} + +// HasConfiguration returns a boolean if a field has been set. +func (o *ConfiguredProductResponse) HasConfiguration() bool { + if o != nil && o.Configuration != nil { + return true + } + + return false +} + +// SetConfiguration gets a reference to the given ConfiguredProductResponseConfiguration and assigns it to the Configuration field. +func (o *ConfiguredProductResponse) SetConfiguration(v ConfiguredProductResponseConfiguration) { + o.Configuration = &v +} + +// GetLinks returns the Links field value if set, zero value otherwise. +func (o *ConfiguredProductResponse) GetLinks() ConfiguredProductResponseLinks { + if o == nil || o.Links == nil { + var ret ConfiguredProductResponseLinks + return ret + } + return *o.Links +} + +// GetLinksOk returns a tuple with the Links field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponse) GetLinksOk() (*ConfiguredProductResponseLinks, bool) { + if o == nil || o.Links == nil { + return nil, false + } + return o.Links, true +} + +// HasLinks returns a boolean if a field has been set. +func (o *ConfiguredProductResponse) HasLinks() bool { + if o != nil && o.Links != nil { + return true + } + + return false +} + +// SetLinks gets a reference to the given ConfiguredProductResponseLinks and assigns it to the Links field. +func (o *ConfiguredProductResponse) SetLinks(v ConfiguredProductResponseLinks) { + o.Links = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ConfiguredProductResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Product != nil { + toSerialize["product"] = o.Product + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + if o.Configuration != nil { + toSerialize["configuration"] = o.Configuration + } + if o.Links != nil { + toSerialize["_links"] = o.Links + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ConfiguredProductResponse) UnmarshalJSON(bytes []byte) (err error) { + varConfiguredProductResponse := _ConfiguredProductResponse{} + + if err = json.Unmarshal(bytes, &varConfiguredProductResponse); err == nil { + *o = ConfiguredProductResponse(varConfiguredProductResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "product") + delete(additionalProperties, "service") + delete(additionalProperties, "configuration") + delete(additionalProperties, "_links") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableConfiguredProductResponse is a helper abstraction for handling nullable configuredproductresponse types. +type NullableConfiguredProductResponse struct { + value *ConfiguredProductResponse + isSet bool +} + +// Get returns the value. +func (v NullableConfiguredProductResponse) Get() *ConfiguredProductResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableConfiguredProductResponse) Set(val *ConfiguredProductResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableConfiguredProductResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableConfiguredProductResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableConfiguredProductResponse returns a pointer to a new instance of NullableConfiguredProductResponse. +func NewNullableConfiguredProductResponse(val *ConfiguredProductResponse) *NullableConfiguredProductResponse { + return &NullableConfiguredProductResponse{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableConfiguredProductResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableConfiguredProductResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_configured_product_response__links.go b/fastly/model_configured_product_response__links.go new file mode 100644 index 0000000..a14a5a2 --- /dev/null +++ b/fastly/model_configured_product_response__links.go @@ -0,0 +1,194 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ConfiguredProductResponseLinks struct for ConfiguredProductResponseLinks +type ConfiguredProductResponseLinks struct { + // Location of resource + Self *string `json:"self,omitempty"` + // Location of the service resource + Service *string `json:"service,omitempty"` + AdditionalProperties map[string]any +} + +type _ConfiguredProductResponseLinks ConfiguredProductResponseLinks + +// NewConfiguredProductResponseLinks instantiates a new ConfiguredProductResponseLinks object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfiguredProductResponseLinks() *ConfiguredProductResponseLinks { + this := ConfiguredProductResponseLinks{} + return &this +} + +// NewConfiguredProductResponseLinksWithDefaults instantiates a new ConfiguredProductResponseLinks object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfiguredProductResponseLinksWithDefaults() *ConfiguredProductResponseLinks { + this := ConfiguredProductResponseLinks{} + return &this +} + +// GetSelf returns the Self field value if set, zero value otherwise. +func (o *ConfiguredProductResponseLinks) GetSelf() string { + if o == nil || o.Self == nil { + var ret string + return ret + } + return *o.Self +} + +// GetSelfOk returns a tuple with the Self field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponseLinks) GetSelfOk() (*string, bool) { + if o == nil || o.Self == nil { + return nil, false + } + return o.Self, true +} + +// HasSelf returns a boolean if a field has been set. +func (o *ConfiguredProductResponseLinks) HasSelf() bool { + if o != nil && o.Self != nil { + return true + } + + return false +} + +// SetSelf gets a reference to the given string and assigns it to the Self field. +func (o *ConfiguredProductResponseLinks) SetSelf(v string) { + o.Self = &v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *ConfiguredProductResponseLinks) GetService() string { + if o == nil || o.Service == nil { + var ret string + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponseLinks) GetServiceOk() (*string, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *ConfiguredProductResponseLinks) HasService() bool { + if o != nil && o.Service != nil { + return true + } + + return false +} + +// SetService gets a reference to the given string and assigns it to the Service field. +func (o *ConfiguredProductResponseLinks) SetService(v string) { + o.Service = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ConfiguredProductResponseLinks) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Self != nil { + toSerialize["self"] = o.Self + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ConfiguredProductResponseLinks) UnmarshalJSON(bytes []byte) (err error) { + varConfiguredProductResponseLinks := _ConfiguredProductResponseLinks{} + + if err = json.Unmarshal(bytes, &varConfiguredProductResponseLinks); err == nil { + *o = ConfiguredProductResponseLinks(varConfiguredProductResponseLinks) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "self") + delete(additionalProperties, "service") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableConfiguredProductResponseLinks is a helper abstraction for handling nullable configuredproductresponselinks types. +type NullableConfiguredProductResponseLinks struct { + value *ConfiguredProductResponseLinks + isSet bool +} + +// Get returns the value. +func (v NullableConfiguredProductResponseLinks) Get() *ConfiguredProductResponseLinks { + return v.value +} + +// Set modifies the value. +func (v *NullableConfiguredProductResponseLinks) Set(val *ConfiguredProductResponseLinks) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableConfiguredProductResponseLinks) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableConfiguredProductResponseLinks) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableConfiguredProductResponseLinks returns a pointer to a new instance of NullableConfiguredProductResponseLinks. +func NewNullableConfiguredProductResponseLinks(val *ConfiguredProductResponseLinks) *NullableConfiguredProductResponseLinks { + return &NullableConfiguredProductResponseLinks{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableConfiguredProductResponseLinks) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableConfiguredProductResponseLinks) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_configured_product_response_configuration.go b/fastly/model_configured_product_response_configuration.go new file mode 100644 index 0000000..6534cc6 --- /dev/null +++ b/fastly/model_configured_product_response_configuration.go @@ -0,0 +1,194 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ConfiguredProductResponseConfiguration struct for ConfiguredProductResponseConfiguration +type ConfiguredProductResponseConfiguration struct { + // Workspace ID + WorkspaceID *string `json:"workspace_id,omitempty"` + // Traffic ramp + TrafficRamp *string `json:"traffic_ramp,omitempty"` + AdditionalProperties map[string]any +} + +type _ConfiguredProductResponseConfiguration ConfiguredProductResponseConfiguration + +// NewConfiguredProductResponseConfiguration instantiates a new ConfiguredProductResponseConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfiguredProductResponseConfiguration() *ConfiguredProductResponseConfiguration { + this := ConfiguredProductResponseConfiguration{} + return &this +} + +// NewConfiguredProductResponseConfigurationWithDefaults instantiates a new ConfiguredProductResponseConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfiguredProductResponseConfigurationWithDefaults() *ConfiguredProductResponseConfiguration { + this := ConfiguredProductResponseConfiguration{} + return &this +} + +// GetWorkspaceID returns the WorkspaceID field value if set, zero value otherwise. +func (o *ConfiguredProductResponseConfiguration) GetWorkspaceID() string { + if o == nil || o.WorkspaceID == nil { + var ret string + return ret + } + return *o.WorkspaceID +} + +// GetWorkspaceIDOk returns a tuple with the WorkspaceID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponseConfiguration) GetWorkspaceIDOk() (*string, bool) { + if o == nil || o.WorkspaceID == nil { + return nil, false + } + return o.WorkspaceID, true +} + +// HasWorkspaceID returns a boolean if a field has been set. +func (o *ConfiguredProductResponseConfiguration) HasWorkspaceID() bool { + if o != nil && o.WorkspaceID != nil { + return true + } + + return false +} + +// SetWorkspaceID gets a reference to the given string and assigns it to the WorkspaceID field. +func (o *ConfiguredProductResponseConfiguration) SetWorkspaceID(v string) { + o.WorkspaceID = &v +} + +// GetTrafficRamp returns the TrafficRamp field value if set, zero value otherwise. +func (o *ConfiguredProductResponseConfiguration) GetTrafficRamp() string { + if o == nil || o.TrafficRamp == nil { + var ret string + return ret + } + return *o.TrafficRamp +} + +// GetTrafficRampOk returns a tuple with the TrafficRamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponseConfiguration) GetTrafficRampOk() (*string, bool) { + if o == nil || o.TrafficRamp == nil { + return nil, false + } + return o.TrafficRamp, true +} + +// HasTrafficRamp returns a boolean if a field has been set. +func (o *ConfiguredProductResponseConfiguration) HasTrafficRamp() bool { + if o != nil && o.TrafficRamp != nil { + return true + } + + return false +} + +// SetTrafficRamp gets a reference to the given string and assigns it to the TrafficRamp field. +func (o *ConfiguredProductResponseConfiguration) SetTrafficRamp(v string) { + o.TrafficRamp = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ConfiguredProductResponseConfiguration) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.WorkspaceID != nil { + toSerialize["workspace_id"] = o.WorkspaceID + } + if o.TrafficRamp != nil { + toSerialize["traffic_ramp"] = o.TrafficRamp + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ConfiguredProductResponseConfiguration) UnmarshalJSON(bytes []byte) (err error) { + varConfiguredProductResponseConfiguration := _ConfiguredProductResponseConfiguration{} + + if err = json.Unmarshal(bytes, &varConfiguredProductResponseConfiguration); err == nil { + *o = ConfiguredProductResponseConfiguration(varConfiguredProductResponseConfiguration) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "workspace_id") + delete(additionalProperties, "traffic_ramp") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableConfiguredProductResponseConfiguration is a helper abstraction for handling nullable configuredproductresponseconfiguration types. +type NullableConfiguredProductResponseConfiguration struct { + value *ConfiguredProductResponseConfiguration + isSet bool +} + +// Get returns the value. +func (v NullableConfiguredProductResponseConfiguration) Get() *ConfiguredProductResponseConfiguration { + return v.value +} + +// Set modifies the value. +func (v *NullableConfiguredProductResponseConfiguration) Set(val *ConfiguredProductResponseConfiguration) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableConfiguredProductResponseConfiguration) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableConfiguredProductResponseConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableConfiguredProductResponseConfiguration returns a pointer to a new instance of NullableConfiguredProductResponseConfiguration. +func NewNullableConfiguredProductResponseConfiguration(val *ConfiguredProductResponseConfiguration) *NullableConfiguredProductResponseConfiguration { + return &NullableConfiguredProductResponseConfiguration{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableConfiguredProductResponseConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableConfiguredProductResponseConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_configured_product_response_product.go b/fastly/model_configured_product_response_product.go new file mode 100644 index 0000000..da8f50c --- /dev/null +++ b/fastly/model_configured_product_response_product.go @@ -0,0 +1,194 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ConfiguredProductResponseProduct struct for ConfiguredProductResponseProduct +type ConfiguredProductResponseProduct struct { + // Product identifier + ID *string `json:"id,omitempty"` + // Name of the object + Object *string `json:"object,omitempty"` + AdditionalProperties map[string]any +} + +type _ConfiguredProductResponseProduct ConfiguredProductResponseProduct + +// NewConfiguredProductResponseProduct instantiates a new ConfiguredProductResponseProduct object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfiguredProductResponseProduct() *ConfiguredProductResponseProduct { + this := ConfiguredProductResponseProduct{} + return &this +} + +// NewConfiguredProductResponseProductWithDefaults instantiates a new ConfiguredProductResponseProduct object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfiguredProductResponseProductWithDefaults() *ConfiguredProductResponseProduct { + this := ConfiguredProductResponseProduct{} + return &this +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *ConfiguredProductResponseProduct) GetID() string { + if o == nil || o.ID == nil { + var ret string + return ret + } + return *o.ID +} + +// GetIDOk returns a tuple with the ID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponseProduct) GetIDOk() (*string, bool) { + if o == nil || o.ID == nil { + return nil, false + } + return o.ID, true +} + +// HasID returns a boolean if a field has been set. +func (o *ConfiguredProductResponseProduct) HasID() bool { + if o != nil && o.ID != nil { + return true + } + + return false +} + +// SetID gets a reference to the given string and assigns it to the ID field. +func (o *ConfiguredProductResponseProduct) SetID(v string) { + o.ID = &v +} + +// GetObject returns the Object field value if set, zero value otherwise. +func (o *ConfiguredProductResponseProduct) GetObject() string { + if o == nil || o.Object == nil { + var ret string + return ret + } + return *o.Object +} + +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfiguredProductResponseProduct) GetObjectOk() (*string, bool) { + if o == nil || o.Object == nil { + return nil, false + } + return o.Object, true +} + +// HasObject returns a boolean if a field has been set. +func (o *ConfiguredProductResponseProduct) HasObject() bool { + if o != nil && o.Object != nil { + return true + } + + return false +} + +// SetObject gets a reference to the given string and assigns it to the Object field. +func (o *ConfiguredProductResponseProduct) SetObject(v string) { + o.Object = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ConfiguredProductResponseProduct) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.ID != nil { + toSerialize["id"] = o.ID + } + if o.Object != nil { + toSerialize["object"] = o.Object + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ConfiguredProductResponseProduct) UnmarshalJSON(bytes []byte) (err error) { + varConfiguredProductResponseProduct := _ConfiguredProductResponseProduct{} + + if err = json.Unmarshal(bytes, &varConfiguredProductResponseProduct); err == nil { + *o = ConfiguredProductResponseProduct(varConfiguredProductResponseProduct) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "object") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableConfiguredProductResponseProduct is a helper abstraction for handling nullable configuredproductresponseproduct types. +type NullableConfiguredProductResponseProduct struct { + value *ConfiguredProductResponseProduct + isSet bool +} + +// Get returns the value. +func (v NullableConfiguredProductResponseProduct) Get() *ConfiguredProductResponseProduct { + return v.value +} + +// Set modifies the value. +func (v *NullableConfiguredProductResponseProduct) Set(val *ConfiguredProductResponseProduct) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableConfiguredProductResponseProduct) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableConfiguredProductResponseProduct) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableConfiguredProductResponseProduct returns a pointer to a new instance of NullableConfiguredProductResponseProduct. +func NewNullableConfiguredProductResponseProduct(val *ConfiguredProductResponseProduct) *NullableConfiguredProductResponseProduct { + return &NullableConfiguredProductResponseProduct{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableConfiguredProductResponseProduct) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableConfiguredProductResponseProduct) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_customer_address.go b/fastly/model_customer_address.go new file mode 100644 index 0000000..159205b --- /dev/null +++ b/fastly/model_customer_address.go @@ -0,0 +1,384 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// CustomerAddress struct for CustomerAddress +type CustomerAddress struct { + // The type of the address. + Type *string `json:"type,omitempty"` + // The street number and name of the address. + Address1 *string `json:"address_1,omitempty"` + // Additional address line for unit number, P.O. Box, etc. + Address2 *string `json:"address_2,omitempty"` + // City, town, or locality name the address is located. + Locality *string `json:"locality,omitempty"` + // State, province, or region of the address. + Region *string `json:"region,omitempty"` + // ISO 3166-1 alpha-2 country code (e.g., \"US\", \"CA\", \"NZ\") + Country *string `json:"country,omitempty"` + // Postal or Zip code of the address. + PostalCode *string `json:"postal_code,omitempty"` + AdditionalProperties map[string]any +} + +type _CustomerAddress CustomerAddress + +// NewCustomerAddress instantiates a new CustomerAddress object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCustomerAddress() *CustomerAddress { + this := CustomerAddress{} + return &this +} + +// NewCustomerAddressWithDefaults instantiates a new CustomerAddress object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCustomerAddressWithDefaults() *CustomerAddress { + this := CustomerAddress{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CustomerAddress) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomerAddress) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CustomerAddress) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CustomerAddress) SetType(v string) { + o.Type = &v +} + +// GetAddress1 returns the Address1 field value if set, zero value otherwise. +func (o *CustomerAddress) GetAddress1() string { + if o == nil || o.Address1 == nil { + var ret string + return ret + } + return *o.Address1 +} + +// GetAddress1Ok returns a tuple with the Address1 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomerAddress) GetAddress1Ok() (*string, bool) { + if o == nil || o.Address1 == nil { + return nil, false + } + return o.Address1, true +} + +// HasAddress1 returns a boolean if a field has been set. +func (o *CustomerAddress) HasAddress1() bool { + if o != nil && o.Address1 != nil { + return true + } + + return false +} + +// SetAddress1 gets a reference to the given string and assigns it to the Address1 field. +func (o *CustomerAddress) SetAddress1(v string) { + o.Address1 = &v +} + +// GetAddress2 returns the Address2 field value if set, zero value otherwise. +func (o *CustomerAddress) GetAddress2() string { + if o == nil || o.Address2 == nil { + var ret string + return ret + } + return *o.Address2 +} + +// GetAddress2Ok returns a tuple with the Address2 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomerAddress) GetAddress2Ok() (*string, bool) { + if o == nil || o.Address2 == nil { + return nil, false + } + return o.Address2, true +} + +// HasAddress2 returns a boolean if a field has been set. +func (o *CustomerAddress) HasAddress2() bool { + if o != nil && o.Address2 != nil { + return true + } + + return false +} + +// SetAddress2 gets a reference to the given string and assigns it to the Address2 field. +func (o *CustomerAddress) SetAddress2(v string) { + o.Address2 = &v +} + +// GetLocality returns the Locality field value if set, zero value otherwise. +func (o *CustomerAddress) GetLocality() string { + if o == nil || o.Locality == nil { + var ret string + return ret + } + return *o.Locality +} + +// GetLocalityOk returns a tuple with the Locality field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomerAddress) GetLocalityOk() (*string, bool) { + if o == nil || o.Locality == nil { + return nil, false + } + return o.Locality, true +} + +// HasLocality returns a boolean if a field has been set. +func (o *CustomerAddress) HasLocality() bool { + if o != nil && o.Locality != nil { + return true + } + + return false +} + +// SetLocality gets a reference to the given string and assigns it to the Locality field. +func (o *CustomerAddress) SetLocality(v string) { + o.Locality = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *CustomerAddress) GetRegion() string { + if o == nil || o.Region == nil { + var ret string + return ret + } + return *o.Region +} + +// GetRegionOk returns a tuple with the Region field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomerAddress) GetRegionOk() (*string, bool) { + if o == nil || o.Region == nil { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *CustomerAddress) HasRegion() bool { + if o != nil && o.Region != nil { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *CustomerAddress) SetRegion(v string) { + o.Region = &v +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *CustomerAddress) GetCountry() string { + if o == nil || o.Country == nil { + var ret string + return ret + } + return *o.Country +} + +// GetCountryOk returns a tuple with the Country field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomerAddress) GetCountryOk() (*string, bool) { + if o == nil || o.Country == nil { + return nil, false + } + return o.Country, true +} + +// HasCountry returns a boolean if a field has been set. +func (o *CustomerAddress) HasCountry() bool { + if o != nil && o.Country != nil { + return true + } + + return false +} + +// SetCountry gets a reference to the given string and assigns it to the Country field. +func (o *CustomerAddress) SetCountry(v string) { + o.Country = &v +} + +// GetPostalCode returns the PostalCode field value if set, zero value otherwise. +func (o *CustomerAddress) GetPostalCode() string { + if o == nil || o.PostalCode == nil { + var ret string + return ret + } + return *o.PostalCode +} + +// GetPostalCodeOk returns a tuple with the PostalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomerAddress) GetPostalCodeOk() (*string, bool) { + if o == nil || o.PostalCode == nil { + return nil, false + } + return o.PostalCode, true +} + +// HasPostalCode returns a boolean if a field has been set. +func (o *CustomerAddress) HasPostalCode() bool { + if o != nil && o.PostalCode != nil { + return true + } + + return false +} + +// SetPostalCode gets a reference to the given string and assigns it to the PostalCode field. +func (o *CustomerAddress) SetPostalCode(v string) { + o.PostalCode = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o CustomerAddress) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Address1 != nil { + toSerialize["address_1"] = o.Address1 + } + if o.Address2 != nil { + toSerialize["address_2"] = o.Address2 + } + if o.Locality != nil { + toSerialize["locality"] = o.Locality + } + if o.Region != nil { + toSerialize["region"] = o.Region + } + if o.Country != nil { + toSerialize["country"] = o.Country + } + if o.PostalCode != nil { + toSerialize["postal_code"] = o.PostalCode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *CustomerAddress) UnmarshalJSON(bytes []byte) (err error) { + varCustomerAddress := _CustomerAddress{} + + if err = json.Unmarshal(bytes, &varCustomerAddress); err == nil { + *o = CustomerAddress(varCustomerAddress) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "address_1") + delete(additionalProperties, "address_2") + delete(additionalProperties, "locality") + delete(additionalProperties, "region") + delete(additionalProperties, "country") + delete(additionalProperties, "postal_code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableCustomerAddress is a helper abstraction for handling nullable customeraddress types. +type NullableCustomerAddress struct { + value *CustomerAddress + isSet bool +} + +// Get returns the value. +func (v NullableCustomerAddress) Get() *CustomerAddress { + return v.value +} + +// Set modifies the value. +func (v *NullableCustomerAddress) Set(val *CustomerAddress) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableCustomerAddress) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableCustomerAddress) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableCustomerAddress returns a pointer to a new instance of NullableCustomerAddress. +func NewNullableCustomerAddress(val *CustomerAddress) *NullableCustomerAddress { + return &NullableCustomerAddress{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableCustomerAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableCustomerAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_domain_inspector.go b/fastly/model_domain_inspector.go index 701b9ab..c802f1e 100644 --- a/fastly/model_domain_inspector.go +++ b/fastly/model_domain_inspector.go @@ -19,7 +19,8 @@ import ( // DomainInspector struct for DomainInspector type DomainInspector struct { - Timestamp *SubsequentRequestTimestamp `json:"Timestamp,omitempty"` + // Value to use for subsequent requests. + Timestamp *int32 `json:"Timestamp,omitempty"` // Offset of entry timestamps from the current time due to processing time. AggregateDelay *int32 `json:"AggregateDelay,omitempty"` // A list of report [entries](#entry-data-model), each representing one second of time. @@ -47,9 +48,9 @@ func NewDomainInspectorWithDefaults() *DomainInspector { } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *DomainInspector) GetTimestamp() SubsequentRequestTimestamp { +func (o *DomainInspector) GetTimestamp() int32 { if o == nil || o.Timestamp == nil { - var ret SubsequentRequestTimestamp + var ret int32 return ret } return *o.Timestamp @@ -57,7 +58,7 @@ func (o *DomainInspector) GetTimestamp() SubsequentRequestTimestamp { // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DomainInspector) GetTimestampOk() (*SubsequentRequestTimestamp, bool) { +func (o *DomainInspector) GetTimestampOk() (*int32, bool) { if o == nil || o.Timestamp == nil { return nil, false } @@ -73,8 +74,8 @@ func (o *DomainInspector) HasTimestamp() bool { return false } -// SetTimestamp gets a reference to the given SubsequentRequestTimestamp and assigns it to the Timestamp field. -func (o *DomainInspector) SetTimestamp(v SubsequentRequestTimestamp) { +// SetTimestamp gets a reference to the given int32 and assigns it to the Timestamp field. +func (o *DomainInspector) SetTimestamp(v int32) { o.Timestamp = &v } diff --git a/fastly/model_domain_inspector_realtime_entry.go b/fastly/model_domain_inspector_realtime_entry.go index 9887e00..2782403 100644 --- a/fastly/model_domain_inspector_realtime_entry.go +++ b/fastly/model_domain_inspector_realtime_entry.go @@ -19,7 +19,8 @@ import ( // DomainInspectorRealtimeEntry Each reporting period is represented by an entry in the `Data` property of the top level response and provides access to [measurement data](#measurements-data-model) for that time period, grouped in various ways: by domain name, domain IP address, and optionally by POP. The `datacenter` property organizes the measurements by Fastly POP, while the `aggregated` property combines the measurements of all POPs (but still splits by backend name and IP). type DomainInspectorRealtimeEntry struct { - Recorded *RecordedTimestamp `json:"recorded,omitempty"` + // The Unix timestamp at which this record's data was generated. + Recorded *int32 `json:"recorded,omitempty"` // Groups [measurements](#measurements-data-model) by backend name and then by IP address. Aggregated map[string]DomainInspectorMeasurements `json:"aggregated,omitempty"` // Groups [measurements](#measurements-data-model) by POP, then backend name, and then IP address. See the [POPs API](https://www.fastly.com/documentation/reference/api/utils/pops/) for details about POP identifiers. @@ -47,9 +48,9 @@ func NewDomainInspectorRealtimeEntryWithDefaults() *DomainInspectorRealtimeEntry } // GetRecorded returns the Recorded field value if set, zero value otherwise. -func (o *DomainInspectorRealtimeEntry) GetRecorded() RecordedTimestamp { +func (o *DomainInspectorRealtimeEntry) GetRecorded() int32 { if o == nil || o.Recorded == nil { - var ret RecordedTimestamp + var ret int32 return ret } return *o.Recorded @@ -57,7 +58,7 @@ func (o *DomainInspectorRealtimeEntry) GetRecorded() RecordedTimestamp { // GetRecordedOk returns a tuple with the Recorded field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DomainInspectorRealtimeEntry) GetRecordedOk() (*RecordedTimestamp, bool) { +func (o *DomainInspectorRealtimeEntry) GetRecordedOk() (*int32, bool) { if o == nil || o.Recorded == nil { return nil, false } @@ -73,8 +74,8 @@ func (o *DomainInspectorRealtimeEntry) HasRecorded() bool { return false } -// SetRecorded gets a reference to the given RecordedTimestamp and assigns it to the Recorded field. -func (o *DomainInspectorRealtimeEntry) SetRecorded(v RecordedTimestamp) { +// SetRecorded gets a reference to the given int32 and assigns it to the Recorded field. +func (o *DomainInspectorRealtimeEntry) SetRecorded(v int32) { o.Recorded = &v } diff --git a/fastly/model_environment.go b/fastly/model_environment.go new file mode 100644 index 0000000..e8fdd78 --- /dev/null +++ b/fastly/model_environment.go @@ -0,0 +1,230 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// Environment struct for Environment +type Environment struct { + Name *string `json:"name,omitempty"` + // Alphanumeric string identifying the service. + ServiceID *string `json:"service_id,omitempty"` + ActiveVersion *int32 `json:"active_version,omitempty"` + AdditionalProperties map[string]any +} + +type _Environment Environment + +// NewEnvironment instantiates a new Environment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnvironment() *Environment { + this := Environment{} + return &this +} + +// NewEnvironmentWithDefaults instantiates a new Environment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnvironmentWithDefaults() *Environment { + this := Environment{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Environment) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Environment) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Environment) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Environment) SetName(v string) { + o.Name = &v +} + +// GetServiceID returns the ServiceID field value if set, zero value otherwise. +func (o *Environment) GetServiceID() string { + if o == nil || o.ServiceID == nil { + var ret string + return ret + } + return *o.ServiceID +} + +// GetServiceIDOk returns a tuple with the ServiceID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Environment) GetServiceIDOk() (*string, bool) { + if o == nil || o.ServiceID == nil { + return nil, false + } + return o.ServiceID, true +} + +// HasServiceID returns a boolean if a field has been set. +func (o *Environment) HasServiceID() bool { + if o != nil && o.ServiceID != nil { + return true + } + + return false +} + +// SetServiceID gets a reference to the given string and assigns it to the ServiceID field. +func (o *Environment) SetServiceID(v string) { + o.ServiceID = &v +} + +// GetActiveVersion returns the ActiveVersion field value if set, zero value otherwise. +func (o *Environment) GetActiveVersion() int32 { + if o == nil || o.ActiveVersion == nil { + var ret int32 + return ret + } + return *o.ActiveVersion +} + +// GetActiveVersionOk returns a tuple with the ActiveVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Environment) GetActiveVersionOk() (*int32, bool) { + if o == nil || o.ActiveVersion == nil { + return nil, false + } + return o.ActiveVersion, true +} + +// HasActiveVersion returns a boolean if a field has been set. +func (o *Environment) HasActiveVersion() bool { + if o != nil && o.ActiveVersion != nil { + return true + } + + return false +} + +// SetActiveVersion gets a reference to the given int32 and assigns it to the ActiveVersion field. +func (o *Environment) SetActiveVersion(v int32) { + o.ActiveVersion = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o Environment) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.ServiceID != nil { + toSerialize["service_id"] = o.ServiceID + } + if o.ActiveVersion != nil { + toSerialize["active_version"] = o.ActiveVersion + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *Environment) UnmarshalJSON(bytes []byte) (err error) { + varEnvironment := _Environment{} + + if err = json.Unmarshal(bytes, &varEnvironment); err == nil { + *o = Environment(varEnvironment) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "service_id") + delete(additionalProperties, "active_version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableEnvironment is a helper abstraction for handling nullable environment types. +type NullableEnvironment struct { + value *Environment + isSet bool +} + +// Get returns the value. +func (v NullableEnvironment) Get() *Environment { + return v.value +} + +// Set modifies the value. +func (v *NullableEnvironment) Set(val *Environment) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableEnvironment) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableEnvironment) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableEnvironment returns a pointer to a new instance of NullableEnvironment. +func NewNullableEnvironment(val *Environment) *NullableEnvironment { + return &NullableEnvironment{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableEnvironment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableEnvironment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_environment_name.go b/fastly/model_environment_name.go new file mode 100644 index 0000000..0ce2cef --- /dev/null +++ b/fastly/model_environment_name.go @@ -0,0 +1,122 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" + "fmt" +) + +// EnvironmentName the model 'EnvironmentName' +type EnvironmentName string + +// List of environment_name +const ( + ENVIRONMENTNAME_STAGING EnvironmentName = "staging" +) + +// AllowedEnvironmentNameEnumValues All allowed values of EnvironmentName enum +var AllowedEnvironmentNameEnumValues = []EnvironmentName{ + "staging", +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *EnvironmentName) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EnvironmentName(value) + for _, existing := range AllowedEnvironmentNameEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EnvironmentName", value) +} + +// NewEnvironmentNameFromValue returns a pointer to a valid EnvironmentName +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEnvironmentNameFromValue(v string) (*EnvironmentName, error) { + ev := EnvironmentName(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for EnvironmentName: valid values are %v", v, AllowedEnvironmentNameEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EnvironmentName) IsValid() bool { + for _, existing := range AllowedEnvironmentNameEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to environment_name value +func (v EnvironmentName) Ptr() *EnvironmentName { + return &v +} + +// NullableEnvironmentName is a helper abstraction for handling nullable environmentname types. +type NullableEnvironmentName struct { + value *EnvironmentName + isSet bool +} + +// Get returns the value. +func (v NullableEnvironmentName) Get() *EnvironmentName { + return v.value +} + +// Set modifies the value. +func (v *NullableEnvironmentName) Set(val *EnvironmentName) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableEnvironmentName) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableEnvironmentName) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableEnvironmentName returns a pointer to a new instance of NullableEnvironmentName. +func NewNullableEnvironmentName(val *EnvironmentName) *NullableEnvironmentName { + return &NullableEnvironmentName{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableEnvironmentName) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableEnvironmentName) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_inline_response_201.go b/fastly/model_inline_response_201.go new file mode 100644 index 0000000..fecd1ff --- /dev/null +++ b/fastly/model_inline_response_201.go @@ -0,0 +1,156 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// InlineResponse201 struct for InlineResponse201 +type InlineResponse201 struct { + // Alphanumeric string identifying the address. + ID *string `json:"id,omitempty"` + AdditionalProperties map[string]any +} + +type _InlineResponse201 InlineResponse201 + +// NewInlineResponse201 instantiates a new InlineResponse201 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse201() *InlineResponse201 { + this := InlineResponse201{} + return &this +} + +// NewInlineResponse201WithDefaults instantiates a new InlineResponse201 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse201WithDefaults() *InlineResponse201 { + this := InlineResponse201{} + return &this +} + +// GetID returns the ID field value if set, zero value otherwise. +func (o *InlineResponse201) GetID() string { + if o == nil || o.ID == nil { + var ret string + return ret + } + return *o.ID +} + +// GetIDOk returns a tuple with the ID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponse201) GetIDOk() (*string, bool) { + if o == nil || o.ID == nil { + return nil, false + } + return o.ID, true +} + +// HasID returns a boolean if a field has been set. +func (o *InlineResponse201) HasID() bool { + if o != nil && o.ID != nil { + return true + } + + return false +} + +// SetID gets a reference to the given string and assigns it to the ID field. +func (o *InlineResponse201) SetID(v string) { + o.ID = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o InlineResponse201) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.ID != nil { + toSerialize["id"] = o.ID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *InlineResponse201) UnmarshalJSON(bytes []byte) (err error) { + varInlineResponse201 := _InlineResponse201{} + + if err = json.Unmarshal(bytes, &varInlineResponse201); err == nil { + *o = InlineResponse201(varInlineResponse201) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableInlineResponse201 is a helper abstraction for handling nullable inlineresponse201 types. +type NullableInlineResponse201 struct { + value *InlineResponse201 + isSet bool +} + +// Get returns the value. +func (v NullableInlineResponse201) Get() *InlineResponse201 { + return v.value +} + +// Set modifies the value. +func (v *NullableInlineResponse201) Set(val *InlineResponse201) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableInlineResponse201) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableInlineResponse201) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableInlineResponse201 returns a pointer to a new instance of NullableInlineResponse201. +func NewNullableInlineResponse201(val *InlineResponse201) *NullableInlineResponse201 { + return &NullableInlineResponse201{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableInlineResponse201) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableInlineResponse201) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_line_item_data.go b/fastly/model_line_item_data.go index 1976648..468a3ee 100644 --- a/fastly/model_line_item_data.go +++ b/fastly/model_line_item_data.go @@ -19,22 +19,22 @@ import ( // LineItemData struct for LineItemData type LineItemData struct { - Amount *float32 `json:"amount,omitempty"` + Amount NullableFloat32 `json:"amount,omitempty"` // An alphanumeric string identifying the invoice. - AriaInvoiceID *string `json:"aria_invoice_id,omitempty"` - ClientServiceID *string `json:"client_service_id,omitempty"` + AriaInvoiceID NullableString `json:"aria_invoice_id,omitempty"` + ClientServiceID NullableString `json:"client_service_id,omitempty"` CreditCouponCode NullableString `json:"credit_coupon_code,omitempty"` - Description *string `json:"description,omitempty"` + Description NullableString `json:"description,omitempty"` ID *string `json:"id,omitempty"` - LineNumber *int32 `json:"line_number,omitempty"` - PlanName *string `json:"plan_name,omitempty"` - PlanNo *float32 `json:"plan_no,omitempty"` + LineNumber NullableInt32 `json:"line_number,omitempty"` + PlanName NullableString `json:"plan_name,omitempty"` + PlanNo NullableFloat32 `json:"plan_no,omitempty"` RatePerUnit NullableFloat32 `json:"rate_per_unit,omitempty"` RateScheduleNo NullableFloat32 `json:"rate_schedule_no,omitempty"` RateScheduleTierNo NullableFloat32 `json:"rate_schedule_tier_no,omitempty"` - ServiceName *string `json:"service_name,omitempty"` - ServiceNo *float32 `json:"service_no,omitempty"` - Units *float32 `json:"units,omitempty"` + ServiceName NullableString `json:"service_name,omitempty"` + ServiceNo NullableFloat32 `json:"service_no,omitempty"` + Units NullableFloat32 `json:"units,omitempty"` UsageTypeCd NullableString `json:"usage_type_cd,omitempty"` UsageTypeNo NullableFloat32 `json:"usage_type_no,omitempty"` AdditionalProperties map[string]any @@ -59,100 +59,130 @@ func NewLineItemDataWithDefaults() *LineItemData { return &this } -// GetAmount returns the Amount field value if set, zero value otherwise. +// GetAmount returns the Amount field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetAmount() float32 { - if o == nil || o.Amount == nil { + if o == nil || o.Amount.Get() == nil { var ret float32 return ret } - return *o.Amount + return *o.Amount.Get() } // GetAmountOk returns a tuple with the Amount field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetAmountOk() (*float32, bool) { - if o == nil || o.Amount == nil { + if o == nil { return nil, false } - return o.Amount, true + return o.Amount.Get(), o.Amount.IsSet() } // HasAmount returns a boolean if a field has been set. func (o *LineItemData) HasAmount() bool { - if o != nil && o.Amount != nil { + if o != nil && o.Amount.IsSet() { return true } return false } -// SetAmount gets a reference to the given float32 and assigns it to the Amount field. +// SetAmount gets a reference to the given NullableFloat32 and assigns it to the Amount field. func (o *LineItemData) SetAmount(v float32) { - o.Amount = &v + o.Amount.Set(&v) +} +// SetAmountNil sets the value for Amount to be an explicit nil +func (o *LineItemData) SetAmountNil() { + o.Amount.Set(nil) } -// GetAriaInvoiceID returns the AriaInvoiceID field value if set, zero value otherwise. +// UnsetAmount ensures that no value is present for Amount, not even an explicit nil +func (o *LineItemData) UnsetAmount() { + o.Amount.Unset() +} + +// GetAriaInvoiceID returns the AriaInvoiceID field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetAriaInvoiceID() string { - if o == nil || o.AriaInvoiceID == nil { + if o == nil || o.AriaInvoiceID.Get() == nil { var ret string return ret } - return *o.AriaInvoiceID + return *o.AriaInvoiceID.Get() } // GetAriaInvoiceIDOk returns a tuple with the AriaInvoiceID field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetAriaInvoiceIDOk() (*string, bool) { - if o == nil || o.AriaInvoiceID == nil { + if o == nil { return nil, false } - return o.AriaInvoiceID, true + return o.AriaInvoiceID.Get(), o.AriaInvoiceID.IsSet() } // HasAriaInvoiceID returns a boolean if a field has been set. func (o *LineItemData) HasAriaInvoiceID() bool { - if o != nil && o.AriaInvoiceID != nil { + if o != nil && o.AriaInvoiceID.IsSet() { return true } return false } -// SetAriaInvoiceID gets a reference to the given string and assigns it to the AriaInvoiceID field. +// SetAriaInvoiceID gets a reference to the given NullableString and assigns it to the AriaInvoiceID field. func (o *LineItemData) SetAriaInvoiceID(v string) { - o.AriaInvoiceID = &v + o.AriaInvoiceID.Set(&v) +} +// SetAriaInvoiceIDNil sets the value for AriaInvoiceID to be an explicit nil +func (o *LineItemData) SetAriaInvoiceIDNil() { + o.AriaInvoiceID.Set(nil) +} + +// UnsetAriaInvoiceID ensures that no value is present for AriaInvoiceID, not even an explicit nil +func (o *LineItemData) UnsetAriaInvoiceID() { + o.AriaInvoiceID.Unset() } -// GetClientServiceID returns the ClientServiceID field value if set, zero value otherwise. +// GetClientServiceID returns the ClientServiceID field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetClientServiceID() string { - if o == nil || o.ClientServiceID == nil { + if o == nil || o.ClientServiceID.Get() == nil { var ret string return ret } - return *o.ClientServiceID + return *o.ClientServiceID.Get() } // GetClientServiceIDOk returns a tuple with the ClientServiceID field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetClientServiceIDOk() (*string, bool) { - if o == nil || o.ClientServiceID == nil { + if o == nil { return nil, false } - return o.ClientServiceID, true + return o.ClientServiceID.Get(), o.ClientServiceID.IsSet() } // HasClientServiceID returns a boolean if a field has been set. func (o *LineItemData) HasClientServiceID() bool { - if o != nil && o.ClientServiceID != nil { + if o != nil && o.ClientServiceID.IsSet() { return true } return false } -// SetClientServiceID gets a reference to the given string and assigns it to the ClientServiceID field. +// SetClientServiceID gets a reference to the given NullableString and assigns it to the ClientServiceID field. func (o *LineItemData) SetClientServiceID(v string) { - o.ClientServiceID = &v + o.ClientServiceID.Set(&v) +} +// SetClientServiceIDNil sets the value for ClientServiceID to be an explicit nil +func (o *LineItemData) SetClientServiceIDNil() { + o.ClientServiceID.Set(nil) +} + +// UnsetClientServiceID ensures that no value is present for ClientServiceID, not even an explicit nil +func (o *LineItemData) UnsetClientServiceID() { + o.ClientServiceID.Unset() } // GetCreditCouponCode returns the CreditCouponCode field value if set, zero value otherwise (both if not set or set to explicit null). @@ -197,36 +227,46 @@ func (o *LineItemData) UnsetCreditCouponCode() { o.CreditCouponCode.Unset() } -// GetDescription returns the Description field value if set, zero value otherwise. +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetDescription() string { - if o == nil || o.Description == nil { + if o == nil || o.Description.Get() == nil { var ret string return ret } - return *o.Description + return *o.Description.Get() } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { + if o == nil { return nil, false } - return o.Description, true + return o.Description.Get(), o.Description.IsSet() } // HasDescription returns a boolean if a field has been set. func (o *LineItemData) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && o.Description.IsSet() { return true } return false } -// SetDescription gets a reference to the given string and assigns it to the Description field. +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. func (o *LineItemData) SetDescription(v string) { - o.Description = &v + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *LineItemData) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *LineItemData) UnsetDescription() { + o.Description.Unset() } // GetID returns the ID field value if set, zero value otherwise. @@ -261,100 +301,130 @@ func (o *LineItemData) SetID(v string) { o.ID = &v } -// GetLineNumber returns the LineNumber field value if set, zero value otherwise. +// GetLineNumber returns the LineNumber field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetLineNumber() int32 { - if o == nil || o.LineNumber == nil { + if o == nil || o.LineNumber.Get() == nil { var ret int32 return ret } - return *o.LineNumber + return *o.LineNumber.Get() } // GetLineNumberOk returns a tuple with the LineNumber field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetLineNumberOk() (*int32, bool) { - if o == nil || o.LineNumber == nil { + if o == nil { return nil, false } - return o.LineNumber, true + return o.LineNumber.Get(), o.LineNumber.IsSet() } // HasLineNumber returns a boolean if a field has been set. func (o *LineItemData) HasLineNumber() bool { - if o != nil && o.LineNumber != nil { + if o != nil && o.LineNumber.IsSet() { return true } return false } -// SetLineNumber gets a reference to the given int32 and assigns it to the LineNumber field. +// SetLineNumber gets a reference to the given NullableInt32 and assigns it to the LineNumber field. func (o *LineItemData) SetLineNumber(v int32) { - o.LineNumber = &v + o.LineNumber.Set(&v) +} +// SetLineNumberNil sets the value for LineNumber to be an explicit nil +func (o *LineItemData) SetLineNumberNil() { + o.LineNumber.Set(nil) +} + +// UnsetLineNumber ensures that no value is present for LineNumber, not even an explicit nil +func (o *LineItemData) UnsetLineNumber() { + o.LineNumber.Unset() } -// GetPlanName returns the PlanName field value if set, zero value otherwise. +// GetPlanName returns the PlanName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetPlanName() string { - if o == nil || o.PlanName == nil { + if o == nil || o.PlanName.Get() == nil { var ret string return ret } - return *o.PlanName + return *o.PlanName.Get() } // GetPlanNameOk returns a tuple with the PlanName field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetPlanNameOk() (*string, bool) { - if o == nil || o.PlanName == nil { + if o == nil { return nil, false } - return o.PlanName, true + return o.PlanName.Get(), o.PlanName.IsSet() } // HasPlanName returns a boolean if a field has been set. func (o *LineItemData) HasPlanName() bool { - if o != nil && o.PlanName != nil { + if o != nil && o.PlanName.IsSet() { return true } return false } -// SetPlanName gets a reference to the given string and assigns it to the PlanName field. +// SetPlanName gets a reference to the given NullableString and assigns it to the PlanName field. func (o *LineItemData) SetPlanName(v string) { - o.PlanName = &v + o.PlanName.Set(&v) +} +// SetPlanNameNil sets the value for PlanName to be an explicit nil +func (o *LineItemData) SetPlanNameNil() { + o.PlanName.Set(nil) } -// GetPlanNo returns the PlanNo field value if set, zero value otherwise. +// UnsetPlanName ensures that no value is present for PlanName, not even an explicit nil +func (o *LineItemData) UnsetPlanName() { + o.PlanName.Unset() +} + +// GetPlanNo returns the PlanNo field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetPlanNo() float32 { - if o == nil || o.PlanNo == nil { + if o == nil || o.PlanNo.Get() == nil { var ret float32 return ret } - return *o.PlanNo + return *o.PlanNo.Get() } // GetPlanNoOk returns a tuple with the PlanNo field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetPlanNoOk() (*float32, bool) { - if o == nil || o.PlanNo == nil { + if o == nil { return nil, false } - return o.PlanNo, true + return o.PlanNo.Get(), o.PlanNo.IsSet() } // HasPlanNo returns a boolean if a field has been set. func (o *LineItemData) HasPlanNo() bool { - if o != nil && o.PlanNo != nil { + if o != nil && o.PlanNo.IsSet() { return true } return false } -// SetPlanNo gets a reference to the given float32 and assigns it to the PlanNo field. +// SetPlanNo gets a reference to the given NullableFloat32 and assigns it to the PlanNo field. func (o *LineItemData) SetPlanNo(v float32) { - o.PlanNo = &v + o.PlanNo.Set(&v) +} +// SetPlanNoNil sets the value for PlanNo to be an explicit nil +func (o *LineItemData) SetPlanNoNil() { + o.PlanNo.Set(nil) +} + +// UnsetPlanNo ensures that no value is present for PlanNo, not even an explicit nil +func (o *LineItemData) UnsetPlanNo() { + o.PlanNo.Unset() } // GetRatePerUnit returns the RatePerUnit field value if set, zero value otherwise (both if not set or set to explicit null). @@ -483,100 +553,130 @@ func (o *LineItemData) UnsetRateScheduleTierNo() { o.RateScheduleTierNo.Unset() } -// GetServiceName returns the ServiceName field value if set, zero value otherwise. +// GetServiceName returns the ServiceName field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetServiceName() string { - if o == nil || o.ServiceName == nil { + if o == nil || o.ServiceName.Get() == nil { var ret string return ret } - return *o.ServiceName + return *o.ServiceName.Get() } // GetServiceNameOk returns a tuple with the ServiceName field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetServiceNameOk() (*string, bool) { - if o == nil || o.ServiceName == nil { + if o == nil { return nil, false } - return o.ServiceName, true + return o.ServiceName.Get(), o.ServiceName.IsSet() } // HasServiceName returns a boolean if a field has been set. func (o *LineItemData) HasServiceName() bool { - if o != nil && o.ServiceName != nil { + if o != nil && o.ServiceName.IsSet() { return true } return false } -// SetServiceName gets a reference to the given string and assigns it to the ServiceName field. +// SetServiceName gets a reference to the given NullableString and assigns it to the ServiceName field. func (o *LineItemData) SetServiceName(v string) { - o.ServiceName = &v + o.ServiceName.Set(&v) +} +// SetServiceNameNil sets the value for ServiceName to be an explicit nil +func (o *LineItemData) SetServiceNameNil() { + o.ServiceName.Set(nil) } -// GetServiceNo returns the ServiceNo field value if set, zero value otherwise. +// UnsetServiceName ensures that no value is present for ServiceName, not even an explicit nil +func (o *LineItemData) UnsetServiceName() { + o.ServiceName.Unset() +} + +// GetServiceNo returns the ServiceNo field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetServiceNo() float32 { - if o == nil || o.ServiceNo == nil { + if o == nil || o.ServiceNo.Get() == nil { var ret float32 return ret } - return *o.ServiceNo + return *o.ServiceNo.Get() } // GetServiceNoOk returns a tuple with the ServiceNo field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetServiceNoOk() (*float32, bool) { - if o == nil || o.ServiceNo == nil { + if o == nil { return nil, false } - return o.ServiceNo, true + return o.ServiceNo.Get(), o.ServiceNo.IsSet() } // HasServiceNo returns a boolean if a field has been set. func (o *LineItemData) HasServiceNo() bool { - if o != nil && o.ServiceNo != nil { + if o != nil && o.ServiceNo.IsSet() { return true } return false } -// SetServiceNo gets a reference to the given float32 and assigns it to the ServiceNo field. +// SetServiceNo gets a reference to the given NullableFloat32 and assigns it to the ServiceNo field. func (o *LineItemData) SetServiceNo(v float32) { - o.ServiceNo = &v + o.ServiceNo.Set(&v) +} +// SetServiceNoNil sets the value for ServiceNo to be an explicit nil +func (o *LineItemData) SetServiceNoNil() { + o.ServiceNo.Set(nil) +} + +// UnsetServiceNo ensures that no value is present for ServiceNo, not even an explicit nil +func (o *LineItemData) UnsetServiceNo() { + o.ServiceNo.Unset() } -// GetUnits returns the Units field value if set, zero value otherwise. +// GetUnits returns the Units field value if set, zero value otherwise (both if not set or set to explicit null). func (o *LineItemData) GetUnits() float32 { - if o == nil || o.Units == nil { + if o == nil || o.Units.Get() == nil { var ret float32 return ret } - return *o.Units + return *o.Units.Get() } // GetUnitsOk returns a tuple with the Units field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *LineItemData) GetUnitsOk() (*float32, bool) { - if o == nil || o.Units == nil { + if o == nil { return nil, false } - return o.Units, true + return o.Units.Get(), o.Units.IsSet() } // HasUnits returns a boolean if a field has been set. func (o *LineItemData) HasUnits() bool { - if o != nil && o.Units != nil { + if o != nil && o.Units.IsSet() { return true } return false } -// SetUnits gets a reference to the given float32 and assigns it to the Units field. +// SetUnits gets a reference to the given NullableFloat32 and assigns it to the Units field. func (o *LineItemData) SetUnits(v float32) { - o.Units = &v + o.Units.Set(&v) +} +// SetUnitsNil sets the value for Units to be an explicit nil +func (o *LineItemData) SetUnitsNil() { + o.Units.Set(nil) +} + +// UnsetUnits ensures that no value is present for Units, not even an explicit nil +func (o *LineItemData) UnsetUnits() { + o.Units.Unset() } // GetUsageTypeCd returns the UsageTypeCd field value if set, zero value otherwise (both if not set or set to explicit null). @@ -667,32 +767,32 @@ func (o *LineItemData) UnsetUsageTypeNo() { // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o LineItemData) MarshalJSON() ([]byte, error) { toSerialize := map[string]any{} - if o.Amount != nil { - toSerialize["amount"] = o.Amount + if o.Amount.IsSet() { + toSerialize["amount"] = o.Amount.Get() } - if o.AriaInvoiceID != nil { - toSerialize["aria_invoice_id"] = o.AriaInvoiceID + if o.AriaInvoiceID.IsSet() { + toSerialize["aria_invoice_id"] = o.AriaInvoiceID.Get() } - if o.ClientServiceID != nil { - toSerialize["client_service_id"] = o.ClientServiceID + if o.ClientServiceID.IsSet() { + toSerialize["client_service_id"] = o.ClientServiceID.Get() } if o.CreditCouponCode.IsSet() { toSerialize["credit_coupon_code"] = o.CreditCouponCode.Get() } - if o.Description != nil { - toSerialize["description"] = o.Description + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() } if o.ID != nil { toSerialize["id"] = o.ID } - if o.LineNumber != nil { - toSerialize["line_number"] = o.LineNumber + if o.LineNumber.IsSet() { + toSerialize["line_number"] = o.LineNumber.Get() } - if o.PlanName != nil { - toSerialize["plan_name"] = o.PlanName + if o.PlanName.IsSet() { + toSerialize["plan_name"] = o.PlanName.Get() } - if o.PlanNo != nil { - toSerialize["plan_no"] = o.PlanNo + if o.PlanNo.IsSet() { + toSerialize["plan_no"] = o.PlanNo.Get() } if o.RatePerUnit.IsSet() { toSerialize["rate_per_unit"] = o.RatePerUnit.Get() @@ -703,14 +803,14 @@ func (o LineItemData) MarshalJSON() ([]byte, error) { if o.RateScheduleTierNo.IsSet() { toSerialize["rate_schedule_tier_no"] = o.RateScheduleTierNo.Get() } - if o.ServiceName != nil { - toSerialize["service_name"] = o.ServiceName + if o.ServiceName.IsSet() { + toSerialize["service_name"] = o.ServiceName.Get() } - if o.ServiceNo != nil { - toSerialize["service_no"] = o.ServiceNo + if o.ServiceNo.IsSet() { + toSerialize["service_no"] = o.ServiceNo.Get() } - if o.Units != nil { - toSerialize["units"] = o.Units + if o.Units.IsSet() { + toSerialize["units"] = o.Units.Get() } if o.UsageTypeCd.IsSet() { toSerialize["usage_type_cd"] = o.UsageTypeCd.Get() diff --git a/fastly/model_list_customer_addresses_response.go b/fastly/model_list_customer_addresses_response.go new file mode 100644 index 0000000..b300d25 --- /dev/null +++ b/fastly/model_list_customer_addresses_response.go @@ -0,0 +1,155 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// ListCustomerAddressesResponse struct for ListCustomerAddressesResponse +type ListCustomerAddressesResponse struct { + Data []CustomerAddress `json:"data,omitempty"` + AdditionalProperties map[string]any +} + +type _ListCustomerAddressesResponse ListCustomerAddressesResponse + +// NewListCustomerAddressesResponse instantiates a new ListCustomerAddressesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCustomerAddressesResponse() *ListCustomerAddressesResponse { + this := ListCustomerAddressesResponse{} + return &this +} + +// NewListCustomerAddressesResponseWithDefaults instantiates a new ListCustomerAddressesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCustomerAddressesResponseWithDefaults() *ListCustomerAddressesResponse { + this := ListCustomerAddressesResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *ListCustomerAddressesResponse) GetData() []CustomerAddress { + if o == nil || o.Data == nil { + var ret []CustomerAddress + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCustomerAddressesResponse) GetDataOk() ([]CustomerAddress, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *ListCustomerAddressesResponse) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given []CustomerAddress and assigns it to the Data field. +func (o *ListCustomerAddressesResponse) SetData(v []CustomerAddress) { + o.Data = v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ListCustomerAddressesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *ListCustomerAddressesResponse) UnmarshalJSON(bytes []byte) (err error) { + varListCustomerAddressesResponse := _ListCustomerAddressesResponse{} + + if err = json.Unmarshal(bytes, &varListCustomerAddressesResponse); err == nil { + *o = ListCustomerAddressesResponse(varListCustomerAddressesResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableListCustomerAddressesResponse is a helper abstraction for handling nullable listcustomeraddressesresponse types. +type NullableListCustomerAddressesResponse struct { + value *ListCustomerAddressesResponse + isSet bool +} + +// Get returns the value. +func (v NullableListCustomerAddressesResponse) Get() *ListCustomerAddressesResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableListCustomerAddressesResponse) Set(val *ListCustomerAddressesResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableListCustomerAddressesResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableListCustomerAddressesResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableListCustomerAddressesResponse returns a pointer to a new instance of NullableListCustomerAddressesResponse. +func NewNullableListCustomerAddressesResponse(val *ListCustomerAddressesResponse) *NullableListCustomerAddressesResponse { + return &NullableListCustomerAddressesResponse{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableListCustomerAddressesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableListCustomerAddressesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_origin_inspector.go b/fastly/model_origin_inspector.go index 7333655..4d7f5a3 100644 --- a/fastly/model_origin_inspector.go +++ b/fastly/model_origin_inspector.go @@ -19,7 +19,8 @@ import ( // OriginInspector struct for OriginInspector type OriginInspector struct { - Timestamp *OriginInspectorSubsequentRequestTimestamp `json:"Timestamp,omitempty"` + // Value to use for subsequent requests. + Timestamp *int32 `json:"Timestamp,omitempty"` // Offset of entry timestamps from the current time due to processing time. AggregateDelay *int32 `json:"AggregateDelay,omitempty"` // A list of report [entries](#entry-data-model), each representing one second of time. @@ -47,9 +48,9 @@ func NewOriginInspectorWithDefaults() *OriginInspector { } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *OriginInspector) GetTimestamp() OriginInspectorSubsequentRequestTimestamp { +func (o *OriginInspector) GetTimestamp() int32 { if o == nil || o.Timestamp == nil { - var ret OriginInspectorSubsequentRequestTimestamp + var ret int32 return ret } return *o.Timestamp @@ -57,7 +58,7 @@ func (o *OriginInspector) GetTimestamp() OriginInspectorSubsequentRequestTimesta // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OriginInspector) GetTimestampOk() (*OriginInspectorSubsequentRequestTimestamp, bool) { +func (o *OriginInspector) GetTimestampOk() (*int32, bool) { if o == nil || o.Timestamp == nil { return nil, false } @@ -73,8 +74,8 @@ func (o *OriginInspector) HasTimestamp() bool { return false } -// SetTimestamp gets a reference to the given OriginInspectorSubsequentRequestTimestamp and assigns it to the Timestamp field. -func (o *OriginInspector) SetTimestamp(v OriginInspectorSubsequentRequestTimestamp) { +// SetTimestamp gets a reference to the given int32 and assigns it to the Timestamp field. +func (o *OriginInspector) SetTimestamp(v int32) { o.Timestamp = &v } diff --git a/fastly/model_origin_inspector_realtime_entry.go b/fastly/model_origin_inspector_realtime_entry.go index afab01c..e086c94 100644 --- a/fastly/model_origin_inspector_realtime_entry.go +++ b/fastly/model_origin_inspector_realtime_entry.go @@ -19,7 +19,8 @@ import ( // OriginInspectorRealtimeEntry Each reporting period is represented by an entry in the `Data` property of the top level response and provides access to [measurement data](#measurements-data-model) for that time period, grouped by origin name and optionally by POP. The `datacenter` property organizes the measurements by Fastly POP, while the `aggregated` property combines the measurements of all POPs. type OriginInspectorRealtimeEntry struct { - Recorded *OriginInspectorRealtimeEntryRecorded `json:"recorded,omitempty"` + // The Unix timestamp at which this record's data was generated. + Recorded *int32 `json:"recorded,omitempty"` // Groups [measurements](#measurements-data-model) by backend name. Aggregated *map[string]OriginInspectorMeasurements `json:"aggregated,omitempty"` // Groups [measurements](#measurements-data-model) by POP, then backend name. See the [POPs API](https://www.fastly.com/documentation/reference/api/utils/pops/) for details about POP identifiers. @@ -47,9 +48,9 @@ func NewOriginInspectorRealtimeEntryWithDefaults() *OriginInspectorRealtimeEntry } // GetRecorded returns the Recorded field value if set, zero value otherwise. -func (o *OriginInspectorRealtimeEntry) GetRecorded() OriginInspectorRealtimeEntryRecorded { +func (o *OriginInspectorRealtimeEntry) GetRecorded() int32 { if o == nil || o.Recorded == nil { - var ret OriginInspectorRealtimeEntryRecorded + var ret int32 return ret } return *o.Recorded @@ -57,7 +58,7 @@ func (o *OriginInspectorRealtimeEntry) GetRecorded() OriginInspectorRealtimeEntr // GetRecordedOk returns a tuple with the Recorded field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *OriginInspectorRealtimeEntry) GetRecordedOk() (*OriginInspectorRealtimeEntryRecorded, bool) { +func (o *OriginInspectorRealtimeEntry) GetRecordedOk() (*int32, bool) { if o == nil || o.Recorded == nil { return nil, false } @@ -73,8 +74,8 @@ func (o *OriginInspectorRealtimeEntry) HasRecorded() bool { return false } -// SetRecorded gets a reference to the given OriginInspectorRealtimeEntryRecorded and assigns it to the Recorded field. -func (o *OriginInspectorRealtimeEntry) SetRecorded(v OriginInspectorRealtimeEntryRecorded) { +// SetRecorded gets a reference to the given int32 and assigns it to the Recorded field. +func (o *OriginInspectorRealtimeEntry) SetRecorded(v int32) { o.Recorded = &v } diff --git a/fastly/model_origin_inspector_realtime_entry_recorded.go b/fastly/model_origin_inspector_realtime_entry_recorded.go deleted file mode 100644 index 9233395..0000000 --- a/fastly/model_origin_inspector_realtime_entry_recorded.go +++ /dev/null @@ -1,92 +0,0 @@ -// Package fastly is an API client library for interacting with most facets of the Fastly API. -package fastly - -/* -Fastly API - -Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) - -API version: 1.0.0 -Contact: oss@fastly.com -*/ - -// This code is auto-generated; DO NOT EDIT. - - -import ( - "encoding/json" -) - -// OriginInspectorRealtimeEntryRecorded The Unix timestamp at which this record's data was generated. -type OriginInspectorRealtimeEntryRecorded struct { -} - -// NewOriginInspectorRealtimeEntryRecorded instantiates a new OriginInspectorRealtimeEntryRecorded object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewOriginInspectorRealtimeEntryRecorded() *OriginInspectorRealtimeEntryRecorded { - this := OriginInspectorRealtimeEntryRecorded{} - return &this -} - -// NewOriginInspectorRealtimeEntryRecordedWithDefaults instantiates a new OriginInspectorRealtimeEntryRecorded object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewOriginInspectorRealtimeEntryRecordedWithDefaults() *OriginInspectorRealtimeEntryRecorded { - this := OriginInspectorRealtimeEntryRecorded{} - return &this -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (o OriginInspectorRealtimeEntryRecorded) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - return json.Marshal(toSerialize) -} - -// NullableOriginInspectorRealtimeEntryRecorded is a helper abstraction for handling nullable origininspectorrealtimeentryrecorded types. -type NullableOriginInspectorRealtimeEntryRecorded struct { - value *OriginInspectorRealtimeEntryRecorded - isSet bool -} - -// Get returns the value. -func (v NullableOriginInspectorRealtimeEntryRecorded) Get() *OriginInspectorRealtimeEntryRecorded { - return v.value -} - -// Set modifies the value. -func (v *NullableOriginInspectorRealtimeEntryRecorded) Set(val *OriginInspectorRealtimeEntryRecorded) { - v.value = val - v.isSet = true -} - -// IsSet indicates if the value was set. -func (v NullableOriginInspectorRealtimeEntryRecorded) IsSet() bool { - return v.isSet -} - -// Unset removes the value. -func (v *NullableOriginInspectorRealtimeEntryRecorded) Unset() { - v.value = nil - v.isSet = false -} - -// NewNullableOriginInspectorRealtimeEntryRecorded returns a pointer to a new instance of NullableOriginInspectorRealtimeEntryRecorded. -func NewNullableOriginInspectorRealtimeEntryRecorded(val *OriginInspectorRealtimeEntryRecorded) *NullableOriginInspectorRealtimeEntryRecorded { - return &NullableOriginInspectorRealtimeEntryRecorded{value: val, isSet: true} -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (v NullableOriginInspectorRealtimeEntryRecorded) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// UnmarshalJSON implements the Unmarshaler interface. -// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. -func (v *NullableOriginInspectorRealtimeEntryRecorded) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/fastly/model_origin_inspector_subsequent_request_timestamp.go b/fastly/model_origin_inspector_subsequent_request_timestamp.go deleted file mode 100644 index ee08fe9..0000000 --- a/fastly/model_origin_inspector_subsequent_request_timestamp.go +++ /dev/null @@ -1,92 +0,0 @@ -// Package fastly is an API client library for interacting with most facets of the Fastly API. -package fastly - -/* -Fastly API - -Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) - -API version: 1.0.0 -Contact: oss@fastly.com -*/ - -// This code is auto-generated; DO NOT EDIT. - - -import ( - "encoding/json" -) - -// OriginInspectorSubsequentRequestTimestamp Value to use for subsequent requests. -type OriginInspectorSubsequentRequestTimestamp struct { -} - -// NewOriginInspectorSubsequentRequestTimestamp instantiates a new OriginInspectorSubsequentRequestTimestamp object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewOriginInspectorSubsequentRequestTimestamp() *OriginInspectorSubsequentRequestTimestamp { - this := OriginInspectorSubsequentRequestTimestamp{} - return &this -} - -// NewOriginInspectorSubsequentRequestTimestampWithDefaults instantiates a new OriginInspectorSubsequentRequestTimestamp object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewOriginInspectorSubsequentRequestTimestampWithDefaults() *OriginInspectorSubsequentRequestTimestamp { - this := OriginInspectorSubsequentRequestTimestamp{} - return &this -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (o OriginInspectorSubsequentRequestTimestamp) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - return json.Marshal(toSerialize) -} - -// NullableOriginInspectorSubsequentRequestTimestamp is a helper abstraction for handling nullable origininspectorsubsequentrequesttimestamp types. -type NullableOriginInspectorSubsequentRequestTimestamp struct { - value *OriginInspectorSubsequentRequestTimestamp - isSet bool -} - -// Get returns the value. -func (v NullableOriginInspectorSubsequentRequestTimestamp) Get() *OriginInspectorSubsequentRequestTimestamp { - return v.value -} - -// Set modifies the value. -func (v *NullableOriginInspectorSubsequentRequestTimestamp) Set(val *OriginInspectorSubsequentRequestTimestamp) { - v.value = val - v.isSet = true -} - -// IsSet indicates if the value was set. -func (v NullableOriginInspectorSubsequentRequestTimestamp) IsSet() bool { - return v.isSet -} - -// Unset removes the value. -func (v *NullableOriginInspectorSubsequentRequestTimestamp) Unset() { - v.value = nil - v.isSet = false -} - -// NewNullableOriginInspectorSubsequentRequestTimestamp returns a pointer to a new instance of NullableOriginInspectorSubsequentRequestTimestamp. -func NewNullableOriginInspectorSubsequentRequestTimestamp(val *OriginInspectorSubsequentRequestTimestamp) *NullableOriginInspectorSubsequentRequestTimestamp { - return &NullableOriginInspectorSubsequentRequestTimestamp{value: val, isSet: true} -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (v NullableOriginInspectorSubsequentRequestTimestamp) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// UnmarshalJSON implements the Unmarshaler interface. -// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. -func (v *NullableOriginInspectorSubsequentRequestTimestamp) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/fastly/model_realtime_entry_aggregated.go b/fastly/model_realtime_entry_aggregated.go index 149f6ba..3034053 100644 --- a/fastly/model_realtime_entry_aggregated.go +++ b/fastly/model_realtime_entry_aggregated.go @@ -519,6 +519,8 @@ type RealtimeEntryAggregated struct { AllStatus5xx *int32 `json:"all_status_5xx,omitempty"` // Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). OriginOffload *float32 `json:"origin_offload,omitempty"` + // Number of requests where Fastly responded with 400 due to the request being a GET or HEAD request containing a body. + RequestDeniedGetHeadBody *int32 `json:"request_denied_get_head_body,omitempty"` AdditionalProperties map[string]any } @@ -8515,6 +8517,38 @@ func (o *RealtimeEntryAggregated) SetOriginOffload(v float32) { o.OriginOffload = &v } +// GetRequestDeniedGetHeadBody returns the RequestDeniedGetHeadBody field value if set, zero value otherwise. +func (o *RealtimeEntryAggregated) GetRequestDeniedGetHeadBody() int32 { + if o == nil || o.RequestDeniedGetHeadBody == nil { + var ret int32 + return ret + } + return *o.RequestDeniedGetHeadBody +} + +// GetRequestDeniedGetHeadBodyOk returns a tuple with the RequestDeniedGetHeadBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RealtimeEntryAggregated) GetRequestDeniedGetHeadBodyOk() (*int32, bool) { + if o == nil || o.RequestDeniedGetHeadBody == nil { + return nil, false + } + return o.RequestDeniedGetHeadBody, true +} + +// HasRequestDeniedGetHeadBody returns a boolean if a field has been set. +func (o *RealtimeEntryAggregated) HasRequestDeniedGetHeadBody() bool { + if o != nil && o.RequestDeniedGetHeadBody != nil { + return true + } + + return false +} + +// SetRequestDeniedGetHeadBody gets a reference to the given int32 and assigns it to the RequestDeniedGetHeadBody field. +func (o *RealtimeEntryAggregated) SetRequestDeniedGetHeadBody(v int32) { + o.RequestDeniedGetHeadBody = &v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o RealtimeEntryAggregated) MarshalJSON() ([]byte, error) { @@ -9266,6 +9300,9 @@ func (o RealtimeEntryAggregated) MarshalJSON() ([]byte, error) { if o.OriginOffload != nil { toSerialize["origin_offload"] = o.OriginOffload } + if o.RequestDeniedGetHeadBody != nil { + toSerialize["request_denied_get_head_body"] = o.RequestDeniedGetHeadBody + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -9535,6 +9572,7 @@ func (o *RealtimeEntryAggregated) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "all_status_4xx") delete(additionalProperties, "all_status_5xx") delete(additionalProperties, "origin_offload") + delete(additionalProperties, "request_denied_get_head_body") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_realtime_measurements.go b/fastly/model_realtime_measurements.go index 0e5e9cf..44ac364 100644 --- a/fastly/model_realtime_measurements.go +++ b/fastly/model_realtime_measurements.go @@ -519,6 +519,8 @@ type RealtimeMeasurements struct { AllStatus5xx *int32 `json:"all_status_5xx,omitempty"` // Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). OriginOffload *float32 `json:"origin_offload,omitempty"` + // Number of requests where Fastly responded with 400 due to the request being a GET or HEAD request containing a body. + RequestDeniedGetHeadBody *int32 `json:"request_denied_get_head_body,omitempty"` AdditionalProperties map[string]any } @@ -8515,6 +8517,38 @@ func (o *RealtimeMeasurements) SetOriginOffload(v float32) { o.OriginOffload = &v } +// GetRequestDeniedGetHeadBody returns the RequestDeniedGetHeadBody field value if set, zero value otherwise. +func (o *RealtimeMeasurements) GetRequestDeniedGetHeadBody() int32 { + if o == nil || o.RequestDeniedGetHeadBody == nil { + var ret int32 + return ret + } + return *o.RequestDeniedGetHeadBody +} + +// GetRequestDeniedGetHeadBodyOk returns a tuple with the RequestDeniedGetHeadBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RealtimeMeasurements) GetRequestDeniedGetHeadBodyOk() (*int32, bool) { + if o == nil || o.RequestDeniedGetHeadBody == nil { + return nil, false + } + return o.RequestDeniedGetHeadBody, true +} + +// HasRequestDeniedGetHeadBody returns a boolean if a field has been set. +func (o *RealtimeMeasurements) HasRequestDeniedGetHeadBody() bool { + if o != nil && o.RequestDeniedGetHeadBody != nil { + return true + } + + return false +} + +// SetRequestDeniedGetHeadBody gets a reference to the given int32 and assigns it to the RequestDeniedGetHeadBody field. +func (o *RealtimeMeasurements) SetRequestDeniedGetHeadBody(v int32) { + o.RequestDeniedGetHeadBody = &v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o RealtimeMeasurements) MarshalJSON() ([]byte, error) { @@ -9266,6 +9300,9 @@ func (o RealtimeMeasurements) MarshalJSON() ([]byte, error) { if o.OriginOffload != nil { toSerialize["origin_offload"] = o.OriginOffload } + if o.RequestDeniedGetHeadBody != nil { + toSerialize["request_denied_get_head_body"] = o.RequestDeniedGetHeadBody + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -9535,6 +9572,7 @@ func (o *RealtimeMeasurements) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "all_status_4xx") delete(additionalProperties, "all_status_5xx") delete(additionalProperties, "origin_offload") + delete(additionalProperties, "request_denied_get_head_body") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_recorded_timestamp.go b/fastly/model_recorded_timestamp.go deleted file mode 100644 index 7e7c829..0000000 --- a/fastly/model_recorded_timestamp.go +++ /dev/null @@ -1,92 +0,0 @@ -// Package fastly is an API client library for interacting with most facets of the Fastly API. -package fastly - -/* -Fastly API - -Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) - -API version: 1.0.0 -Contact: oss@fastly.com -*/ - -// This code is auto-generated; DO NOT EDIT. - - -import ( - "encoding/json" -) - -// RecordedTimestamp The Unix timestamp at which this record's data was generated. -type RecordedTimestamp struct { -} - -// NewRecordedTimestamp instantiates a new RecordedTimestamp object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRecordedTimestamp() *RecordedTimestamp { - this := RecordedTimestamp{} - return &this -} - -// NewRecordedTimestampWithDefaults instantiates a new RecordedTimestamp object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRecordedTimestampWithDefaults() *RecordedTimestamp { - this := RecordedTimestamp{} - return &this -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (o RecordedTimestamp) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - return json.Marshal(toSerialize) -} - -// NullableRecordedTimestamp is a helper abstraction for handling nullable recordedtimestamp types. -type NullableRecordedTimestamp struct { - value *RecordedTimestamp - isSet bool -} - -// Get returns the value. -func (v NullableRecordedTimestamp) Get() *RecordedTimestamp { - return v.value -} - -// Set modifies the value. -func (v *NullableRecordedTimestamp) Set(val *RecordedTimestamp) { - v.value = val - v.isSet = true -} - -// IsSet indicates if the value was set. -func (v NullableRecordedTimestamp) IsSet() bool { - return v.isSet -} - -// Unset removes the value. -func (v *NullableRecordedTimestamp) Unset() { - v.value = nil - v.isSet = false -} - -// NewNullableRecordedTimestamp returns a pointer to a new instance of NullableRecordedTimestamp. -func NewNullableRecordedTimestamp(val *RecordedTimestamp) *NullableRecordedTimestamp { - return &NullableRecordedTimestamp{value: val, isSet: true} -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (v NullableRecordedTimestamp) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// UnmarshalJSON implements the Unmarshaler interface. -// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. -func (v *NullableRecordedTimestamp) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/fastly/model_results.go b/fastly/model_results.go index be5a50d..a3ea826 100644 --- a/fastly/model_results.go +++ b/fastly/model_results.go @@ -519,6 +519,8 @@ type Results struct { AllStatus5xx *int32 `json:"all_status_5xx,omitempty"` // Origin Offload measures the ratio of bytes served to end users that were cached by Fastly, over the bytes served to end users, between 0 and 1. ((`edge_resp_body_bytes` + `edge_resp_header_bytes`) - (`origin_fetch_resp_body_bytes` + `origin_fetch_resp_header_bytes`)) / (`edge_resp_body_bytes` + `edge_resp_header_bytes`). OriginOffload *float32 `json:"origin_offload,omitempty"` + // Number of requests where Fastly responded with 400 due to the request being a GET or HEAD request containing a body. + RequestDeniedGetHeadBody *int32 `json:"request_denied_get_head_body,omitempty"` ServiceID *string `json:"service_id,omitempty"` // Timestamp for the start of the time period being reported StartTime *int32 `json:"start_time,omitempty"` @@ -8528,6 +8530,38 @@ func (o *Results) SetOriginOffload(v float32) { o.OriginOffload = &v } +// GetRequestDeniedGetHeadBody returns the RequestDeniedGetHeadBody field value if set, zero value otherwise. +func (o *Results) GetRequestDeniedGetHeadBody() int32 { + if o == nil || o.RequestDeniedGetHeadBody == nil { + var ret int32 + return ret + } + return *o.RequestDeniedGetHeadBody +} + +// GetRequestDeniedGetHeadBodyOk returns a tuple with the RequestDeniedGetHeadBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Results) GetRequestDeniedGetHeadBodyOk() (*int32, bool) { + if o == nil || o.RequestDeniedGetHeadBody == nil { + return nil, false + } + return o.RequestDeniedGetHeadBody, true +} + +// HasRequestDeniedGetHeadBody returns a boolean if a field has been set. +func (o *Results) HasRequestDeniedGetHeadBody() bool { + if o != nil && o.RequestDeniedGetHeadBody != nil { + return true + } + + return false +} + +// SetRequestDeniedGetHeadBody gets a reference to the given int32 and assigns it to the RequestDeniedGetHeadBody field. +func (o *Results) SetRequestDeniedGetHeadBody(v int32) { + o.RequestDeniedGetHeadBody = &v +} + // GetServiceID returns the ServiceID field value if set, zero value otherwise. func (o *Results) GetServiceID() string { if o == nil || o.ServiceID == nil { @@ -9343,6 +9377,9 @@ func (o Results) MarshalJSON() ([]byte, error) { if o.OriginOffload != nil { toSerialize["origin_offload"] = o.OriginOffload } + if o.RequestDeniedGetHeadBody != nil { + toSerialize["request_denied_get_head_body"] = o.RequestDeniedGetHeadBody + } if o.ServiceID != nil { toSerialize["service_id"] = o.ServiceID } @@ -9618,6 +9655,7 @@ func (o *Results) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "all_status_4xx") delete(additionalProperties, "all_status_5xx") delete(additionalProperties, "origin_offload") + delete(additionalProperties, "request_denied_get_head_body") delete(additionalProperties, "service_id") delete(additionalProperties, "start_time") o.AdditionalProperties = additionalProperties diff --git a/fastly/model_schemas_version_response.go b/fastly/model_schemas_version_response.go index fb9d835..42e4e5c 100644 --- a/fastly/model_schemas_version_response.go +++ b/fastly/model_schemas_version_response.go @@ -41,6 +41,8 @@ type SchemasVersionResponse struct { // Date and time in ISO 8601 format. UpdatedAt NullableTime `json:"updated_at,omitempty"` ServiceID *string `json:"service_id,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` AdditionalProperties map[string]any } @@ -471,6 +473,38 @@ func (o *SchemasVersionResponse) SetServiceID(v string) { o.ServiceID = &v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *SchemasVersionResponse) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SchemasVersionResponse) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *SchemasVersionResponse) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *SchemasVersionResponse) SetEnvironments(v []Environment) { + o.Environments = v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o SchemasVersionResponse) MarshalJSON() ([]byte, error) { @@ -508,6 +542,9 @@ func (o SchemasVersionResponse) MarshalJSON() ([]byte, error) { if o.ServiceID != nil { toSerialize["service_id"] = o.ServiceID } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -539,6 +576,7 @@ func (o *SchemasVersionResponse) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "deleted_at") delete(additionalProperties, "updated_at") delete(additionalProperties, "service_id") + delete(additionalProperties, "environments") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_service_detail.go b/fastly/model_service_detail.go index f3200d5..3e8d2ae 100644 --- a/fastly/model_service_detail.go +++ b/fastly/model_service_detail.go @@ -41,6 +41,8 @@ type ServiceDetail struct { Paused *bool `json:"paused,omitempty"` // A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. Versions []SchemasVersionResponse `json:"versions,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` ActiveVersion NullableServiceVersionDetailOrNull `json:"active_version,omitempty"` Version *ServiceVersionDetail `json:"version,omitempty"` AdditionalProperties map[string]any @@ -457,6 +459,38 @@ func (o *ServiceDetail) SetVersions(v []SchemasVersionResponse) { o.Versions = v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *ServiceDetail) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceDetail) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *ServiceDetail) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *ServiceDetail) SetEnvironments(v []Environment) { + o.Environments = v +} + // GetActiveVersion returns the ActiveVersion field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ServiceDetail) GetActiveVersion() ServiceVersionDetailOrNull { if o == nil || o.ActiveVersion.Get() == nil { @@ -568,6 +602,9 @@ func (o ServiceDetail) MarshalJSON() ([]byte, error) { if o.Versions != nil { toSerialize["versions"] = o.Versions } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } if o.ActiveVersion.IsSet() { toSerialize["active_version"] = o.ActiveVersion.Get() } @@ -605,6 +642,7 @@ func (o *ServiceDetail) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "publish_key") delete(additionalProperties, "paused") delete(additionalProperties, "versions") + delete(additionalProperties, "environments") delete(additionalProperties, "active_version") delete(additionalProperties, "version") o.AdditionalProperties = additionalProperties diff --git a/fastly/model_service_list_response.go b/fastly/model_service_list_response.go index fa96092..15363d3 100644 --- a/fastly/model_service_list_response.go +++ b/fastly/model_service_list_response.go @@ -39,6 +39,8 @@ type ServiceListResponse struct { Version *int32 `json:"version,omitempty"` // A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. Versions []SchemasVersionResponse `json:"versions,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` AdditionalProperties map[string]any } @@ -421,6 +423,38 @@ func (o *ServiceListResponse) SetVersions(v []SchemasVersionResponse) { o.Versions = v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *ServiceListResponse) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceListResponse) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *ServiceListResponse) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *ServiceListResponse) SetEnvironments(v []Environment) { + o.Environments = v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o ServiceListResponse) MarshalJSON() ([]byte, error) { @@ -455,6 +489,9 @@ func (o ServiceListResponse) MarshalJSON() ([]byte, error) { if o.Versions != nil { toSerialize["versions"] = o.Versions } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -485,6 +522,7 @@ func (o *ServiceListResponse) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "version") delete(additionalProperties, "versions") + delete(additionalProperties, "environments") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_service_list_response_all_of.go b/fastly/model_service_list_response_all_of.go index a944316..33a35b5 100644 --- a/fastly/model_service_list_response_all_of.go +++ b/fastly/model_service_list_response_all_of.go @@ -24,6 +24,8 @@ type ServiceListResponseAllOf struct { Version *int32 `json:"version,omitempty"` // A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. Versions []SchemasVersionResponse `json:"versions,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` AdditionalProperties map[string]any } @@ -142,6 +144,38 @@ func (o *ServiceListResponseAllOf) SetVersions(v []SchemasVersionResponse) { o.Versions = v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *ServiceListResponseAllOf) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceListResponseAllOf) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *ServiceListResponseAllOf) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *ServiceListResponseAllOf) SetEnvironments(v []Environment) { + o.Environments = v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o ServiceListResponseAllOf) MarshalJSON() ([]byte, error) { @@ -155,6 +189,9 @@ func (o ServiceListResponseAllOf) MarshalJSON() ([]byte, error) { if o.Versions != nil { toSerialize["versions"] = o.Versions } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -178,6 +215,7 @@ func (o *ServiceListResponseAllOf) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "id") delete(additionalProperties, "version") delete(additionalProperties, "versions") + delete(additionalProperties, "environments") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_service_response.go b/fastly/model_service_response.go index f46c6f8..bd6ac54 100644 --- a/fastly/model_service_response.go +++ b/fastly/model_service_response.go @@ -41,6 +41,8 @@ type ServiceResponse struct { Paused *bool `json:"paused,omitempty"` // A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. Versions []SchemasVersionResponse `json:"versions,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` AdditionalProperties map[string]any } @@ -455,6 +457,38 @@ func (o *ServiceResponse) SetVersions(v []SchemasVersionResponse) { o.Versions = v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *ServiceResponse) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceResponse) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *ServiceResponse) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *ServiceResponse) SetEnvironments(v []Environment) { + o.Environments = v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o ServiceResponse) MarshalJSON() ([]byte, error) { @@ -492,6 +526,9 @@ func (o ServiceResponse) MarshalJSON() ([]byte, error) { if o.Versions != nil { toSerialize["versions"] = o.Versions } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -523,6 +560,7 @@ func (o *ServiceResponse) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "publish_key") delete(additionalProperties, "paused") delete(additionalProperties, "versions") + delete(additionalProperties, "environments") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_service_response_all_of.go b/fastly/model_service_response_all_of.go index e370047..8cfbe58 100644 --- a/fastly/model_service_response_all_of.go +++ b/fastly/model_service_response_all_of.go @@ -26,6 +26,8 @@ type ServiceResponseAllOf struct { Paused *bool `json:"paused,omitempty"` // A list of [versions](https://www.fastly.com/documentation/reference/api/services/version/) associated with the service. Versions []SchemasVersionResponse `json:"versions,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` AdditionalProperties map[string]any } @@ -176,6 +178,38 @@ func (o *ServiceResponseAllOf) SetVersions(v []SchemasVersionResponse) { o.Versions = v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *ServiceResponseAllOf) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceResponseAllOf) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *ServiceResponseAllOf) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *ServiceResponseAllOf) SetEnvironments(v []Environment) { + o.Environments = v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o ServiceResponseAllOf) MarshalJSON() ([]byte, error) { @@ -192,6 +226,9 @@ func (o ServiceResponseAllOf) MarshalJSON() ([]byte, error) { if o.Versions != nil { toSerialize["versions"] = o.Versions } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -216,6 +253,7 @@ func (o *ServiceResponseAllOf) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "publish_key") delete(additionalProperties, "paused") delete(additionalProperties, "versions") + delete(additionalProperties, "environments") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_service_version_detail.go b/fastly/model_service_version_detail.go index dd63040..3f84386 100644 --- a/fastly/model_service_version_detail.go +++ b/fastly/model_service_version_detail.go @@ -41,6 +41,8 @@ type ServiceVersionDetail struct { // Date and time in ISO 8601 format. UpdatedAt NullableTime `json:"updated_at,omitempty"` ServiceID *string `json:"service_id,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` // List of backends associated to this service. Backends []BackendResponse `json:"backends,omitempty"` // List of cache settings associated to this service. @@ -498,6 +500,38 @@ func (o *ServiceVersionDetail) SetServiceID(v string) { o.ServiceID = &v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *ServiceVersionDetail) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceVersionDetail) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *ServiceVersionDetail) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *ServiceVersionDetail) SetEnvironments(v []Environment) { + o.Environments = v +} + // GetBackends returns the Backends field value if set, zero value otherwise. func (o *ServiceVersionDetail) GetBackends() []BackendResponse { if o == nil || o.Backends == nil { @@ -983,6 +1017,9 @@ func (o ServiceVersionDetail) MarshalJSON() ([]byte, error) { if o.ServiceID != nil { toSerialize["service_id"] = o.ServiceID } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } if o.Backends != nil { toSerialize["backends"] = o.Backends } @@ -1056,6 +1093,7 @@ func (o *ServiceVersionDetail) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "deleted_at") delete(additionalProperties, "updated_at") delete(additionalProperties, "service_id") + delete(additionalProperties, "environments") delete(additionalProperties, "backends") delete(additionalProperties, "cache_settings") delete(additionalProperties, "conditions") diff --git a/fastly/model_service_version_detail_or_null.go b/fastly/model_service_version_detail_or_null.go index 492832a..fe4c6fa 100644 --- a/fastly/model_service_version_detail_or_null.go +++ b/fastly/model_service_version_detail_or_null.go @@ -41,6 +41,8 @@ type ServiceVersionDetailOrNull struct { // Date and time in ISO 8601 format. UpdatedAt NullableTime `json:"updated_at,omitempty"` ServiceID *string `json:"service_id,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` // List of backends associated to this service. Backends []BackendResponse `json:"backends,omitempty"` // List of cache settings associated to this service. @@ -498,6 +500,38 @@ func (o *ServiceVersionDetailOrNull) SetServiceID(v string) { o.ServiceID = &v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *ServiceVersionDetailOrNull) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceVersionDetailOrNull) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *ServiceVersionDetailOrNull) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *ServiceVersionDetailOrNull) SetEnvironments(v []Environment) { + o.Environments = v +} + // GetBackends returns the Backends field value if set, zero value otherwise. func (o *ServiceVersionDetailOrNull) GetBackends() []BackendResponse { if o == nil || o.Backends == nil { @@ -983,6 +1017,9 @@ func (o ServiceVersionDetailOrNull) MarshalJSON() ([]byte, error) { if o.ServiceID != nil { toSerialize["service_id"] = o.ServiceID } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } if o.Backends != nil { toSerialize["backends"] = o.Backends } @@ -1056,6 +1093,7 @@ func (o *ServiceVersionDetailOrNull) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "deleted_at") delete(additionalProperties, "updated_at") delete(additionalProperties, "service_id") + delete(additionalProperties, "environments") delete(additionalProperties, "backends") delete(additionalProperties, "cache_settings") delete(additionalProperties, "conditions") diff --git a/fastly/model_set_configuration.go b/fastly/model_set_configuration.go new file mode 100644 index 0000000..9f733aa --- /dev/null +++ b/fastly/model_set_configuration.go @@ -0,0 +1,194 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// SetConfiguration struct for SetConfiguration +type SetConfiguration struct { + // The new workspace_id. Required in the `PUT` request body when `product_id` is `ngwaf`. Optional in the `PATCH` request body for `ngwaf`. + WorkspaceID *string `json:"workspace_id,omitempty"` + // The new traffic ramp. Optional in the `PATCH` request body for `ngwaf`. + TrafficRamp *string `json:"traffic_ramp,omitempty"` + AdditionalProperties map[string]any +} + +type _SetConfiguration SetConfiguration + +// NewSetConfiguration instantiates a new SetConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetConfiguration() *SetConfiguration { + this := SetConfiguration{} + return &this +} + +// NewSetConfigurationWithDefaults instantiates a new SetConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetConfigurationWithDefaults() *SetConfiguration { + this := SetConfiguration{} + return &this +} + +// GetWorkspaceID returns the WorkspaceID field value if set, zero value otherwise. +func (o *SetConfiguration) GetWorkspaceID() string { + if o == nil || o.WorkspaceID == nil { + var ret string + return ret + } + return *o.WorkspaceID +} + +// GetWorkspaceIDOk returns a tuple with the WorkspaceID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetConfiguration) GetWorkspaceIDOk() (*string, bool) { + if o == nil || o.WorkspaceID == nil { + return nil, false + } + return o.WorkspaceID, true +} + +// HasWorkspaceID returns a boolean if a field has been set. +func (o *SetConfiguration) HasWorkspaceID() bool { + if o != nil && o.WorkspaceID != nil { + return true + } + + return false +} + +// SetWorkspaceID gets a reference to the given string and assigns it to the WorkspaceID field. +func (o *SetConfiguration) SetWorkspaceID(v string) { + o.WorkspaceID = &v +} + +// GetTrafficRamp returns the TrafficRamp field value if set, zero value otherwise. +func (o *SetConfiguration) GetTrafficRamp() string { + if o == nil || o.TrafficRamp == nil { + var ret string + return ret + } + return *o.TrafficRamp +} + +// GetTrafficRampOk returns a tuple with the TrafficRamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetConfiguration) GetTrafficRampOk() (*string, bool) { + if o == nil || o.TrafficRamp == nil { + return nil, false + } + return o.TrafficRamp, true +} + +// HasTrafficRamp returns a boolean if a field has been set. +func (o *SetConfiguration) HasTrafficRamp() bool { + if o != nil && o.TrafficRamp != nil { + return true + } + + return false +} + +// SetTrafficRamp gets a reference to the given string and assigns it to the TrafficRamp field. +func (o *SetConfiguration) SetTrafficRamp(v string) { + o.TrafficRamp = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o SetConfiguration) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.WorkspaceID != nil { + toSerialize["workspace_id"] = o.WorkspaceID + } + if o.TrafficRamp != nil { + toSerialize["traffic_ramp"] = o.TrafficRamp + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *SetConfiguration) UnmarshalJSON(bytes []byte) (err error) { + varSetConfiguration := _SetConfiguration{} + + if err = json.Unmarshal(bytes, &varSetConfiguration); err == nil { + *o = SetConfiguration(varSetConfiguration) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "workspace_id") + delete(additionalProperties, "traffic_ramp") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableSetConfiguration is a helper abstraction for handling nullable setconfiguration types. +type NullableSetConfiguration struct { + value *SetConfiguration + isSet bool +} + +// Get returns the value. +func (v NullableSetConfiguration) Get() *SetConfiguration { + return v.value +} + +// Set modifies the value. +func (v *NullableSetConfiguration) Set(val *SetConfiguration) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableSetConfiguration) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableSetConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableSetConfiguration returns a pointer to a new instance of NullableSetConfiguration. +func NewNullableSetConfiguration(val *SetConfiguration) *NullableSetConfiguration { + return &NullableSetConfiguration{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableSetConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableSetConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_set_workspace_id.go b/fastly/model_set_workspace_id.go new file mode 100644 index 0000000..e7f8a65 --- /dev/null +++ b/fastly/model_set_workspace_id.go @@ -0,0 +1,156 @@ +// Package fastly is an API client library for interacting with most facets of the Fastly API. +package fastly + +/* +Fastly API + +Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) + +API version: 1.0.0 +Contact: oss@fastly.com +*/ + +// This code is auto-generated; DO NOT EDIT. + + +import ( + "encoding/json" +) + +// SetWorkspaceID struct for SetWorkspaceID +type SetWorkspaceID struct { + // The workspace to link with the Next-Gen WAF product. Note this body is only supported and required when `product_id` is `ngwaf` + WorkspaceID *string `json:"workspace_id,omitempty"` + AdditionalProperties map[string]any +} + +type _SetWorkspaceID SetWorkspaceID + +// NewSetWorkspaceID instantiates a new SetWorkspaceID object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetWorkspaceID() *SetWorkspaceID { + this := SetWorkspaceID{} + return &this +} + +// NewSetWorkspaceIDWithDefaults instantiates a new SetWorkspaceID object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetWorkspaceIDWithDefaults() *SetWorkspaceID { + this := SetWorkspaceID{} + return &this +} + +// GetWorkspaceID returns the WorkspaceID field value if set, zero value otherwise. +func (o *SetWorkspaceID) GetWorkspaceID() string { + if o == nil || o.WorkspaceID == nil { + var ret string + return ret + } + return *o.WorkspaceID +} + +// GetWorkspaceIDOk returns a tuple with the WorkspaceID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetWorkspaceID) GetWorkspaceIDOk() (*string, bool) { + if o == nil || o.WorkspaceID == nil { + return nil, false + } + return o.WorkspaceID, true +} + +// HasWorkspaceID returns a boolean if a field has been set. +func (o *SetWorkspaceID) HasWorkspaceID() bool { + if o != nil && o.WorkspaceID != nil { + return true + } + + return false +} + +// SetWorkspaceID gets a reference to the given string and assigns it to the WorkspaceID field. +func (o *SetWorkspaceID) SetWorkspaceID(v string) { + o.WorkspaceID = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o SetWorkspaceID) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.WorkspaceID != nil { + toSerialize["workspace_id"] = o.WorkspaceID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *SetWorkspaceID) UnmarshalJSON(bytes []byte) (err error) { + varSetWorkspaceID := _SetWorkspaceID{} + + if err = json.Unmarshal(bytes, &varSetWorkspaceID); err == nil { + *o = SetWorkspaceID(varSetWorkspaceID) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "workspace_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableSetWorkspaceID is a helper abstraction for handling nullable setworkspaceid types. +type NullableSetWorkspaceID struct { + value *SetWorkspaceID + isSet bool +} + +// Get returns the value. +func (v NullableSetWorkspaceID) Get() *SetWorkspaceID { + return v.value +} + +// Set modifies the value. +func (v *NullableSetWorkspaceID) Set(val *SetWorkspaceID) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableSetWorkspaceID) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableSetWorkspaceID) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableSetWorkspaceID returns a pointer to a new instance of NullableSetWorkspaceID. +func NewNullableSetWorkspaceID(val *SetWorkspaceID) *NullableSetWorkspaceID { + return &NullableSetWorkspaceID{value: val, isSet: true} +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (v NullableSetWorkspaceID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (v *NullableSetWorkspaceID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_subsequent_request_timestamp.go b/fastly/model_subsequent_request_timestamp.go deleted file mode 100644 index 4dc3c49..0000000 --- a/fastly/model_subsequent_request_timestamp.go +++ /dev/null @@ -1,92 +0,0 @@ -// Package fastly is an API client library for interacting with most facets of the Fastly API. -package fastly - -/* -Fastly API - -Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) - -API version: 1.0.0 -Contact: oss@fastly.com -*/ - -// This code is auto-generated; DO NOT EDIT. - - -import ( - "encoding/json" -) - -// SubsequentRequestTimestamp Value to use for subsequent requests. -type SubsequentRequestTimestamp struct { -} - -// NewSubsequentRequestTimestamp instantiates a new SubsequentRequestTimestamp object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSubsequentRequestTimestamp() *SubsequentRequestTimestamp { - this := SubsequentRequestTimestamp{} - return &this -} - -// NewSubsequentRequestTimestampWithDefaults instantiates a new SubsequentRequestTimestamp object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSubsequentRequestTimestampWithDefaults() *SubsequentRequestTimestamp { - this := SubsequentRequestTimestamp{} - return &this -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (o SubsequentRequestTimestamp) MarshalJSON() ([]byte, error) { - toSerialize := map[string]any{} - return json.Marshal(toSerialize) -} - -// NullableSubsequentRequestTimestamp is a helper abstraction for handling nullable subsequentrequesttimestamp types. -type NullableSubsequentRequestTimestamp struct { - value *SubsequentRequestTimestamp - isSet bool -} - -// Get returns the value. -func (v NullableSubsequentRequestTimestamp) Get() *SubsequentRequestTimestamp { - return v.value -} - -// Set modifies the value. -func (v *NullableSubsequentRequestTimestamp) Set(val *SubsequentRequestTimestamp) { - v.value = val - v.isSet = true -} - -// IsSet indicates if the value was set. -func (v NullableSubsequentRequestTimestamp) IsSet() bool { - return v.isSet -} - -// Unset removes the value. -func (v *NullableSubsequentRequestTimestamp) Unset() { - v.value = nil - v.isSet = false -} - -// NewNullableSubsequentRequestTimestamp returns a pointer to a new instance of NullableSubsequentRequestTimestamp. -func NewNullableSubsequentRequestTimestamp(val *SubsequentRequestTimestamp) *NullableSubsequentRequestTimestamp { - return &NullableSubsequentRequestTimestamp{value: val, isSet: true} -} - -// MarshalJSON implements the json.Marshaler interface. -// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. -func (v NullableSubsequentRequestTimestamp) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// UnmarshalJSON implements the Unmarshaler interface. -// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. -func (v *NullableSubsequentRequestTimestamp) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/fastly/model_version_response.go b/fastly/model_version_response.go index b19d512..fc9174f 100644 --- a/fastly/model_version_response.go +++ b/fastly/model_version_response.go @@ -41,6 +41,8 @@ type VersionResponse struct { // Date and time in ISO 8601 format. UpdatedAt NullableTime `json:"updated_at,omitempty"` ServiceID *string `json:"service_id,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` AdditionalProperties map[string]any } @@ -471,6 +473,38 @@ func (o *VersionResponse) SetServiceID(v string) { o.ServiceID = &v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *VersionResponse) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VersionResponse) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *VersionResponse) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *VersionResponse) SetEnvironments(v []Environment) { + o.Environments = v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o VersionResponse) MarshalJSON() ([]byte, error) { @@ -508,6 +542,9 @@ func (o VersionResponse) MarshalJSON() ([]byte, error) { if o.ServiceID != nil { toSerialize["service_id"] = o.ServiceID } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -539,6 +576,7 @@ func (o *VersionResponse) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "deleted_at") delete(additionalProperties, "updated_at") delete(additionalProperties, "service_id") + delete(additionalProperties, "environments") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_version_response_all_of.go b/fastly/model_version_response_all_of.go index 0777af7..7eaed9c 100644 --- a/fastly/model_version_response_all_of.go +++ b/fastly/model_version_response_all_of.go @@ -20,6 +20,8 @@ import ( // VersionResponseAllOf struct for VersionResponseAllOf type VersionResponseAllOf struct { ServiceID *string `json:"service_id,omitempty"` + // A list of environments where the service has been deployed. + Environments []Environment `json:"environments,omitempty"` AdditionalProperties map[string]any } @@ -74,6 +76,38 @@ func (o *VersionResponseAllOf) SetServiceID(v string) { o.ServiceID = &v } +// GetEnvironments returns the Environments field value if set, zero value otherwise. +func (o *VersionResponseAllOf) GetEnvironments() []Environment { + if o == nil || o.Environments == nil { + var ret []Environment + return ret + } + return o.Environments +} + +// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VersionResponseAllOf) GetEnvironmentsOk() ([]Environment, bool) { + if o == nil || o.Environments == nil { + return nil, false + } + return o.Environments, true +} + +// HasEnvironments returns a boolean if a field has been set. +func (o *VersionResponseAllOf) HasEnvironments() bool { + if o != nil && o.Environments != nil { + return true + } + + return false +} + +// SetEnvironments gets a reference to the given []Environment and assigns it to the Environments field. +func (o *VersionResponseAllOf) SetEnvironments(v []Environment) { + o.Environments = v +} + // MarshalJSON implements the json.Marshaler interface. // Marshaler is the interface implemented by types that can marshal themselves into valid JSON. func (o VersionResponseAllOf) MarshalJSON() ([]byte, error) { @@ -81,6 +115,9 @@ func (o VersionResponseAllOf) MarshalJSON() ([]byte, error) { if o.ServiceID != nil { toSerialize["service_id"] = o.ServiceID } + if o.Environments != nil { + toSerialize["environments"] = o.Environments + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -102,6 +139,7 @@ func (o *VersionResponseAllOf) UnmarshalJSON(bytes []byte) (err error) { if err = json.Unmarshal(bytes, &additionalProperties); err == nil { delete(additionalProperties, "service_id") + delete(additionalProperties, "environments") o.AdditionalProperties = additionalProperties } diff --git a/sig.json b/sig.json index 442b4f5..d9facb9 100644 --- a/sig.json +++ b/sig.json @@ -1 +1 @@ -{"G": "6c487eff", "D": "8fce7d1c"} +{"G": "1827dbb1", "D": "1f27800e"}