diff --git a/CHANGELOG.md b/CHANGELOG.md index 58255a0..bf582f1 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## [v1.0.0-beta.37](https://github.com/fastly/fastly-go/releases/tag/release/v1.0.0-beta.37) (2024-12-05) + +**Breaking Changes:** + +- fix(udm-domains): Use v1 versioned HTTP endpoints for UDM domains +- fix(historical): Remove references to VCL on Compute metrics +- fix(realtime): Remove references to VCL on Compute metrics +- feat(billing-usage-metrics): Updated to v3 of the API + +**Bug fixes:** + +- fix(acls-in-compute): Corrected shape of `compute-acl-update` model. + +**Enhancements:** + +- feat(object-storage-access-keys): Added Object Storage Access Keys API +- feat(logging-grafanacloudlogs): Added Grafana Cloud Logs Loggin API +- feat(insights): Added Insights API +- feat(kv-store-item): Added `consistency` parameter to `get-keys` operation. +- feat(enabled-products): Added `mode` property to `set-configuration`. + +**Documentation:** + +- doc(observability-custom-dashboards): Fix bad link in custom dashboard documentation +- doc(observability-custom-dashboards): Reformat some enums to fix docs rendering +- doc(acls-in-compute): Corrections to descriptions of `compute-acl-lookup`, `compute-acl-list-entries`, + `compute-acl-update-entry`, and `compute-acl-update` structures +- doc(enabled-products): Added support for product ID `log_explorer_insights`. +- doc(enabled-products): Added support for product ID `ddos_protection`. + ## [v1.0.0-beta.36](https://github.com/fastly/fastly-go/releases/tag/release/v1.0.0-beta.36) (2024-10-23) **Enhancements:** diff --git a/README.md b/README.md index 19138df..edb6764 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.36 + github.com/fastly/fastly-go 1.0.0-beta.37 ) ``` @@ -113,7 +113,7 @@ Class | Method | Description *BillingInvoicesAPI* | [**GetMonthToDateInvoice**](docs/BillingInvoicesAPI.md#getmonthtodateinvoice) | Get month-to-date invoice. *BillingInvoicesAPI* | [**ListInvoices**](docs/BillingInvoicesAPI.md#listinvoices) | List of invoices. *BillingUsageMetricsAPI* | [**GetServiceLevelUsage**](docs/BillingUsageMetricsAPI.md#getservicelevelusage) | Retrieve service-level usage metrics for a product. -*BillingUsageMetricsAPI* | [**GetServiceLevelUsageTypes**](docs/BillingUsageMetricsAPI.md#getservicelevelusagetypes) | Retrieve product usage types for a customer. +*BillingUsageMetricsAPI* | [**GetUsageMetrics**](docs/BillingUsageMetricsAPI.md#getusagemetrics) | Get monthly usage metrics *CacheSettingsAPI* | [**CreateCacheSettings**](docs/CacheSettingsAPI.md#createcachesettings) | Create a cache settings object *CacheSettingsAPI* | [**DeleteCacheSettings**](docs/CacheSettingsAPI.md#deletecachesettings) | Delete a cache settings object *CacheSettingsAPI* | [**GetCacheSettings**](docs/CacheSettingsAPI.md#getcachesettings) | Get a cache settings object @@ -251,6 +251,7 @@ Class | Method | Description *IamUserGroupsAPI* | [**UpdateAUserGroup**](docs/IamUserGroupsAPI.md#updateausergroup) | Update a user group *ImageOptimizerDefaultSettingsAPI* | [**GetDefaultSettings**](docs/ImageOptimizerDefaultSettingsAPI.md#getdefaultsettings) | Get current Image Optimizer Default Settings *ImageOptimizerDefaultSettingsAPI* | [**UpdateDefaultSettings**](docs/ImageOptimizerDefaultSettingsAPI.md#updatedefaultsettings) | Update Image Optimizer Default Settings +*InsightsAPI* | [**GetLogInsights**](docs/InsightsAPI.md#getloginsights) | Retrieve log insights *InvitationsAPI* | [**CreateInvitation**](docs/InvitationsAPI.md#createinvitation) | Create an invitation *InvitationsAPI* | [**DeleteInvitation**](docs/InvitationsAPI.md#deleteinvitation) | Delete an invitation *InvitationsAPI* | [**ListInvitations**](docs/InvitationsAPI.md#listinvitations) | List invitations @@ -330,6 +331,11 @@ Class | Method | Description *LoggingGcsAPI* | [**GetLogGcs**](docs/LoggingGcsAPI.md#getloggcs) | Get a GCS log endpoint *LoggingGcsAPI* | [**ListLogGcs**](docs/LoggingGcsAPI.md#listloggcs) | List GCS log endpoints *LoggingGcsAPI* | [**UpdateLogGcs**](docs/LoggingGcsAPI.md#updateloggcs) | Update a GCS log endpoint +*LoggingGrafanacloudlogsAPI* | [**CreateLogGrafanacloudlogs**](docs/LoggingGrafanacloudlogsAPI.md#createloggrafanacloudlogs) | Create a Grafana Cloud Logs log endpoint +*LoggingGrafanacloudlogsAPI* | [**DeleteLogGrafanacloudlogs**](docs/LoggingGrafanacloudlogsAPI.md#deleteloggrafanacloudlogs) | Delete the Grafana Cloud Logs log endpoint +*LoggingGrafanacloudlogsAPI* | [**GetLogGrafanacloudlogs**](docs/LoggingGrafanacloudlogsAPI.md#getloggrafanacloudlogs) | Get a Grafana Cloud Logs log endpoint +*LoggingGrafanacloudlogsAPI* | [**ListLogGrafanacloudlogs**](docs/LoggingGrafanacloudlogsAPI.md#listloggrafanacloudlogs) | List Grafana Cloud Logs log endpoints +*LoggingGrafanacloudlogsAPI* | [**UpdateLogGrafanacloudlogs**](docs/LoggingGrafanacloudlogsAPI.md#updateloggrafanacloudlogs) | Update a Grafana Cloud Logs log endpoint *LoggingHerokuAPI* | [**CreateLogHeroku**](docs/LoggingHerokuAPI.md#createlogheroku) | Create a Heroku log endpoint *LoggingHerokuAPI* | [**DeleteLogHeroku**](docs/LoggingHerokuAPI.md#deletelogheroku) | Delete the Heroku log endpoint *LoggingHerokuAPI* | [**GetLogHeroku**](docs/LoggingHerokuAPI.md#getlogheroku) | Get a Heroku log endpoint @@ -430,6 +436,10 @@ Class | Method | Description *MutualAuthenticationAPI* | [**GetMutualAuthentication**](docs/MutualAuthenticationAPI.md#getmutualauthentication) | Get a Mutual Authentication *MutualAuthenticationAPI* | [**ListMutualAuthentications**](docs/MutualAuthenticationAPI.md#listmutualauthentications) | List Mutual Authentications *MutualAuthenticationAPI* | [**PatchMutualAuthentication**](docs/MutualAuthenticationAPI.md#patchmutualauthentication) | Update a Mutual Authentication +*ObjectStorageAccessKeysAPI* | [**CreateAccessKey**](docs/ObjectStorageAccessKeysAPI.md#createaccesskey) | Create an access key +*ObjectStorageAccessKeysAPI* | [**DeleteAccessKey**](docs/ObjectStorageAccessKeysAPI.md#deleteaccesskey) | Delete an access key +*ObjectStorageAccessKeysAPI* | [**GetAccessKey**](docs/ObjectStorageAccessKeysAPI.md#getaccesskey) | Get an access key +*ObjectStorageAccessKeysAPI* | [**ListAccessKeys**](docs/ObjectStorageAccessKeysAPI.md#listaccesskeys) | List access keys *ObservabilityCustomDashboardsAPI* | [**CreateDashboard**](docs/ObservabilityCustomDashboardsAPI.md#createdashboard) | Create a new dashboard *ObservabilityCustomDashboardsAPI* | [**DeleteDashboard**](docs/ObservabilityCustomDashboardsAPI.md#deletedashboard) | Delete an existing dashboard *ObservabilityCustomDashboardsAPI* | [**GetDashboard**](docs/ObservabilityCustomDashboardsAPI.md#getdashboard) | Retrieve a dashboard by ID @@ -654,14 +664,15 @@ 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) +- [`/domains/v1/{domain_id}`](https://www.fastly.com/documentation/reference/api/) (DELETE, GET, PATCH) +- [`/domains/v1`](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) - [`/notifications/integrations/{integration_id}`](https://developer.fastly.com/reference/api/observability/notification) (DELETE, GET, PATCH) - [`/notifications/integrations`](https://developer.fastly.com/reference/api/observability/notification) (GET, POST) - [`/notifications/mailinglist-confirmations`](https://developer.fastly.com/reference/api/observability/notification) (POST) +- [`/observability/log-explorer`](https://www.fastly.com/documentation/reference/api/observability/log-explorer/) (GET) - [`/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) diff --git a/docs/AccessKey.md b/docs/AccessKey.md new file mode 100644 index 0000000..fcee5d9 --- /dev/null +++ b/docs/AccessKey.md @@ -0,0 +1,96 @@ +# AccessKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | A description of the access key. | +**Permission** | **string** | The permissions granted to an access key. | +**Buckets** | Pointer to **[]string** | | [optional] + +## Methods + +### NewAccessKey + +`func NewAccessKey(description string, permission string, ) *AccessKey` + +NewAccessKey instantiates a new AccessKey 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 + +### NewAccessKeyWithDefaults + +`func NewAccessKeyWithDefaults() *AccessKey` + +NewAccessKeyWithDefaults instantiates a new AccessKey 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 + +### GetDescription + +`func (o *AccessKey) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *AccessKey) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *AccessKey) SetDescription(v string)` + +SetDescription sets Description field to given value. + + +### GetPermission + +`func (o *AccessKey) GetPermission() string` + +GetPermission returns the Permission field if non-nil, zero value otherwise. + +### GetPermissionOk + +`func (o *AccessKey) GetPermissionOk() (*string, bool)` + +GetPermissionOk returns a tuple with the Permission field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermission + +`func (o *AccessKey) SetPermission(v string)` + +SetPermission sets Permission field to given value. + + +### GetBuckets + +`func (o *AccessKey) GetBuckets() []string` + +GetBuckets returns the Buckets field if non-nil, zero value otherwise. + +### GetBucketsOk + +`func (o *AccessKey) GetBucketsOk() (*[]string, bool)` + +GetBucketsOk returns a tuple with the Buckets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuckets + +`func (o *AccessKey) SetBuckets(v []string)` + +SetBuckets sets Buckets field to given value. + +### HasBuckets + +`func (o *AccessKey) HasBuckets() bool` + +HasBuckets 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/AccessKeyResponse.md b/docs/AccessKeyResponse.md new file mode 100644 index 0000000..a181e02 --- /dev/null +++ b/docs/AccessKeyResponse.md @@ -0,0 +1,194 @@ +# AccessKeyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessKey** | Pointer to **string** | Generated access key. | [optional] +**SecretKey** | Pointer to **string** | Generated secret key. | [optional] +**Description** | Pointer to **string** | Description for the access key. | [optional] +**Permission** | Pointer to **string** | Permissions granted to an access key. | [optional] +**Buckets** | Pointer to **[]string** | | [optional] +**CreatedAt** | Pointer to **NullableTime** | Date and time in ISO 8601 format. | [optional] [readonly] + +## Methods + +### NewAccessKeyResponse + +`func NewAccessKeyResponse() *AccessKeyResponse` + +NewAccessKeyResponse instantiates a new AccessKeyResponse 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 + +### NewAccessKeyResponseWithDefaults + +`func NewAccessKeyResponseWithDefaults() *AccessKeyResponse` + +NewAccessKeyResponseWithDefaults instantiates a new AccessKeyResponse 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 + +### GetAccessKey + +`func (o *AccessKeyResponse) GetAccessKey() string` + +GetAccessKey returns the AccessKey field if non-nil, zero value otherwise. + +### GetAccessKeyOk + +`func (o *AccessKeyResponse) GetAccessKeyOk() (*string, bool)` + +GetAccessKeyOk returns a tuple with the AccessKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessKey + +`func (o *AccessKeyResponse) SetAccessKey(v string)` + +SetAccessKey sets AccessKey field to given value. + +### HasAccessKey + +`func (o *AccessKeyResponse) HasAccessKey() bool` + +HasAccessKey returns a boolean if a field has been set. + +### GetSecretKey + +`func (o *AccessKeyResponse) GetSecretKey() string` + +GetSecretKey returns the SecretKey field if non-nil, zero value otherwise. + +### GetSecretKeyOk + +`func (o *AccessKeyResponse) GetSecretKeyOk() (*string, bool)` + +GetSecretKeyOk returns a tuple with the SecretKey field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSecretKey + +`func (o *AccessKeyResponse) SetSecretKey(v string)` + +SetSecretKey sets SecretKey field to given value. + +### HasSecretKey + +`func (o *AccessKeyResponse) HasSecretKey() bool` + +HasSecretKey returns a boolean if a field has been set. + +### GetDescription + +`func (o *AccessKeyResponse) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *AccessKeyResponse) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *AccessKeyResponse) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *AccessKeyResponse) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetPermission + +`func (o *AccessKeyResponse) GetPermission() string` + +GetPermission returns the Permission field if non-nil, zero value otherwise. + +### GetPermissionOk + +`func (o *AccessKeyResponse) GetPermissionOk() (*string, bool)` + +GetPermissionOk returns a tuple with the Permission field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPermission + +`func (o *AccessKeyResponse) SetPermission(v string)` + +SetPermission sets Permission field to given value. + +### HasPermission + +`func (o *AccessKeyResponse) HasPermission() bool` + +HasPermission returns a boolean if a field has been set. + +### GetBuckets + +`func (o *AccessKeyResponse) GetBuckets() []string` + +GetBuckets returns the Buckets field if non-nil, zero value otherwise. + +### GetBucketsOk + +`func (o *AccessKeyResponse) GetBucketsOk() (*[]string, bool)` + +GetBucketsOk returns a tuple with the Buckets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBuckets + +`func (o *AccessKeyResponse) SetBuckets(v []string)` + +SetBuckets sets Buckets field to given value. + +### HasBuckets + +`func (o *AccessKeyResponse) HasBuckets() bool` + +HasBuckets returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *AccessKeyResponse) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *AccessKeyResponse) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *AccessKeyResponse) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *AccessKeyResponse) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### SetCreatedAtNil + +`func (o *AccessKeyResponse) SetCreatedAtNil(b bool)` + + SetCreatedAtNil sets the value for CreatedAt to be an explicit nil + +### UnsetCreatedAt +`func (o *AccessKeyResponse) UnsetCreatedAt()` + +UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil + +[Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) diff --git a/docs/AclsInComputeAPI.md b/docs/AclsInComputeAPI.md index 55d7a3e..c370e2f 100644 --- a/docs/AclsInComputeAPI.md +++ b/docs/AclsInComputeAPI.md @@ -427,12 +427,12 @@ import ( func main() { aclID := "aclId_example" // string | - computeACLUpdateEntry := []openapiclient.ComputeACLUpdateEntry{*openapiclient.NewComputeACLUpdateEntry()} // []ComputeACLUpdateEntry | (optional) + computeACLUpdate := *openapiclient.NewComputeACLUpdate() // ComputeACLUpdate | (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() + resp, r, err := apiClient.ACLsInComputeAPI.ComputeACLUpdateAcls(ctx, aclID).ComputeACLUpdate(computeACLUpdate).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) @@ -455,7 +455,7 @@ Other parameters are passed through a pointer to a apiComputeACLUpdateAclsReques Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **computeACLUpdateEntry** | [**[]ComputeACLUpdateEntry**](ComputeACLUpdateEntry.md) | | + **computeACLUpdate** | [**ComputeACLUpdate**](ComputeACLUpdate.md) | | ### Return type diff --git a/docs/BillingUsageMetricsAPI.md b/docs/BillingUsageMetricsAPI.md index 3f074fe..78903b3 100644 --- a/docs/BillingUsageMetricsAPI.md +++ b/docs/BillingUsageMetricsAPI.md @@ -5,8 +5,8 @@ Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetServiceLevelUsage**](BillingUsageMetricsAPI.md#GetServiceLevelUsage) | **GET** `/billing/v2/account_customers/{customer_id}/service-usage-metrics` | Retrieve service-level usage metrics for a product. -[**GetServiceLevelUsageTypes**](BillingUsageMetricsAPI.md#GetServiceLevelUsageTypes) | **GET** `/billing/v2/account_customers/{customer_id}/service-usage-types` | Retrieve product usage types for a customer. +[**GetServiceLevelUsage**](BillingUsageMetricsAPI.md#GetServiceLevelUsage) | **GET** `/billing/v3/service-usage-metrics` | Retrieve service-level usage metrics for a product. +[**GetUsageMetrics**](BillingUsageMetricsAPI.md#GetUsageMetrics) | **GET** `/billing/v3/usage-metrics` | Get monthly usage metrics @@ -29,12 +29,8 @@ import ( ) func main() { - customerID := "customerId_example" // string | Alphanumeric string identifying the customer. productID := "productId_example" // string | The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. usageTypeName := "usageTypeName_example" // string | The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. - timeGranularity := "timeGranularity_example" // string | - startDate := "2023-01-01" // string | (optional) - endDate := "2023-01-31" // string | (optional) startMonth := "2023-01" // string | (optional) endMonth := "2023-03" // string | (optional) limit := "limit_example" // string | Number of results per page. The maximum is 100. (optional) (default to "5") @@ -43,7 +39,7 @@ func main() { cfg := fastly.NewConfiguration() apiClient := fastly.NewAPIClient(cfg) ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") - resp, r, err := apiClient.BillingUsageMetricsAPI.GetServiceLevelUsage(ctx, customerID).ProductID(productID).UsageTypeName(usageTypeName).TimeGranularity(timeGranularity).StartDate(startDate).EndDate(endDate).StartMonth(startMonth).EndMonth(endMonth).Limit(limit).Cursor(cursor).Execute() + resp, r, err := apiClient.BillingUsageMetricsAPI.GetServiceLevelUsage(ctx).ProductID(productID).UsageTypeName(usageTypeName).StartMonth(startMonth).EndMonth(endMonth).Limit(limit).Cursor(cursor).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `BillingUsageMetricsAPI.GetServiceLevelUsage`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -56,10 +52,6 @@ func main() { ### Path Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**customerID** | **string** | Alphanumeric string identifying the customer. | ### Other Parameters @@ -68,7 +60,7 @@ Other parameters are passed through a pointer to a apiGetServiceLevelUsageReques Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **productID** | **string** | The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. | **usageTypeName** | **string** | The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. | **timeGranularity** | **string** | | **startDate** | **string** | | **endDate** | **string** | | **startMonth** | **string** | | **endMonth** | **string** | | **limit** | **string** | Number of results per page. The maximum is 100. | [default to "5"] **cursor** | **string** | Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. | + **productID** | **string** | The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. | **usageTypeName** | **string** | The usage type name for the metrics returned (e.g., `North America Requests`). This field is not required for CSV requests. | **startMonth** | **string** | | **endMonth** | **string** | | **limit** | **string** | Number of results per page. The maximum is 100. | [default to "5"] **cursor** | **string** | Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. | ### Return type @@ -86,9 +78,9 @@ Name | Type | Description | Notes [Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) -## GetServiceLevelUsageTypes +## GetUsageMetrics -Retrieve product usage types for a customer. +Get monthly usage metrics @@ -105,41 +97,38 @@ import ( ) func main() { - customerID := "customerId_example" // string | Alphanumeric string identifying the customer. + startMonth := "2023-01" // string | (optional) + endMonth := "2023-03" // string | (optional) cfg := fastly.NewConfiguration() apiClient := fastly.NewAPIClient(cfg) ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") - resp, r, err := apiClient.BillingUsageMetricsAPI.GetServiceLevelUsageTypes(ctx, customerID).Execute() + resp, r, err := apiClient.BillingUsageMetricsAPI.GetUsageMetrics(ctx).StartMonth(startMonth).EndMonth(endMonth).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BillingUsageMetricsAPI.GetServiceLevelUsageTypes`: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `BillingUsageMetricsAPI.GetUsageMetrics`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetServiceLevelUsageTypes`: Serviceusagetypes - fmt.Fprintf(os.Stdout, "Response from `BillingUsageMetricsAPI.GetServiceLevelUsageTypes`: %v\n", resp) + // response from `GetUsageMetrics`: Usagemetric + fmt.Fprintf(os.Stdout, "Response from `BillingUsageMetricsAPI.GetUsageMetrics`: %v\n", resp) } ``` ### Path Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**customerID** | **string** | Alphanumeric string identifying the customer. | ### Other Parameters -Other parameters are passed through a pointer to a apiGetServiceLevelUsageTypesRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetUsageMetricsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - + **startMonth** | **string** | | **endMonth** | **string** | | ### Return type -[**Serviceusagetypes**](Serviceusagetypes.md) +[**Usagemetric**](Usagemetric.md) ### Authorization diff --git a/docs/ComputeAclUpdate.md b/docs/ComputeAclUpdate.md new file mode 100644 index 0000000..e133382 --- /dev/null +++ b/docs/ComputeAclUpdate.md @@ -0,0 +1,54 @@ +# ComputeACLUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Entries** | Pointer to [**[]ComputeACLUpdateEntry**](ComputeACLUpdateEntry.md) | | [optional] + +## Methods + +### NewComputeACLUpdate + +`func NewComputeACLUpdate() *ComputeACLUpdate` + +NewComputeACLUpdate instantiates a new ComputeACLUpdate 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 + +### NewComputeACLUpdateWithDefaults + +`func NewComputeACLUpdateWithDefaults() *ComputeACLUpdate` + +NewComputeACLUpdateWithDefaults instantiates a new ComputeACLUpdate 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 + +### GetEntries + +`func (o *ComputeACLUpdate) GetEntries() []ComputeACLUpdateEntry` + +GetEntries returns the Entries field if non-nil, zero value otherwise. + +### GetEntriesOk + +`func (o *ComputeACLUpdate) GetEntriesOk() (*[]ComputeACLUpdateEntry, 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 *ComputeACLUpdate) SetEntries(v []ComputeACLUpdateEntry)` + +SetEntries sets Entries field to given value. + +### HasEntries + +`func (o *ComputeACLUpdate) 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/DimensionAttributesCountryStats.md b/docs/DimensionAttributesCountryStats.md new file mode 100644 index 0000000..0226511 --- /dev/null +++ b/docs/DimensionAttributesCountryStats.md @@ -0,0 +1,106 @@ +# DimensionAttributesCountryStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CountryChr** | Pointer to **float32** | The cache hit ratio for the country. | [optional] +**CountryErrorRate** | Pointer to **float32** | The error rate for the country. | [optional] +**CountryRequestRate** | Pointer to **float32** | This country's percentage of the total requests. | [optional] + +## Methods + +### NewDimensionAttributesCountryStats + +`func NewDimensionAttributesCountryStats() *DimensionAttributesCountryStats` + +NewDimensionAttributesCountryStats instantiates a new DimensionAttributesCountryStats 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 + +### NewDimensionAttributesCountryStatsWithDefaults + +`func NewDimensionAttributesCountryStatsWithDefaults() *DimensionAttributesCountryStats` + +NewDimensionAttributesCountryStatsWithDefaults instantiates a new DimensionAttributesCountryStats 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 + +### GetCountryChr + +`func (o *DimensionAttributesCountryStats) GetCountryChr() float32` + +GetCountryChr returns the CountryChr field if non-nil, zero value otherwise. + +### GetCountryChrOk + +`func (o *DimensionAttributesCountryStats) GetCountryChrOk() (*float32, bool)` + +GetCountryChrOk returns a tuple with the CountryChr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryChr + +`func (o *DimensionAttributesCountryStats) SetCountryChr(v float32)` + +SetCountryChr sets CountryChr field to given value. + +### HasCountryChr + +`func (o *DimensionAttributesCountryStats) HasCountryChr() bool` + +HasCountryChr returns a boolean if a field has been set. + +### GetCountryErrorRate + +`func (o *DimensionAttributesCountryStats) GetCountryErrorRate() float32` + +GetCountryErrorRate returns the CountryErrorRate field if non-nil, zero value otherwise. + +### GetCountryErrorRateOk + +`func (o *DimensionAttributesCountryStats) GetCountryErrorRateOk() (*float32, bool)` + +GetCountryErrorRateOk returns a tuple with the CountryErrorRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryErrorRate + +`func (o *DimensionAttributesCountryStats) SetCountryErrorRate(v float32)` + +SetCountryErrorRate sets CountryErrorRate field to given value. + +### HasCountryErrorRate + +`func (o *DimensionAttributesCountryStats) HasCountryErrorRate() bool` + +HasCountryErrorRate returns a boolean if a field has been set. + +### GetCountryRequestRate + +`func (o *DimensionAttributesCountryStats) GetCountryRequestRate() float32` + +GetCountryRequestRate returns the CountryRequestRate field if non-nil, zero value otherwise. + +### GetCountryRequestRateOk + +`func (o *DimensionAttributesCountryStats) GetCountryRequestRateOk() (*float32, bool)` + +GetCountryRequestRateOk returns a tuple with the CountryRequestRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryRequestRate + +`func (o *DimensionAttributesCountryStats) SetCountryRequestRate(v float32)` + +SetCountryRequestRate sets CountryRequestRate field to given value. + +### HasCountryRequestRate + +`func (o *DimensionAttributesCountryStats) HasCountryRequestRate() bool` + +HasCountryRequestRate 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/DimensionAttributesRate.md b/docs/DimensionAttributesRate.md new file mode 100644 index 0000000..e933183 --- /dev/null +++ b/docs/DimensionAttributesRate.md @@ -0,0 +1,54 @@ +# DimensionAttributesRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Rate** | Pointer to **float32** | The rate at which the value in the current dimension occurs. | [optional] + +## Methods + +### NewDimensionAttributesRate + +`func NewDimensionAttributesRate() *DimensionAttributesRate` + +NewDimensionAttributesRate instantiates a new DimensionAttributesRate 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 + +### NewDimensionAttributesRateWithDefaults + +`func NewDimensionAttributesRateWithDefaults() *DimensionAttributesRate` + +NewDimensionAttributesRateWithDefaults instantiates a new DimensionAttributesRate 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 + +### GetRate + +`func (o *DimensionAttributesRate) GetRate() float32` + +GetRate returns the Rate field if non-nil, zero value otherwise. + +### GetRateOk + +`func (o *DimensionAttributesRate) GetRateOk() (*float32, bool)` + +GetRateOk returns a tuple with the Rate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRate + +`func (o *DimensionAttributesRate) SetRate(v float32)` + +SetRate sets Rate field to given value. + +### HasRate + +`func (o *DimensionAttributesRate) HasRate() bool` + +HasRate 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/DimensionBrowser.md b/docs/DimensionBrowser.md new file mode 100644 index 0000000..0223087 --- /dev/null +++ b/docs/DimensionBrowser.md @@ -0,0 +1,54 @@ +# DimensionBrowser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Browser** | Pointer to **string** | The client's browser for this dimension. | [optional] + +## Methods + +### NewDimensionBrowser + +`func NewDimensionBrowser() *DimensionBrowser` + +NewDimensionBrowser instantiates a new DimensionBrowser 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 + +### NewDimensionBrowserWithDefaults + +`func NewDimensionBrowserWithDefaults() *DimensionBrowser` + +NewDimensionBrowserWithDefaults instantiates a new DimensionBrowser 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 + +### GetBrowser + +`func (o *DimensionBrowser) GetBrowser() string` + +GetBrowser returns the Browser field if non-nil, zero value otherwise. + +### GetBrowserOk + +`func (o *DimensionBrowser) GetBrowserOk() (*string, bool)` + +GetBrowserOk returns a tuple with the Browser field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBrowser + +`func (o *DimensionBrowser) SetBrowser(v string)` + +SetBrowser sets Browser field to given value. + +### HasBrowser + +`func (o *DimensionBrowser) HasBrowser() bool` + +HasBrowser 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/DimensionContentType.md b/docs/DimensionContentType.md new file mode 100644 index 0000000..ae78c04 --- /dev/null +++ b/docs/DimensionContentType.md @@ -0,0 +1,54 @@ +# DimensionContentType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContentType** | Pointer to **string** | The content type of the response for this dimension. | [optional] + +## Methods + +### NewDimensionContentType + +`func NewDimensionContentType() *DimensionContentType` + +NewDimensionContentType instantiates a new DimensionContentType 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 + +### NewDimensionContentTypeWithDefaults + +`func NewDimensionContentTypeWithDefaults() *DimensionContentType` + +NewDimensionContentTypeWithDefaults instantiates a new DimensionContentType 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 + +### GetContentType + +`func (o *DimensionContentType) GetContentType() string` + +GetContentType returns the ContentType field if non-nil, zero value otherwise. + +### GetContentTypeOk + +`func (o *DimensionContentType) GetContentTypeOk() (*string, bool)` + +GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContentType + +`func (o *DimensionContentType) SetContentType(v string)` + +SetContentType sets ContentType field to given value. + +### HasContentType + +`func (o *DimensionContentType) HasContentType() bool` + +HasContentType 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/DimensionCountry.md b/docs/DimensionCountry.md new file mode 100644 index 0000000..c2a2a93 --- /dev/null +++ b/docs/DimensionCountry.md @@ -0,0 +1,54 @@ +# DimensionCountry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Country** | Pointer to **string** | The client's country for this dimension. | [optional] + +## Methods + +### NewDimensionCountry + +`func NewDimensionCountry() *DimensionCountry` + +NewDimensionCountry instantiates a new DimensionCountry 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 + +### NewDimensionCountryWithDefaults + +`func NewDimensionCountryWithDefaults() *DimensionCountry` + +NewDimensionCountryWithDefaults instantiates a new DimensionCountry 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 + +### GetCountry + +`func (o *DimensionCountry) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *DimensionCountry) 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 *DimensionCountry) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *DimensionCountry) HasCountry() bool` + +HasCountry 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/DimensionDevice.md b/docs/DimensionDevice.md new file mode 100644 index 0000000..1121bda --- /dev/null +++ b/docs/DimensionDevice.md @@ -0,0 +1,54 @@ +# DimensionDevice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Device** | Pointer to **string** | The client's device type for this dimension. | [optional] + +## Methods + +### NewDimensionDevice + +`func NewDimensionDevice() *DimensionDevice` + +NewDimensionDevice instantiates a new DimensionDevice 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 + +### NewDimensionDeviceWithDefaults + +`func NewDimensionDeviceWithDefaults() *DimensionDevice` + +NewDimensionDeviceWithDefaults instantiates a new DimensionDevice 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 + +### GetDevice + +`func (o *DimensionDevice) GetDevice() string` + +GetDevice returns the Device field if non-nil, zero value otherwise. + +### GetDeviceOk + +`func (o *DimensionDevice) GetDeviceOk() (*string, bool)` + +GetDeviceOk returns a tuple with the Device field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevice + +`func (o *DimensionDevice) SetDevice(v string)` + +SetDevice sets Device field to given value. + +### HasDevice + +`func (o *DimensionDevice) HasDevice() bool` + +HasDevice 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/DimensionOs.md b/docs/DimensionOs.md new file mode 100644 index 0000000..9e8ae9b --- /dev/null +++ b/docs/DimensionOs.md @@ -0,0 +1,54 @@ +# DimensionOs + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Os** | Pointer to **string** | The client's operating system for this dimension. | [optional] + +## Methods + +### NewDimensionOs + +`func NewDimensionOs() *DimensionOs` + +NewDimensionOs instantiates a new DimensionOs 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 + +### NewDimensionOsWithDefaults + +`func NewDimensionOsWithDefaults() *DimensionOs` + +NewDimensionOsWithDefaults instantiates a new DimensionOs 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 + +### GetOs + +`func (o *DimensionOs) GetOs() string` + +GetOs returns the Os field if non-nil, zero value otherwise. + +### GetOsOk + +`func (o *DimensionOs) GetOsOk() (*string, bool)` + +GetOsOk returns a tuple with the Os field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOs + +`func (o *DimensionOs) SetOs(v string)` + +SetOs sets Os field to given value. + +### HasOs + +`func (o *DimensionOs) HasOs() bool` + +HasOs 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/DimensionResponse.md b/docs/DimensionResponse.md new file mode 100644 index 0000000..c7707e9 --- /dev/null +++ b/docs/DimensionResponse.md @@ -0,0 +1,54 @@ +# DimensionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Response** | Pointer to **string** | The HTTP reason phrase for this dimension. | [optional] + +## Methods + +### NewDimensionResponse + +`func NewDimensionResponse() *DimensionResponse` + +NewDimensionResponse instantiates a new DimensionResponse 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 + +### NewDimensionResponseWithDefaults + +`func NewDimensionResponseWithDefaults() *DimensionResponse` + +NewDimensionResponseWithDefaults instantiates a new DimensionResponse 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 + +### GetResponse + +`func (o *DimensionResponse) GetResponse() string` + +GetResponse returns the Response field if non-nil, zero value otherwise. + +### GetResponseOk + +`func (o *DimensionResponse) GetResponseOk() (*string, bool)` + +GetResponseOk returns a tuple with the Response field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponse + +`func (o *DimensionResponse) SetResponse(v string)` + +SetResponse sets Response field to given value. + +### HasResponse + +`func (o *DimensionResponse) HasResponse() bool` + +HasResponse 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/DimensionStatusCode.md b/docs/DimensionStatusCode.md new file mode 100644 index 0000000..94400ab --- /dev/null +++ b/docs/DimensionStatusCode.md @@ -0,0 +1,54 @@ +# DimensionStatusCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StatusCode** | Pointer to **string** | The HTTP response code for this dimension. | [optional] + +## Methods + +### NewDimensionStatusCode + +`func NewDimensionStatusCode() *DimensionStatusCode` + +NewDimensionStatusCode instantiates a new DimensionStatusCode 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 + +### NewDimensionStatusCodeWithDefaults + +`func NewDimensionStatusCodeWithDefaults() *DimensionStatusCode` + +NewDimensionStatusCodeWithDefaults instantiates a new DimensionStatusCode 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 + +### GetStatusCode + +`func (o *DimensionStatusCode) GetStatusCode() string` + +GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. + +### GetStatusCodeOk + +`func (o *DimensionStatusCode) GetStatusCodeOk() (*string, bool)` + +GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusCode + +`func (o *DimensionStatusCode) SetStatusCode(v string)` + +SetStatusCode sets StatusCode field to given value. + +### HasStatusCode + +`func (o *DimensionStatusCode) HasStatusCode() bool` + +HasStatusCode 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/DimensionUrl.md b/docs/DimensionUrl.md new file mode 100644 index 0000000..5a38b02 --- /dev/null +++ b/docs/DimensionUrl.md @@ -0,0 +1,54 @@ +# DimensionURL + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**URL** | Pointer to **string** | The URL path for this dimension. | [optional] + +## Methods + +### NewDimensionURL + +`func NewDimensionURL() *DimensionURL` + +NewDimensionURL instantiates a new DimensionURL 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 + +### NewDimensionURLWithDefaults + +`func NewDimensionURLWithDefaults() *DimensionURL` + +NewDimensionURLWithDefaults instantiates a new DimensionURL 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 + +### GetURL + +`func (o *DimensionURL) GetURL() string` + +GetURL returns the URL field if non-nil, zero value otherwise. + +### GetURLOk + +`func (o *DimensionURL) GetURLOk() (*string, bool)` + +GetURLOk returns a tuple with the URL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetURL + +`func (o *DimensionURL) SetURL(v string)` + +SetURL sets URL field to given value. + +### HasURL + +`func (o *DimensionURL) HasURL() bool` + +HasURL 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/GetLogInsightsResponse.md b/docs/GetLogInsightsResponse.md new file mode 100644 index 0000000..52595c8 --- /dev/null +++ b/docs/GetLogInsightsResponse.md @@ -0,0 +1,80 @@ +# GetLogInsightsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**[]LogInsights**](LogInsights.md) | | [optional] +**Meta** | Pointer to [**LogInsightsMeta**](LogInsightsMeta.md) | | [optional] + +## Methods + +### NewGetLogInsightsResponse + +`func NewGetLogInsightsResponse() *GetLogInsightsResponse` + +NewGetLogInsightsResponse instantiates a new GetLogInsightsResponse 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 + +### NewGetLogInsightsResponseWithDefaults + +`func NewGetLogInsightsResponseWithDefaults() *GetLogInsightsResponse` + +NewGetLogInsightsResponseWithDefaults instantiates a new GetLogInsightsResponse 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 *GetLogInsightsResponse) GetData() []LogInsights` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *GetLogInsightsResponse) GetDataOk() (*[]LogInsights, 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 *GetLogInsightsResponse) SetData(v []LogInsights)` + +SetData sets Data field to given value. + +### HasData + +`func (o *GetLogInsightsResponse) HasData() bool` + +HasData returns a boolean if a field has been set. + +### GetMeta + +`func (o *GetLogInsightsResponse) GetMeta() LogInsightsMeta` + +GetMeta returns the Meta field if non-nil, zero value otherwise. + +### GetMetaOk + +`func (o *GetLogInsightsResponse) GetMetaOk() (*LogInsightsMeta, 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 *GetLogInsightsResponse) SetMeta(v LogInsightsMeta)` + +SetMeta sets Meta field to given value. + +### HasMeta + +`func (o *GetLogInsightsResponse) HasMeta() bool` + +HasMeta 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/InsightsAPI.md b/docs/InsightsAPI.md new file mode 100644 index 0000000..e7439dc --- /dev/null +++ b/docs/InsightsAPI.md @@ -0,0 +1,79 @@ +# InsightsAPI + +> [!NOTE] +> All URIs are relative to `https://api.fastly.com` + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetLogInsights**](InsightsAPI.md#GetLogInsights) | **GET** `/observability/log-insights` | Retrieve log insights + + + +## GetLogInsights + +Retrieve log insights + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + visualization := "visualization_example" // string | + serviceID := "serviceId_example" // string | + start := "start_example" // string | + end := "end_example" // string | + pops := "pops_example" // string | (optional) + domain := "domain_example" // string | (optional) + domainExactMatch := true // bool | (optional) + limit := float32(8.14) // float32 | (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.InsightsAPI.GetLogInsights(ctx).Visualization(visualization).ServiceID(serviceID).Start(start).End(end).Pops(pops).Domain(domain).DomainExactMatch(domainExactMatch).Limit(limit).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `InsightsAPI.GetLogInsights`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetLogInsights`: GetLogInsightsResponse + fmt.Fprintf(os.Stdout, "Response from `InsightsAPI.GetLogInsights`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetLogInsightsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **visualization** | **string** | | **serviceID** | **string** | | **start** | **string** | | **end** | **string** | | **pops** | **string** | | **domain** | **string** | | **domainExactMatch** | **bool** | | **limit** | **float32** | | + +### Return type + +[**GetLogInsightsResponse**](GetLogInsightsResponse.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) diff --git a/docs/KvStoreItemAPI.md b/docs/KvStoreItemAPI.md index a5362d5..0441cde 100644 --- a/docs/KvStoreItemAPI.md +++ b/docs/KvStoreItemAPI.md @@ -102,11 +102,12 @@ func main() { cursor := "cursor_example" // string | (optional) limit := int32(56) // int32 | (optional) (default to 100) prefix := "prefix_example" // string | (optional) + consistency := "consistency_example" // string | (optional) cfg := fastly.NewConfiguration() apiClient := fastly.NewAPIClient(cfg) ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") - resp, r, err := apiClient.KvStoreItemAPI.GetKeys(ctx, storeID).Cursor(cursor).Limit(limit).Prefix(prefix).Execute() + resp, r, err := apiClient.KvStoreItemAPI.GetKeys(ctx, storeID).Cursor(cursor).Limit(limit).Prefix(prefix).Consistency(consistency).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `KvStoreItemAPI.GetKeys`: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) @@ -131,7 +132,7 @@ Other parameters are passed through a pointer to a apiGetKeysRequest struct via Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **cursor** | **string** | | **limit** | **int32** | | [default to 100] **prefix** | **string** | | + **cursor** | **string** | | **limit** | **int32** | | [default to 100] **prefix** | **string** | | **consistency** | **string** | | ### Return type diff --git a/docs/LogInsights.md b/docs/LogInsights.md new file mode 100644 index 0000000..b0ed064 --- /dev/null +++ b/docs/LogInsights.md @@ -0,0 +1,106 @@ +# LogInsights + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Dimensions** | Pointer to [**LogInsightsDimensions**](LogInsightsDimensions.md) | | [optional] +**DimensionAttributes** | Pointer to [**LogInsightsDimensionAttributes**](LogInsightsDimensionAttributes.md) | | [optional] +**Values** | Pointer to [**LogInsightsValues**](LogInsightsValues.md) | | [optional] + +## Methods + +### NewLogInsights + +`func NewLogInsights() *LogInsights` + +NewLogInsights instantiates a new LogInsights 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 + +### NewLogInsightsWithDefaults + +`func NewLogInsightsWithDefaults() *LogInsights` + +NewLogInsightsWithDefaults instantiates a new LogInsights 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 + +### GetDimensions + +`func (o *LogInsights) GetDimensions() LogInsightsDimensions` + +GetDimensions returns the Dimensions field if non-nil, zero value otherwise. + +### GetDimensionsOk + +`func (o *LogInsights) GetDimensionsOk() (*LogInsightsDimensions, bool)` + +GetDimensionsOk returns a tuple with the Dimensions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDimensions + +`func (o *LogInsights) SetDimensions(v LogInsightsDimensions)` + +SetDimensions sets Dimensions field to given value. + +### HasDimensions + +`func (o *LogInsights) HasDimensions() bool` + +HasDimensions returns a boolean if a field has been set. + +### GetDimensionAttributes + +`func (o *LogInsights) GetDimensionAttributes() LogInsightsDimensionAttributes` + +GetDimensionAttributes returns the DimensionAttributes field if non-nil, zero value otherwise. + +### GetDimensionAttributesOk + +`func (o *LogInsights) GetDimensionAttributesOk() (*LogInsightsDimensionAttributes, bool)` + +GetDimensionAttributesOk returns a tuple with the DimensionAttributes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDimensionAttributes + +`func (o *LogInsights) SetDimensionAttributes(v LogInsightsDimensionAttributes)` + +SetDimensionAttributes sets DimensionAttributes field to given value. + +### HasDimensionAttributes + +`func (o *LogInsights) HasDimensionAttributes() bool` + +HasDimensionAttributes returns a boolean if a field has been set. + +### GetValues + +`func (o *LogInsights) GetValues() LogInsightsValues` + +GetValues returns the Values field if non-nil, zero value otherwise. + +### GetValuesOk + +`func (o *LogInsights) GetValuesOk() (*LogInsightsValues, bool)` + +GetValuesOk returns a tuple with the Values field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValues + +`func (o *LogInsights) SetValues(v LogInsightsValues)` + +SetValues sets Values field to given value. + +### HasValues + +`func (o *LogInsights) HasValues() bool` + +HasValues 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/LogInsightsDimensionAttributes.md b/docs/LogInsightsDimensionAttributes.md new file mode 100644 index 0000000..d358de8 --- /dev/null +++ b/docs/LogInsightsDimensionAttributes.md @@ -0,0 +1,132 @@ +# LogInsightsDimensionAttributes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Rate** | Pointer to **float32** | The rate at which the value in the current dimension occurs. | [optional] +**CountryChr** | Pointer to **float32** | The cache hit ratio for the country. | [optional] +**CountryErrorRate** | Pointer to **float32** | The error rate for the country. | [optional] +**CountryRequestRate** | Pointer to **float32** | This country's percentage of the total requests. | [optional] + +## Methods + +### NewLogInsightsDimensionAttributes + +`func NewLogInsightsDimensionAttributes() *LogInsightsDimensionAttributes` + +NewLogInsightsDimensionAttributes instantiates a new LogInsightsDimensionAttributes 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 + +### NewLogInsightsDimensionAttributesWithDefaults + +`func NewLogInsightsDimensionAttributesWithDefaults() *LogInsightsDimensionAttributes` + +NewLogInsightsDimensionAttributesWithDefaults instantiates a new LogInsightsDimensionAttributes 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 + +### GetRate + +`func (o *LogInsightsDimensionAttributes) GetRate() float32` + +GetRate returns the Rate field if non-nil, zero value otherwise. + +### GetRateOk + +`func (o *LogInsightsDimensionAttributes) GetRateOk() (*float32, bool)` + +GetRateOk returns a tuple with the Rate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRate + +`func (o *LogInsightsDimensionAttributes) SetRate(v float32)` + +SetRate sets Rate field to given value. + +### HasRate + +`func (o *LogInsightsDimensionAttributes) HasRate() bool` + +HasRate returns a boolean if a field has been set. + +### GetCountryChr + +`func (o *LogInsightsDimensionAttributes) GetCountryChr() float32` + +GetCountryChr returns the CountryChr field if non-nil, zero value otherwise. + +### GetCountryChrOk + +`func (o *LogInsightsDimensionAttributes) GetCountryChrOk() (*float32, bool)` + +GetCountryChrOk returns a tuple with the CountryChr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryChr + +`func (o *LogInsightsDimensionAttributes) SetCountryChr(v float32)` + +SetCountryChr sets CountryChr field to given value. + +### HasCountryChr + +`func (o *LogInsightsDimensionAttributes) HasCountryChr() bool` + +HasCountryChr returns a boolean if a field has been set. + +### GetCountryErrorRate + +`func (o *LogInsightsDimensionAttributes) GetCountryErrorRate() float32` + +GetCountryErrorRate returns the CountryErrorRate field if non-nil, zero value otherwise. + +### GetCountryErrorRateOk + +`func (o *LogInsightsDimensionAttributes) GetCountryErrorRateOk() (*float32, bool)` + +GetCountryErrorRateOk returns a tuple with the CountryErrorRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryErrorRate + +`func (o *LogInsightsDimensionAttributes) SetCountryErrorRate(v float32)` + +SetCountryErrorRate sets CountryErrorRate field to given value. + +### HasCountryErrorRate + +`func (o *LogInsightsDimensionAttributes) HasCountryErrorRate() bool` + +HasCountryErrorRate returns a boolean if a field has been set. + +### GetCountryRequestRate + +`func (o *LogInsightsDimensionAttributes) GetCountryRequestRate() float32` + +GetCountryRequestRate returns the CountryRequestRate field if non-nil, zero value otherwise. + +### GetCountryRequestRateOk + +`func (o *LogInsightsDimensionAttributes) GetCountryRequestRateOk() (*float32, bool)` + +GetCountryRequestRateOk returns a tuple with the CountryRequestRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCountryRequestRate + +`func (o *LogInsightsDimensionAttributes) SetCountryRequestRate(v float32)` + +SetCountryRequestRate sets CountryRequestRate field to given value. + +### HasCountryRequestRate + +`func (o *LogInsightsDimensionAttributes) HasCountryRequestRate() bool` + +HasCountryRequestRate 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/LogInsightsDimensions.md b/docs/LogInsightsDimensions.md new file mode 100644 index 0000000..de446a5 --- /dev/null +++ b/docs/LogInsightsDimensions.md @@ -0,0 +1,236 @@ +# LogInsightsDimensions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**URL** | Pointer to **string** | The URL path for this dimension. | [optional] +**Country** | Pointer to **string** | The client's country for this dimension. | [optional] +**StatusCode** | Pointer to **string** | The HTTP response code for this dimension. | [optional] +**Response** | Pointer to **string** | The HTTP reason phrase for this dimension. | [optional] +**Browser** | Pointer to **string** | The client's browser for this dimension. | [optional] +**ContentType** | Pointer to **string** | The content type of the response for this dimension. | [optional] +**Device** | Pointer to **string** | The client's device type for this dimension. | [optional] +**Os** | Pointer to **string** | The client's operating system for this dimension. | [optional] + +## Methods + +### NewLogInsightsDimensions + +`func NewLogInsightsDimensions() *LogInsightsDimensions` + +NewLogInsightsDimensions instantiates a new LogInsightsDimensions 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 + +### NewLogInsightsDimensionsWithDefaults + +`func NewLogInsightsDimensionsWithDefaults() *LogInsightsDimensions` + +NewLogInsightsDimensionsWithDefaults instantiates a new LogInsightsDimensions 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 + +### GetURL + +`func (o *LogInsightsDimensions) GetURL() string` + +GetURL returns the URL field if non-nil, zero value otherwise. + +### GetURLOk + +`func (o *LogInsightsDimensions) GetURLOk() (*string, bool)` + +GetURLOk returns a tuple with the URL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetURL + +`func (o *LogInsightsDimensions) SetURL(v string)` + +SetURL sets URL field to given value. + +### HasURL + +`func (o *LogInsightsDimensions) HasURL() bool` + +HasURL returns a boolean if a field has been set. + +### GetCountry + +`func (o *LogInsightsDimensions) GetCountry() string` + +GetCountry returns the Country field if non-nil, zero value otherwise. + +### GetCountryOk + +`func (o *LogInsightsDimensions) 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 *LogInsightsDimensions) SetCountry(v string)` + +SetCountry sets Country field to given value. + +### HasCountry + +`func (o *LogInsightsDimensions) HasCountry() bool` + +HasCountry returns a boolean if a field has been set. + +### GetStatusCode + +`func (o *LogInsightsDimensions) GetStatusCode() string` + +GetStatusCode returns the StatusCode field if non-nil, zero value otherwise. + +### GetStatusCodeOk + +`func (o *LogInsightsDimensions) GetStatusCodeOk() (*string, bool)` + +GetStatusCodeOk returns a tuple with the StatusCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatusCode + +`func (o *LogInsightsDimensions) SetStatusCode(v string)` + +SetStatusCode sets StatusCode field to given value. + +### HasStatusCode + +`func (o *LogInsightsDimensions) HasStatusCode() bool` + +HasStatusCode returns a boolean if a field has been set. + +### GetResponse + +`func (o *LogInsightsDimensions) GetResponse() string` + +GetResponse returns the Response field if non-nil, zero value otherwise. + +### GetResponseOk + +`func (o *LogInsightsDimensions) GetResponseOk() (*string, bool)` + +GetResponseOk returns a tuple with the Response field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponse + +`func (o *LogInsightsDimensions) SetResponse(v string)` + +SetResponse sets Response field to given value. + +### HasResponse + +`func (o *LogInsightsDimensions) HasResponse() bool` + +HasResponse returns a boolean if a field has been set. + +### GetBrowser + +`func (o *LogInsightsDimensions) GetBrowser() string` + +GetBrowser returns the Browser field if non-nil, zero value otherwise. + +### GetBrowserOk + +`func (o *LogInsightsDimensions) GetBrowserOk() (*string, bool)` + +GetBrowserOk returns a tuple with the Browser field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBrowser + +`func (o *LogInsightsDimensions) SetBrowser(v string)` + +SetBrowser sets Browser field to given value. + +### HasBrowser + +`func (o *LogInsightsDimensions) HasBrowser() bool` + +HasBrowser returns a boolean if a field has been set. + +### GetContentType + +`func (o *LogInsightsDimensions) GetContentType() string` + +GetContentType returns the ContentType field if non-nil, zero value otherwise. + +### GetContentTypeOk + +`func (o *LogInsightsDimensions) GetContentTypeOk() (*string, bool)` + +GetContentTypeOk returns a tuple with the ContentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContentType + +`func (o *LogInsightsDimensions) SetContentType(v string)` + +SetContentType sets ContentType field to given value. + +### HasContentType + +`func (o *LogInsightsDimensions) HasContentType() bool` + +HasContentType returns a boolean if a field has been set. + +### GetDevice + +`func (o *LogInsightsDimensions) GetDevice() string` + +GetDevice returns the Device field if non-nil, zero value otherwise. + +### GetDeviceOk + +`func (o *LogInsightsDimensions) GetDeviceOk() (*string, bool)` + +GetDeviceOk returns a tuple with the Device field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDevice + +`func (o *LogInsightsDimensions) SetDevice(v string)` + +SetDevice sets Device field to given value. + +### HasDevice + +`func (o *LogInsightsDimensions) HasDevice() bool` + +HasDevice returns a boolean if a field has been set. + +### GetOs + +`func (o *LogInsightsDimensions) GetOs() string` + +GetOs returns the Os field if non-nil, zero value otherwise. + +### GetOsOk + +`func (o *LogInsightsDimensions) GetOsOk() (*string, bool)` + +GetOsOk returns a tuple with the Os field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOs + +`func (o *LogInsightsDimensions) SetOs(v string)` + +SetOs sets Os field to given value. + +### HasOs + +`func (o *LogInsightsDimensions) HasOs() bool` + +HasOs 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/LogInsightsMeta.md b/docs/LogInsightsMeta.md new file mode 100644 index 0000000..646f907 --- /dev/null +++ b/docs/LogInsightsMeta.md @@ -0,0 +1,54 @@ +# LogInsightsMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Filters** | Pointer to [**LogInsightsMetaFilter**](LogInsightsMetaFilter.md) | | [optional] + +## Methods + +### NewLogInsightsMeta + +`func NewLogInsightsMeta() *LogInsightsMeta` + +NewLogInsightsMeta instantiates a new LogInsightsMeta 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 + +### NewLogInsightsMetaWithDefaults + +`func NewLogInsightsMetaWithDefaults() *LogInsightsMeta` + +NewLogInsightsMetaWithDefaults instantiates a new LogInsightsMeta 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 + +### GetFilters + +`func (o *LogInsightsMeta) GetFilters() LogInsightsMetaFilter` + +GetFilters returns the Filters field if non-nil, zero value otherwise. + +### GetFiltersOk + +`func (o *LogInsightsMeta) GetFiltersOk() (*LogInsightsMetaFilter, bool)` + +GetFiltersOk returns a tuple with the Filters field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFilters + +`func (o *LogInsightsMeta) SetFilters(v LogInsightsMetaFilter)` + +SetFilters sets Filters field to given value. + +### HasFilters + +`func (o *LogInsightsMeta) HasFilters() bool` + +HasFilters 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/LogInsightsMetaFilter.md b/docs/LogInsightsMetaFilter.md new file mode 100644 index 0000000..969d2ed --- /dev/null +++ b/docs/LogInsightsMetaFilter.md @@ -0,0 +1,158 @@ +# LogInsightsMetaFilter + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ServiceID** | Pointer to **string** | Specifies the ID of the service for which data should be returned. | [optional] +**Start** | Pointer to **string** | Start time for the query as supplied in the request. | [optional] +**End** | Pointer to **string** | End time for the query as supplied in the request. | [optional] +**DomainExactMatch** | Pointer to **bool** | Value of the `domain_exact_match` filter as supplied in the request. | [optional] +**Limit** | Pointer to **int32** | Number of records per page. | [optional] [default to 20] + +## Methods + +### NewLogInsightsMetaFilter + +`func NewLogInsightsMetaFilter() *LogInsightsMetaFilter` + +NewLogInsightsMetaFilter instantiates a new LogInsightsMetaFilter 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 + +### NewLogInsightsMetaFilterWithDefaults + +`func NewLogInsightsMetaFilterWithDefaults() *LogInsightsMetaFilter` + +NewLogInsightsMetaFilterWithDefaults instantiates a new LogInsightsMetaFilter 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 + +### GetServiceID + +`func (o *LogInsightsMetaFilter) GetServiceID() string` + +GetServiceID returns the ServiceID field if non-nil, zero value otherwise. + +### GetServiceIDOk + +`func (o *LogInsightsMetaFilter) 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 *LogInsightsMetaFilter) SetServiceID(v string)` + +SetServiceID sets ServiceID field to given value. + +### HasServiceID + +`func (o *LogInsightsMetaFilter) HasServiceID() bool` + +HasServiceID returns a boolean if a field has been set. + +### GetStart + +`func (o *LogInsightsMetaFilter) GetStart() string` + +GetStart returns the Start field if non-nil, zero value otherwise. + +### GetStartOk + +`func (o *LogInsightsMetaFilter) GetStartOk() (*string, bool)` + +GetStartOk returns a tuple with the Start field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStart + +`func (o *LogInsightsMetaFilter) SetStart(v string)` + +SetStart sets Start field to given value. + +### HasStart + +`func (o *LogInsightsMetaFilter) HasStart() bool` + +HasStart returns a boolean if a field has been set. + +### GetEnd + +`func (o *LogInsightsMetaFilter) GetEnd() string` + +GetEnd returns the End field if non-nil, zero value otherwise. + +### GetEndOk + +`func (o *LogInsightsMetaFilter) GetEndOk() (*string, bool)` + +GetEndOk returns a tuple with the End field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEnd + +`func (o *LogInsightsMetaFilter) SetEnd(v string)` + +SetEnd sets End field to given value. + +### HasEnd + +`func (o *LogInsightsMetaFilter) HasEnd() bool` + +HasEnd returns a boolean if a field has been set. + +### GetDomainExactMatch + +`func (o *LogInsightsMetaFilter) GetDomainExactMatch() bool` + +GetDomainExactMatch returns the DomainExactMatch field if non-nil, zero value otherwise. + +### GetDomainExactMatchOk + +`func (o *LogInsightsMetaFilter) GetDomainExactMatchOk() (*bool, bool)` + +GetDomainExactMatchOk returns a tuple with the DomainExactMatch field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDomainExactMatch + +`func (o *LogInsightsMetaFilter) SetDomainExactMatch(v bool)` + +SetDomainExactMatch sets DomainExactMatch field to given value. + +### HasDomainExactMatch + +`func (o *LogInsightsMetaFilter) HasDomainExactMatch() bool` + +HasDomainExactMatch returns a boolean if a field has been set. + +### GetLimit + +`func (o *LogInsightsMetaFilter) GetLimit() int32` + +GetLimit returns the Limit field if non-nil, zero value otherwise. + +### GetLimitOk + +`func (o *LogInsightsMetaFilter) GetLimitOk() (*int32, 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 *LogInsightsMetaFilter) SetLimit(v int32)` + +SetLimit sets Limit field to given value. + +### HasLimit + +`func (o *LogInsightsMetaFilter) HasLimit() bool` + +HasLimit 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/LogInsightsValues.md b/docs/LogInsightsValues.md new file mode 100644 index 0000000..a20b231 --- /dev/null +++ b/docs/LogInsightsValues.md @@ -0,0 +1,470 @@ +# LogInsightsValues + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CacheHitRatio** | Pointer to **float32** | The cache hit ratio for the URL specified in the dimension. | [optional] +**Region** | Pointer to **string** | The client's country subdivision code as defined by ISO 3166-2. | [optional] +**RegionChr** | Pointer to **float32** | The cache hit ratio for the region. | [optional] +**RegionErrorRate** | Pointer to **float32** | The error rate for the region. | [optional] +**URL** | Pointer to **string** | The HTTP request path. | [optional] +**RatePerStatus** | Pointer to **float32** | The URL accounts for this percentage of the status code in this dimension. | [optional] +**RatePerURL** | Pointer to **float32** | The rate at which the reason in this dimension occurs among responses to this URL with a 503 status code. | [optional] +**Var503RatePerURL** | Pointer to **float32** | The rate at which 503 status codes are returned for this URL. | [optional] +**BrowserVersion** | Pointer to **string** | The version of the client's browser. | [optional] +**Rate** | Pointer to **float32** | The percentage of requests matching the value in the current dimension. | [optional] +**AverageBandwidthBytes** | Pointer to **float32** | The average bandwidth in bytes for responses to requests to the URL in the current dimension. | [optional] +**BandwidthPercentage** | Pointer to **float32** | The total bandwidth percentage for all responses to requests to the URL in the current dimension. | [optional] +**AverageResponseTime** | Pointer to **float32** | The average time in seconds to respond to requests to the URL in the current dimension. | [optional] +**P95ResponseTime** | Pointer to **float32** | The P95 time in seconds to respond to requests to the URL in the current dimension. | [optional] +**ResponseTimePercentage** | Pointer to **float32** | The total percentage of time to respond to all requests to the URL in the current dimension. | [optional] +**MissRate** | Pointer to **float32** | The miss rate for requests to the URL in the current dimension. | [optional] +**RequestPercentage** | Pointer to **float32** | The percentage of all requests made to the URL in the current dimension. | [optional] + +## Methods + +### NewLogInsightsValues + +`func NewLogInsightsValues() *LogInsightsValues` + +NewLogInsightsValues instantiates a new LogInsightsValues 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 + +### NewLogInsightsValuesWithDefaults + +`func NewLogInsightsValuesWithDefaults() *LogInsightsValues` + +NewLogInsightsValuesWithDefaults instantiates a new LogInsightsValues 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 + +### GetCacheHitRatio + +`func (o *LogInsightsValues) GetCacheHitRatio() float32` + +GetCacheHitRatio returns the CacheHitRatio field if non-nil, zero value otherwise. + +### GetCacheHitRatioOk + +`func (o *LogInsightsValues) GetCacheHitRatioOk() (*float32, bool)` + +GetCacheHitRatioOk returns a tuple with the CacheHitRatio field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCacheHitRatio + +`func (o *LogInsightsValues) SetCacheHitRatio(v float32)` + +SetCacheHitRatio sets CacheHitRatio field to given value. + +### HasCacheHitRatio + +`func (o *LogInsightsValues) HasCacheHitRatio() bool` + +HasCacheHitRatio returns a boolean if a field has been set. + +### GetRegion + +`func (o *LogInsightsValues) GetRegion() string` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *LogInsightsValues) 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 *LogInsightsValues) SetRegion(v string)` + +SetRegion sets Region field to given value. + +### HasRegion + +`func (o *LogInsightsValues) HasRegion() bool` + +HasRegion returns a boolean if a field has been set. + +### GetRegionChr + +`func (o *LogInsightsValues) GetRegionChr() float32` + +GetRegionChr returns the RegionChr field if non-nil, zero value otherwise. + +### GetRegionChrOk + +`func (o *LogInsightsValues) GetRegionChrOk() (*float32, bool)` + +GetRegionChrOk returns a tuple with the RegionChr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegionChr + +`func (o *LogInsightsValues) SetRegionChr(v float32)` + +SetRegionChr sets RegionChr field to given value. + +### HasRegionChr + +`func (o *LogInsightsValues) HasRegionChr() bool` + +HasRegionChr returns a boolean if a field has been set. + +### GetRegionErrorRate + +`func (o *LogInsightsValues) GetRegionErrorRate() float32` + +GetRegionErrorRate returns the RegionErrorRate field if non-nil, zero value otherwise. + +### GetRegionErrorRateOk + +`func (o *LogInsightsValues) GetRegionErrorRateOk() (*float32, bool)` + +GetRegionErrorRateOk returns a tuple with the RegionErrorRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegionErrorRate + +`func (o *LogInsightsValues) SetRegionErrorRate(v float32)` + +SetRegionErrorRate sets RegionErrorRate field to given value. + +### HasRegionErrorRate + +`func (o *LogInsightsValues) HasRegionErrorRate() bool` + +HasRegionErrorRate returns a boolean if a field has been set. + +### GetURL + +`func (o *LogInsightsValues) GetURL() string` + +GetURL returns the URL field if non-nil, zero value otherwise. + +### GetURLOk + +`func (o *LogInsightsValues) GetURLOk() (*string, bool)` + +GetURLOk returns a tuple with the URL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetURL + +`func (o *LogInsightsValues) SetURL(v string)` + +SetURL sets URL field to given value. + +### HasURL + +`func (o *LogInsightsValues) HasURL() bool` + +HasURL returns a boolean if a field has been set. + +### GetRatePerStatus + +`func (o *LogInsightsValues) GetRatePerStatus() float32` + +GetRatePerStatus returns the RatePerStatus field if non-nil, zero value otherwise. + +### GetRatePerStatusOk + +`func (o *LogInsightsValues) GetRatePerStatusOk() (*float32, bool)` + +GetRatePerStatusOk returns a tuple with the RatePerStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRatePerStatus + +`func (o *LogInsightsValues) SetRatePerStatus(v float32)` + +SetRatePerStatus sets RatePerStatus field to given value. + +### HasRatePerStatus + +`func (o *LogInsightsValues) HasRatePerStatus() bool` + +HasRatePerStatus returns a boolean if a field has been set. + +### GetRatePerURL + +`func (o *LogInsightsValues) GetRatePerURL() float32` + +GetRatePerURL returns the RatePerURL field if non-nil, zero value otherwise. + +### GetRatePerURLOk + +`func (o *LogInsightsValues) GetRatePerURLOk() (*float32, bool)` + +GetRatePerURLOk returns a tuple with the RatePerURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRatePerURL + +`func (o *LogInsightsValues) SetRatePerURL(v float32)` + +SetRatePerURL sets RatePerURL field to given value. + +### HasRatePerURL + +`func (o *LogInsightsValues) HasRatePerURL() bool` + +HasRatePerURL returns a boolean if a field has been set. + +### GetVar503RatePerURL + +`func (o *LogInsightsValues) GetVar503RatePerURL() float32` + +GetVar503RatePerURL returns the Var503RatePerURL field if non-nil, zero value otherwise. + +### GetVar503RatePerURLOk + +`func (o *LogInsightsValues) GetVar503RatePerURLOk() (*float32, bool)` + +GetVar503RatePerURLOk returns a tuple with the Var503RatePerURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVar503RatePerURL + +`func (o *LogInsightsValues) SetVar503RatePerURL(v float32)` + +SetVar503RatePerURL sets Var503RatePerURL field to given value. + +### HasVar503RatePerURL + +`func (o *LogInsightsValues) HasVar503RatePerURL() bool` + +HasVar503RatePerURL returns a boolean if a field has been set. + +### GetBrowserVersion + +`func (o *LogInsightsValues) GetBrowserVersion() string` + +GetBrowserVersion returns the BrowserVersion field if non-nil, zero value otherwise. + +### GetBrowserVersionOk + +`func (o *LogInsightsValues) GetBrowserVersionOk() (*string, bool)` + +GetBrowserVersionOk returns a tuple with the BrowserVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBrowserVersion + +`func (o *LogInsightsValues) SetBrowserVersion(v string)` + +SetBrowserVersion sets BrowserVersion field to given value. + +### HasBrowserVersion + +`func (o *LogInsightsValues) HasBrowserVersion() bool` + +HasBrowserVersion returns a boolean if a field has been set. + +### GetRate + +`func (o *LogInsightsValues) GetRate() float32` + +GetRate returns the Rate field if non-nil, zero value otherwise. + +### GetRateOk + +`func (o *LogInsightsValues) GetRateOk() (*float32, bool)` + +GetRateOk returns a tuple with the Rate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRate + +`func (o *LogInsightsValues) SetRate(v float32)` + +SetRate sets Rate field to given value. + +### HasRate + +`func (o *LogInsightsValues) HasRate() bool` + +HasRate returns a boolean if a field has been set. + +### GetAverageBandwidthBytes + +`func (o *LogInsightsValues) GetAverageBandwidthBytes() float32` + +GetAverageBandwidthBytes returns the AverageBandwidthBytes field if non-nil, zero value otherwise. + +### GetAverageBandwidthBytesOk + +`func (o *LogInsightsValues) GetAverageBandwidthBytesOk() (*float32, bool)` + +GetAverageBandwidthBytesOk returns a tuple with the AverageBandwidthBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAverageBandwidthBytes + +`func (o *LogInsightsValues) SetAverageBandwidthBytes(v float32)` + +SetAverageBandwidthBytes sets AverageBandwidthBytes field to given value. + +### HasAverageBandwidthBytes + +`func (o *LogInsightsValues) HasAverageBandwidthBytes() bool` + +HasAverageBandwidthBytes returns a boolean if a field has been set. + +### GetBandwidthPercentage + +`func (o *LogInsightsValues) GetBandwidthPercentage() float32` + +GetBandwidthPercentage returns the BandwidthPercentage field if non-nil, zero value otherwise. + +### GetBandwidthPercentageOk + +`func (o *LogInsightsValues) GetBandwidthPercentageOk() (*float32, bool)` + +GetBandwidthPercentageOk returns a tuple with the BandwidthPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBandwidthPercentage + +`func (o *LogInsightsValues) SetBandwidthPercentage(v float32)` + +SetBandwidthPercentage sets BandwidthPercentage field to given value. + +### HasBandwidthPercentage + +`func (o *LogInsightsValues) HasBandwidthPercentage() bool` + +HasBandwidthPercentage returns a boolean if a field has been set. + +### GetAverageResponseTime + +`func (o *LogInsightsValues) GetAverageResponseTime() float32` + +GetAverageResponseTime returns the AverageResponseTime field if non-nil, zero value otherwise. + +### GetAverageResponseTimeOk + +`func (o *LogInsightsValues) GetAverageResponseTimeOk() (*float32, bool)` + +GetAverageResponseTimeOk returns a tuple with the AverageResponseTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAverageResponseTime + +`func (o *LogInsightsValues) SetAverageResponseTime(v float32)` + +SetAverageResponseTime sets AverageResponseTime field to given value. + +### HasAverageResponseTime + +`func (o *LogInsightsValues) HasAverageResponseTime() bool` + +HasAverageResponseTime returns a boolean if a field has been set. + +### GetP95ResponseTime + +`func (o *LogInsightsValues) GetP95ResponseTime() float32` + +GetP95ResponseTime returns the P95ResponseTime field if non-nil, zero value otherwise. + +### GetP95ResponseTimeOk + +`func (o *LogInsightsValues) GetP95ResponseTimeOk() (*float32, bool)` + +GetP95ResponseTimeOk returns a tuple with the P95ResponseTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetP95ResponseTime + +`func (o *LogInsightsValues) SetP95ResponseTime(v float32)` + +SetP95ResponseTime sets P95ResponseTime field to given value. + +### HasP95ResponseTime + +`func (o *LogInsightsValues) HasP95ResponseTime() bool` + +HasP95ResponseTime returns a boolean if a field has been set. + +### GetResponseTimePercentage + +`func (o *LogInsightsValues) GetResponseTimePercentage() float32` + +GetResponseTimePercentage returns the ResponseTimePercentage field if non-nil, zero value otherwise. + +### GetResponseTimePercentageOk + +`func (o *LogInsightsValues) GetResponseTimePercentageOk() (*float32, bool)` + +GetResponseTimePercentageOk returns a tuple with the ResponseTimePercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponseTimePercentage + +`func (o *LogInsightsValues) SetResponseTimePercentage(v float32)` + +SetResponseTimePercentage sets ResponseTimePercentage field to given value. + +### HasResponseTimePercentage + +`func (o *LogInsightsValues) HasResponseTimePercentage() bool` + +HasResponseTimePercentage returns a boolean if a field has been set. + +### GetMissRate + +`func (o *LogInsightsValues) GetMissRate() float32` + +GetMissRate returns the MissRate field if non-nil, zero value otherwise. + +### GetMissRateOk + +`func (o *LogInsightsValues) GetMissRateOk() (*float32, bool)` + +GetMissRateOk returns a tuple with the MissRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMissRate + +`func (o *LogInsightsValues) SetMissRate(v float32)` + +SetMissRate sets MissRate field to given value. + +### HasMissRate + +`func (o *LogInsightsValues) HasMissRate() bool` + +HasMissRate returns a boolean if a field has been set. + +### GetRequestPercentage + +`func (o *LogInsightsValues) GetRequestPercentage() float32` + +GetRequestPercentage returns the RequestPercentage field if non-nil, zero value otherwise. + +### GetRequestPercentageOk + +`func (o *LogInsightsValues) GetRequestPercentageOk() (*float32, bool)` + +GetRequestPercentageOk returns a tuple with the RequestPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestPercentage + +`func (o *LogInsightsValues) SetRequestPercentage(v float32)` + +SetRequestPercentage sets RequestPercentage field to given value. + +### HasRequestPercentage + +`func (o *LogInsightsValues) HasRequestPercentage() bool` + +HasRequestPercentage 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/LoggingGrafanacloudlogsAPI.md b/docs/LoggingGrafanacloudlogsAPI.md new file mode 100644 index 0000000..7011bed --- /dev/null +++ b/docs/LoggingGrafanacloudlogsAPI.md @@ -0,0 +1,382 @@ +# LoggingGrafanacloudlogsAPI + +> [!NOTE] +> All URIs are relative to `https://api.fastly.com` + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateLogGrafanacloudlogs**](LoggingGrafanacloudlogsAPI.md#CreateLogGrafanacloudlogs) | **POST** `/service/{service_id}/version/{version_id}/logging/grafanacloudlogs` | Create a Grafana Cloud Logs log endpoint +[**DeleteLogGrafanacloudlogs**](LoggingGrafanacloudlogsAPI.md#DeleteLogGrafanacloudlogs) | **DELETE** `/service/{service_id}/version/{version_id}/logging/grafanacloudlogs/{logging_grafanacloudlogs_name}` | Delete the Grafana Cloud Logs log endpoint +[**GetLogGrafanacloudlogs**](LoggingGrafanacloudlogsAPI.md#GetLogGrafanacloudlogs) | **GET** `/service/{service_id}/version/{version_id}/logging/grafanacloudlogs/{logging_grafanacloudlogs_name}` | Get a Grafana Cloud Logs log endpoint +[**ListLogGrafanacloudlogs**](LoggingGrafanacloudlogsAPI.md#ListLogGrafanacloudlogs) | **GET** `/service/{service_id}/version/{version_id}/logging/grafanacloudlogs` | List Grafana Cloud Logs log endpoints +[**UpdateLogGrafanacloudlogs**](LoggingGrafanacloudlogsAPI.md#UpdateLogGrafanacloudlogs) | **PUT** `/service/{service_id}/version/{version_id}/logging/grafanacloudlogs/{logging_grafanacloudlogs_name}` | Update a Grafana Cloud Logs log endpoint + + + +## CreateLogGrafanacloudlogs + +Create a Grafana Cloud Logs log endpoint + + + +### 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. + name := "name_example" // string | The name for the real-time logging configuration. (optional) + placement := "placement_example" // string | Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. (optional) + responseCondition := "responseCondition_example" // string | The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional) + format := "format_example" // string | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (optional) + formatVersion := int32(56) // int32 | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional) (default to 2) + user := "user_example" // string | The Grafana Cloud Logs Dataset you want to log to. (optional) + url := "url_example" // string | The URL of the Loki instance in your Grafana stack. (optional) + token := "token_example" // string | The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. (optional) + index := "index_example" // string | The Stream Labels, a JSON string used to identify the stream. (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.LoggingGrafanacloudlogsAPI.CreateLogGrafanacloudlogs(ctx, serviceID, versionID).Name(name).Placement(placement).ResponseCondition(responseCondition).Format(format).FormatVersion(formatVersion).User(user).URL(url).Token(token).Index(index).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LoggingGrafanacloudlogsAPI.CreateLogGrafanacloudlogs`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateLogGrafanacloudlogs`: LoggingGrafanacloudlogsResponse + fmt.Fprintf(os.Stdout, "Response from `LoggingGrafanacloudlogsAPI.CreateLogGrafanacloudlogs`: %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. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateLogGrafanacloudlogsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **string** | The name for the real-time logging configuration. | **placement** | **string** | Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. | **responseCondition** | **string** | The name of an existing condition in the configured endpoint, or leave blank to always execute. | **format** | **string** | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | **formatVersion** | **int32** | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. | [default to 2] **user** | **string** | The Grafana Cloud Logs Dataset you want to log to. | **url** | **string** | The URL of the Loki instance in your Grafana stack. | **token** | **string** | The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. | **index** | **string** | The Stream Labels, a JSON string used to identify the stream. | + +### Return type + +[**LoggingGrafanacloudlogsResponse**](LoggingGrafanacloudlogsResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[Back to top](#) | [Back to API list](../README.md#documentation-for-api-endpoints) | [Back to README](../README.md) + + +## DeleteLogGrafanacloudlogs + +Delete the Grafana Cloud Logs log endpoint + + + +### 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. + loggingGrafanacloudlogsName := "loggingGrafanacloudlogsName_example" // string | The name for the real-time logging configuration. + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.LoggingGrafanacloudlogsAPI.DeleteLogGrafanacloudlogs(ctx, serviceID, versionID, loggingGrafanacloudlogsName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LoggingGrafanacloudlogsAPI.DeleteLogGrafanacloudlogs`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteLogGrafanacloudlogs`: InlineResponse200 + fmt.Fprintf(os.Stdout, "Response from `LoggingGrafanacloudlogsAPI.DeleteLogGrafanacloudlogs`: %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. | +**loggingGrafanacloudlogsName** | **string** | The name for the real-time logging configuration. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteLogGrafanacloudlogsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**InlineResponse200**](InlineResponse200.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) + + +## GetLogGrafanacloudlogs + +Get a Grafana Cloud Logs log endpoint + + + +### 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. + loggingGrafanacloudlogsName := "loggingGrafanacloudlogsName_example" // string | The name for the real-time logging configuration. + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.LoggingGrafanacloudlogsAPI.GetLogGrafanacloudlogs(ctx, serviceID, versionID, loggingGrafanacloudlogsName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LoggingGrafanacloudlogsAPI.GetLogGrafanacloudlogs`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetLogGrafanacloudlogs`: LoggingGrafanacloudlogsResponse + fmt.Fprintf(os.Stdout, "Response from `LoggingGrafanacloudlogsAPI.GetLogGrafanacloudlogs`: %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. | +**loggingGrafanacloudlogsName** | **string** | The name for the real-time logging configuration. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetLogGrafanacloudlogsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**LoggingGrafanacloudlogsResponse**](LoggingGrafanacloudlogsResponse.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) + + +## ListLogGrafanacloudlogs + +List Grafana Cloud Logs log endpoints + + + +### 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. + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.LoggingGrafanacloudlogsAPI.ListLogGrafanacloudlogs(ctx, serviceID, versionID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LoggingGrafanacloudlogsAPI.ListLogGrafanacloudlogs`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListLogGrafanacloudlogs`: []LoggingGrafanacloudlogsResponse + fmt.Fprintf(os.Stdout, "Response from `LoggingGrafanacloudlogsAPI.ListLogGrafanacloudlogs`: %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. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListLogGrafanacloudlogsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**[]LoggingGrafanacloudlogsResponse**](LoggingGrafanacloudlogsResponse.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) + + +## UpdateLogGrafanacloudlogs + +Update a Grafana Cloud Logs log endpoint + + + +### 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. + loggingGrafanacloudlogsName := "loggingGrafanacloudlogsName_example" // string | The name for the real-time logging configuration. + name := "name_example" // string | The name for the real-time logging configuration. (optional) + placement := "placement_example" // string | Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. (optional) + responseCondition := "responseCondition_example" // string | The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional) + format := "format_example" // string | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (optional) + formatVersion := int32(56) // int32 | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional) (default to 2) + user := "user_example" // string | The Grafana Cloud Logs Dataset you want to log to. (optional) + url := "url_example" // string | The URL of the Loki instance in your Grafana stack. (optional) + token := "token_example" // string | The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. (optional) + index := "index_example" // string | The Stream Labels, a JSON string used to identify the stream. (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.LoggingGrafanacloudlogsAPI.UpdateLogGrafanacloudlogs(ctx, serviceID, versionID, loggingGrafanacloudlogsName).Name(name).Placement(placement).ResponseCondition(responseCondition).Format(format).FormatVersion(formatVersion).User(user).URL(url).Token(token).Index(index).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `LoggingGrafanacloudlogsAPI.UpdateLogGrafanacloudlogs`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateLogGrafanacloudlogs`: LoggingGrafanacloudlogsResponse + fmt.Fprintf(os.Stdout, "Response from `LoggingGrafanacloudlogsAPI.UpdateLogGrafanacloudlogs`: %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. | +**loggingGrafanacloudlogsName** | **string** | The name for the real-time logging configuration. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateLogGrafanacloudlogsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **string** | The name for the real-time logging configuration. | **placement** | **string** | Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. | **responseCondition** | **string** | The name of an existing condition in the configured endpoint, or leave blank to always execute. | **format** | **string** | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | **formatVersion** | **int32** | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. | [default to 2] **user** | **string** | The Grafana Cloud Logs Dataset you want to log to. | **url** | **string** | The URL of the Loki instance in your Grafana stack. | **token** | **string** | The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. | **index** | **string** | The Stream Labels, a JSON string used to identify the stream. | + +### Return type + +[**LoggingGrafanacloudlogsResponse**](LoggingGrafanacloudlogsResponse.md) + +### Authorization + +[API Token](https://www.fastly.com/documentation/reference/api/#authentication) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **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/LoggingGrafanacloudlogsAdditional.md b/docs/LoggingGrafanacloudlogsAdditional.md new file mode 100644 index 0000000..8169992 --- /dev/null +++ b/docs/LoggingGrafanacloudlogsAdditional.md @@ -0,0 +1,158 @@ +# LoggingGrafanacloudlogsAdditional + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Format** | Pointer to **string** | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | [optional] +**User** | Pointer to **string** | The Grafana Cloud Logs Dataset you want to log to. | [optional] +**URL** | Pointer to **string** | The URL of the Loki instance in your Grafana stack. | [optional] +**Token** | Pointer to **string** | The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. | [optional] +**Index** | Pointer to **string** | The Stream Labels, a JSON string used to identify the stream. | [optional] + +## Methods + +### NewLoggingGrafanacloudlogsAdditional + +`func NewLoggingGrafanacloudlogsAdditional() *LoggingGrafanacloudlogsAdditional` + +NewLoggingGrafanacloudlogsAdditional instantiates a new LoggingGrafanacloudlogsAdditional 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 + +### NewLoggingGrafanacloudlogsAdditionalWithDefaults + +`func NewLoggingGrafanacloudlogsAdditionalWithDefaults() *LoggingGrafanacloudlogsAdditional` + +NewLoggingGrafanacloudlogsAdditionalWithDefaults instantiates a new LoggingGrafanacloudlogsAdditional 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 + +### GetFormat + +`func (o *LoggingGrafanacloudlogsAdditional) GetFormat() string` + +GetFormat returns the Format field if non-nil, zero value otherwise. + +### GetFormatOk + +`func (o *LoggingGrafanacloudlogsAdditional) GetFormatOk() (*string, bool)` + +GetFormatOk returns a tuple with the Format field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFormat + +`func (o *LoggingGrafanacloudlogsAdditional) SetFormat(v string)` + +SetFormat sets Format field to given value. + +### HasFormat + +`func (o *LoggingGrafanacloudlogsAdditional) HasFormat() bool` + +HasFormat returns a boolean if a field has been set. + +### GetUser + +`func (o *LoggingGrafanacloudlogsAdditional) GetUser() string` + +GetUser returns the User field if non-nil, zero value otherwise. + +### GetUserOk + +`func (o *LoggingGrafanacloudlogsAdditional) GetUserOk() (*string, bool)` + +GetUserOk returns a tuple with the User field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUser + +`func (o *LoggingGrafanacloudlogsAdditional) SetUser(v string)` + +SetUser sets User field to given value. + +### HasUser + +`func (o *LoggingGrafanacloudlogsAdditional) HasUser() bool` + +HasUser returns a boolean if a field has been set. + +### GetURL + +`func (o *LoggingGrafanacloudlogsAdditional) GetURL() string` + +GetURL returns the URL field if non-nil, zero value otherwise. + +### GetURLOk + +`func (o *LoggingGrafanacloudlogsAdditional) GetURLOk() (*string, bool)` + +GetURLOk returns a tuple with the URL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetURL + +`func (o *LoggingGrafanacloudlogsAdditional) SetURL(v string)` + +SetURL sets URL field to given value. + +### HasURL + +`func (o *LoggingGrafanacloudlogsAdditional) HasURL() bool` + +HasURL returns a boolean if a field has been set. + +### GetToken + +`func (o *LoggingGrafanacloudlogsAdditional) GetToken() string` + +GetToken returns the Token field if non-nil, zero value otherwise. + +### GetTokenOk + +`func (o *LoggingGrafanacloudlogsAdditional) GetTokenOk() (*string, bool)` + +GetTokenOk returns a tuple with the Token field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToken + +`func (o *LoggingGrafanacloudlogsAdditional) SetToken(v string)` + +SetToken sets Token field to given value. + +### HasToken + +`func (o *LoggingGrafanacloudlogsAdditional) HasToken() bool` + +HasToken returns a boolean if a field has been set. + +### GetIndex + +`func (o *LoggingGrafanacloudlogsAdditional) GetIndex() string` + +GetIndex returns the Index field if non-nil, zero value otherwise. + +### GetIndexOk + +`func (o *LoggingGrafanacloudlogsAdditional) GetIndexOk() (*string, bool)` + +GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndex + +`func (o *LoggingGrafanacloudlogsAdditional) SetIndex(v string)` + +SetIndex sets Index field to given value. + +### HasIndex + +`func (o *LoggingGrafanacloudlogsAdditional) HasIndex() bool` + +HasIndex 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/LoggingGrafanacloudlogsResponse.md b/docs/LoggingGrafanacloudlogsResponse.md new file mode 100644 index 0000000..8746342 --- /dev/null +++ b/docs/LoggingGrafanacloudlogsResponse.md @@ -0,0 +1,442 @@ +# LoggingGrafanacloudlogsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | The name for the real-time logging configuration. | [optional] +**Placement** | Pointer to **NullableString** | Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. | [optional] +**ResponseCondition** | Pointer to **NullableString** | The name of an existing condition in the configured endpoint, or leave blank to always execute. | [optional] +**Format** | Pointer to **string** | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | [optional] +**FormatVersion** | Pointer to **string** | The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. | [optional] [default to "2"] +**User** | Pointer to **string** | The Grafana Cloud Logs Dataset you want to log to. | [optional] +**URL** | Pointer to **string** | The URL of the Loki instance in your Grafana stack. | [optional] +**Token** | Pointer to **string** | The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. | [optional] +**Index** | Pointer to **string** | The Stream Labels, a JSON string used to identify the stream. | [optional] +**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] +**ServiceID** | Pointer to **string** | | [optional] [readonly] +**Version** | Pointer to **string** | | [optional] [readonly] + +## Methods + +### NewLoggingGrafanacloudlogsResponse + +`func NewLoggingGrafanacloudlogsResponse() *LoggingGrafanacloudlogsResponse` + +NewLoggingGrafanacloudlogsResponse instantiates a new LoggingGrafanacloudlogsResponse 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 + +### NewLoggingGrafanacloudlogsResponseWithDefaults + +`func NewLoggingGrafanacloudlogsResponseWithDefaults() *LoggingGrafanacloudlogsResponse` + +NewLoggingGrafanacloudlogsResponseWithDefaults instantiates a new LoggingGrafanacloudlogsResponse 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 *LoggingGrafanacloudlogsResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *LoggingGrafanacloudlogsResponse) 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 *LoggingGrafanacloudlogsResponse) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *LoggingGrafanacloudlogsResponse) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPlacement + +`func (o *LoggingGrafanacloudlogsResponse) GetPlacement() string` + +GetPlacement returns the Placement field if non-nil, zero value otherwise. + +### GetPlacementOk + +`func (o *LoggingGrafanacloudlogsResponse) GetPlacementOk() (*string, bool)` + +GetPlacementOk returns a tuple with the Placement field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPlacement + +`func (o *LoggingGrafanacloudlogsResponse) SetPlacement(v string)` + +SetPlacement sets Placement field to given value. + +### HasPlacement + +`func (o *LoggingGrafanacloudlogsResponse) HasPlacement() bool` + +HasPlacement returns a boolean if a field has been set. + +### SetPlacementNil + +`func (o *LoggingGrafanacloudlogsResponse) SetPlacementNil(b bool)` + + SetPlacementNil sets the value for Placement to be an explicit nil + +### UnsetPlacement +`func (o *LoggingGrafanacloudlogsResponse) UnsetPlacement()` + +UnsetPlacement ensures that no value is present for Placement, not even an explicit nil +### GetResponseCondition + +`func (o *LoggingGrafanacloudlogsResponse) GetResponseCondition() string` + +GetResponseCondition returns the ResponseCondition field if non-nil, zero value otherwise. + +### GetResponseConditionOk + +`func (o *LoggingGrafanacloudlogsResponse) GetResponseConditionOk() (*string, bool)` + +GetResponseConditionOk returns a tuple with the ResponseCondition field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponseCondition + +`func (o *LoggingGrafanacloudlogsResponse) SetResponseCondition(v string)` + +SetResponseCondition sets ResponseCondition field to given value. + +### HasResponseCondition + +`func (o *LoggingGrafanacloudlogsResponse) HasResponseCondition() bool` + +HasResponseCondition returns a boolean if a field has been set. + +### SetResponseConditionNil + +`func (o *LoggingGrafanacloudlogsResponse) SetResponseConditionNil(b bool)` + + SetResponseConditionNil sets the value for ResponseCondition to be an explicit nil + +### UnsetResponseCondition +`func (o *LoggingGrafanacloudlogsResponse) UnsetResponseCondition()` + +UnsetResponseCondition ensures that no value is present for ResponseCondition, not even an explicit nil +### GetFormat + +`func (o *LoggingGrafanacloudlogsResponse) GetFormat() string` + +GetFormat returns the Format field if non-nil, zero value otherwise. + +### GetFormatOk + +`func (o *LoggingGrafanacloudlogsResponse) GetFormatOk() (*string, bool)` + +GetFormatOk returns a tuple with the Format field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFormat + +`func (o *LoggingGrafanacloudlogsResponse) SetFormat(v string)` + +SetFormat sets Format field to given value. + +### HasFormat + +`func (o *LoggingGrafanacloudlogsResponse) HasFormat() bool` + +HasFormat returns a boolean if a field has been set. + +### GetFormatVersion + +`func (o *LoggingGrafanacloudlogsResponse) GetFormatVersion() string` + +GetFormatVersion returns the FormatVersion field if non-nil, zero value otherwise. + +### GetFormatVersionOk + +`func (o *LoggingGrafanacloudlogsResponse) GetFormatVersionOk() (*string, bool)` + +GetFormatVersionOk returns a tuple with the FormatVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFormatVersion + +`func (o *LoggingGrafanacloudlogsResponse) SetFormatVersion(v string)` + +SetFormatVersion sets FormatVersion field to given value. + +### HasFormatVersion + +`func (o *LoggingGrafanacloudlogsResponse) HasFormatVersion() bool` + +HasFormatVersion returns a boolean if a field has been set. + +### GetUser + +`func (o *LoggingGrafanacloudlogsResponse) GetUser() string` + +GetUser returns the User field if non-nil, zero value otherwise. + +### GetUserOk + +`func (o *LoggingGrafanacloudlogsResponse) GetUserOk() (*string, bool)` + +GetUserOk returns a tuple with the User field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUser + +`func (o *LoggingGrafanacloudlogsResponse) SetUser(v string)` + +SetUser sets User field to given value. + +### HasUser + +`func (o *LoggingGrafanacloudlogsResponse) HasUser() bool` + +HasUser returns a boolean if a field has been set. + +### GetURL + +`func (o *LoggingGrafanacloudlogsResponse) GetURL() string` + +GetURL returns the URL field if non-nil, zero value otherwise. + +### GetURLOk + +`func (o *LoggingGrafanacloudlogsResponse) GetURLOk() (*string, bool)` + +GetURLOk returns a tuple with the URL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetURL + +`func (o *LoggingGrafanacloudlogsResponse) SetURL(v string)` + +SetURL sets URL field to given value. + +### HasURL + +`func (o *LoggingGrafanacloudlogsResponse) HasURL() bool` + +HasURL returns a boolean if a field has been set. + +### GetToken + +`func (o *LoggingGrafanacloudlogsResponse) GetToken() string` + +GetToken returns the Token field if non-nil, zero value otherwise. + +### GetTokenOk + +`func (o *LoggingGrafanacloudlogsResponse) GetTokenOk() (*string, bool)` + +GetTokenOk returns a tuple with the Token field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToken + +`func (o *LoggingGrafanacloudlogsResponse) SetToken(v string)` + +SetToken sets Token field to given value. + +### HasToken + +`func (o *LoggingGrafanacloudlogsResponse) HasToken() bool` + +HasToken returns a boolean if a field has been set. + +### GetIndex + +`func (o *LoggingGrafanacloudlogsResponse) GetIndex() string` + +GetIndex returns the Index field if non-nil, zero value otherwise. + +### GetIndexOk + +`func (o *LoggingGrafanacloudlogsResponse) GetIndexOk() (*string, bool)` + +GetIndexOk returns a tuple with the Index field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIndex + +`func (o *LoggingGrafanacloudlogsResponse) SetIndex(v string)` + +SetIndex sets Index field to given value. + +### HasIndex + +`func (o *LoggingGrafanacloudlogsResponse) HasIndex() bool` + +HasIndex returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *LoggingGrafanacloudlogsResponse) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *LoggingGrafanacloudlogsResponse) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *LoggingGrafanacloudlogsResponse) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *LoggingGrafanacloudlogsResponse) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### SetCreatedAtNil + +`func (o *LoggingGrafanacloudlogsResponse) SetCreatedAtNil(b bool)` + + SetCreatedAtNil sets the value for CreatedAt to be an explicit nil + +### UnsetCreatedAt +`func (o *LoggingGrafanacloudlogsResponse) UnsetCreatedAt()` + +UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil +### GetDeletedAt + +`func (o *LoggingGrafanacloudlogsResponse) GetDeletedAt() time.Time` + +GetDeletedAt returns the DeletedAt field if non-nil, zero value otherwise. + +### GetDeletedAtOk + +`func (o *LoggingGrafanacloudlogsResponse) GetDeletedAtOk() (*time.Time, bool)` + +GetDeletedAtOk returns a tuple with the DeletedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeletedAt + +`func (o *LoggingGrafanacloudlogsResponse) SetDeletedAt(v time.Time)` + +SetDeletedAt sets DeletedAt field to given value. + +### HasDeletedAt + +`func (o *LoggingGrafanacloudlogsResponse) HasDeletedAt() bool` + +HasDeletedAt returns a boolean if a field has been set. + +### SetDeletedAtNil + +`func (o *LoggingGrafanacloudlogsResponse) SetDeletedAtNil(b bool)` + + SetDeletedAtNil sets the value for DeletedAt to be an explicit nil + +### UnsetDeletedAt +`func (o *LoggingGrafanacloudlogsResponse) UnsetDeletedAt()` + +UnsetDeletedAt ensures that no value is present for DeletedAt, not even an explicit nil +### GetUpdatedAt + +`func (o *LoggingGrafanacloudlogsResponse) GetUpdatedAt() time.Time` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *LoggingGrafanacloudlogsResponse) GetUpdatedAtOk() (*time.Time, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *LoggingGrafanacloudlogsResponse) SetUpdatedAt(v time.Time)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *LoggingGrafanacloudlogsResponse) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### SetUpdatedAtNil + +`func (o *LoggingGrafanacloudlogsResponse) SetUpdatedAtNil(b bool)` + + SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil + +### UnsetUpdatedAt +`func (o *LoggingGrafanacloudlogsResponse) UnsetUpdatedAt()` + +UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +### GetServiceID + +`func (o *LoggingGrafanacloudlogsResponse) GetServiceID() string` + +GetServiceID returns the ServiceID field if non-nil, zero value otherwise. + +### GetServiceIDOk + +`func (o *LoggingGrafanacloudlogsResponse) 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 *LoggingGrafanacloudlogsResponse) SetServiceID(v string)` + +SetServiceID sets ServiceID field to given value. + +### HasServiceID + +`func (o *LoggingGrafanacloudlogsResponse) HasServiceID() bool` + +HasServiceID returns a boolean if a field has been set. + +### GetVersion + +`func (o *LoggingGrafanacloudlogsResponse) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *LoggingGrafanacloudlogsResponse) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *LoggingGrafanacloudlogsResponse) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *LoggingGrafanacloudlogsResponse) HasVersion() bool` + +HasVersion 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/ObjectStorageAccessKeysAPI.md b/docs/ObjectStorageAccessKeysAPI.md new file mode 100644 index 0000000..c0640a1 --- /dev/null +++ b/docs/ObjectStorageAccessKeysAPI.md @@ -0,0 +1,266 @@ +# ObjectStorageAccessKeysAPI + +> [!NOTE] +> All URIs are relative to `https://api.fastly.com` + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateAccessKey**](ObjectStorageAccessKeysAPI.md#CreateAccessKey) | **POST** `/resources/object-storage/access-keys` | Create an access key +[**DeleteAccessKey**](ObjectStorageAccessKeysAPI.md#DeleteAccessKey) | **DELETE** `/resources/object-storage/access-keys/{access_key}` | Delete an access key +[**GetAccessKey**](ObjectStorageAccessKeysAPI.md#GetAccessKey) | **GET** `/resources/object-storage/access-keys/{access_key}` | Get an access key +[**ListAccessKeys**](ObjectStorageAccessKeysAPI.md#ListAccessKeys) | **GET** `/resources/object-storage/access-keys` | List access keys + + + +## CreateAccessKey + +Create an access key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + accessKey := *openapiclient.NewAccessKey("Description_example", "Permission_example") // AccessKey | (optional) + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ObjectStorageAccessKeysAPI.CreateAccessKey(ctx).AccessKey(accessKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ObjectStorageAccessKeysAPI.CreateAccessKey`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateAccessKey`: AccessKeyResponse + fmt.Fprintf(os.Stdout, "Response from `ObjectStorageAccessKeysAPI.CreateAccessKey`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateAccessKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **accessKey** | [**AccessKey**](AccessKey.md) | | + +### Return type + +[**AccessKeyResponse**](AccessKeyResponse.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) + + +## DeleteAccessKey + +Delete an access key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + accessKey := "accessKey_example" // string | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ObjectStorageAccessKeysAPI.DeleteAccessKey(ctx, accessKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ObjectStorageAccessKeysAPI.DeleteAccessKey`: %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. +**accessKey** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteAccessKeyRequest 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) + + +## GetAccessKey + +Get an access key + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "github.com/fastly/fastly-go/fastly" +) + +func main() { + accessKey := "accessKey_example" // string | + + cfg := fastly.NewConfiguration() + apiClient := fastly.NewAPIClient(cfg) + ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN") + resp, r, err := apiClient.ObjectStorageAccessKeysAPI.GetAccessKey(ctx, accessKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ObjectStorageAccessKeysAPI.GetAccessKey`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetAccessKey`: AccessKey + fmt.Fprintf(os.Stdout, "Response from `ObjectStorageAccessKeysAPI.GetAccessKey`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**accessKey** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetAccessKeyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**AccessKey**](AccessKey.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) + + +## ListAccessKeys + +List access keys + + + +### 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.ObjectStorageAccessKeysAPI.ListAccessKeys(ctx).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ObjectStorageAccessKeysAPI.ListAccessKeys`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListAccessKeys`: AccessKeyResponse + fmt.Fprintf(os.Stdout, "Response from `ObjectStorageAccessKeysAPI.ListAccessKeys`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiListAccessKeysRequest struct via the builder pattern + + + +### Return type + +[**AccessKeyResponse**](AccessKeyResponse.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) diff --git a/docs/RealtimeEntryAggregated.md b/docs/RealtimeEntryAggregated.md index f297d88..4c91da1 100644 --- a/docs/RealtimeEntryAggregated.md +++ b/docs/RealtimeEntryAggregated.md @@ -233,13 +233,6 @@ Name | Type | Description | Notes **BotChallengeCompleteTokensIssued** | Pointer to **int32** | The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success. | [optional] **DdosActionDowngrade** | Pointer to **int32** | The number of times the downgrade action was taken. The downgrade action restricts the client to http1. | [optional] **DdosActionDowngradedConnections** | Pointer to **int32** | The number of connections the downgrade action was applied to. The downgrade action restricts the connection to http1. | [optional] -**VclOnComputeHitRequests** | Pointer to **int32** | Number of cache hits for a VCL service running on Compute. | [optional] -**VclOnComputeMissRequests** | Pointer to **int32** | Number of cache misses for a VCL service running on Compute. | [optional] -**VclOnComputePassRequests** | Pointer to **int32** | Number of requests that passed through the CDN without being cached for a VCL service running on Compute. | [optional] -**VclOnComputeErrorRequests** | Pointer to **int32** | Number of cache errors for a VCL service running on Compute. | [optional] -**VclOnComputeSynthRequests** | Pointer to **int32** | Number of requests that returned a synthetic response (i.e., response objects created with the `synthetic` VCL statement) for a VCL service running on Compute. | [optional] -**VclOnComputeEdgeHitRequests** | Pointer to **int32** | Number of requests sent by end users to Fastly that resulted in a hit at the edge for a VCL service running on Compute. | [optional] -**VclOnComputeEdgeMissRequests** | Pointer to **int32** | Number of requests sent by end users to Fastly that resulted in a miss at the edge for a VCL service running on Compute. | [optional] **AllHitRequests** | Pointer to **int32** | Number of cache hits for a VCL service. | [optional] **AllMissRequests** | Pointer to **int32** | Number of cache misses for a VCL service. | [optional] **AllPassRequests** | Pointer to **int32** | Number of requests that passed through the CDN without being cached for a VCL service. | [optional] @@ -254,6 +247,9 @@ Name | Type | Description | Notes **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] +**ServiceDdosRequestsDetected** | Pointer to **int32** | Number of requests classified as a DDoS attack against a customer origin or service. | [optional] +**ServiceDdosRequestsMitigated** | Pointer to **int32** | Number of requests classified as a DDoS attack against a customer origin or service that were mitigated by the Fastly platform. | [optional] +**ServiceDdosRequestsAllowed** | Pointer to **int32** | Number of requests analyzed for DDoS attacks against a customer origin or service, but with no DDoS detected. | [optional] ## Methods @@ -5999,181 +5995,6 @@ SetDdosActionDowngradedConnections sets DdosActionDowngradedConnections field to HasDdosActionDowngradedConnections returns a boolean if a field has been set. -### GetVclOnComputeHitRequests - -`func (o *RealtimeEntryAggregated) GetVclOnComputeHitRequests() int32` - -GetVclOnComputeHitRequests returns the VclOnComputeHitRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeHitRequestsOk - -`func (o *RealtimeEntryAggregated) GetVclOnComputeHitRequestsOk() (*int32, bool)` - -GetVclOnComputeHitRequestsOk returns a tuple with the VclOnComputeHitRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeHitRequests - -`func (o *RealtimeEntryAggregated) SetVclOnComputeHitRequests(v int32)` - -SetVclOnComputeHitRequests sets VclOnComputeHitRequests field to given value. - -### HasVclOnComputeHitRequests - -`func (o *RealtimeEntryAggregated) HasVclOnComputeHitRequests() bool` - -HasVclOnComputeHitRequests returns a boolean if a field has been set. - -### GetVclOnComputeMissRequests - -`func (o *RealtimeEntryAggregated) GetVclOnComputeMissRequests() int32` - -GetVclOnComputeMissRequests returns the VclOnComputeMissRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeMissRequestsOk - -`func (o *RealtimeEntryAggregated) GetVclOnComputeMissRequestsOk() (*int32, bool)` - -GetVclOnComputeMissRequestsOk returns a tuple with the VclOnComputeMissRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeMissRequests - -`func (o *RealtimeEntryAggregated) SetVclOnComputeMissRequests(v int32)` - -SetVclOnComputeMissRequests sets VclOnComputeMissRequests field to given value. - -### HasVclOnComputeMissRequests - -`func (o *RealtimeEntryAggregated) HasVclOnComputeMissRequests() bool` - -HasVclOnComputeMissRequests returns a boolean if a field has been set. - -### GetVclOnComputePassRequests - -`func (o *RealtimeEntryAggregated) GetVclOnComputePassRequests() int32` - -GetVclOnComputePassRequests returns the VclOnComputePassRequests field if non-nil, zero value otherwise. - -### GetVclOnComputePassRequestsOk - -`func (o *RealtimeEntryAggregated) GetVclOnComputePassRequestsOk() (*int32, bool)` - -GetVclOnComputePassRequestsOk returns a tuple with the VclOnComputePassRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputePassRequests - -`func (o *RealtimeEntryAggregated) SetVclOnComputePassRequests(v int32)` - -SetVclOnComputePassRequests sets VclOnComputePassRequests field to given value. - -### HasVclOnComputePassRequests - -`func (o *RealtimeEntryAggregated) HasVclOnComputePassRequests() bool` - -HasVclOnComputePassRequests returns a boolean if a field has been set. - -### GetVclOnComputeErrorRequests - -`func (o *RealtimeEntryAggregated) GetVclOnComputeErrorRequests() int32` - -GetVclOnComputeErrorRequests returns the VclOnComputeErrorRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeErrorRequestsOk - -`func (o *RealtimeEntryAggregated) GetVclOnComputeErrorRequestsOk() (*int32, bool)` - -GetVclOnComputeErrorRequestsOk returns a tuple with the VclOnComputeErrorRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeErrorRequests - -`func (o *RealtimeEntryAggregated) SetVclOnComputeErrorRequests(v int32)` - -SetVclOnComputeErrorRequests sets VclOnComputeErrorRequests field to given value. - -### HasVclOnComputeErrorRequests - -`func (o *RealtimeEntryAggregated) HasVclOnComputeErrorRequests() bool` - -HasVclOnComputeErrorRequests returns a boolean if a field has been set. - -### GetVclOnComputeSynthRequests - -`func (o *RealtimeEntryAggregated) GetVclOnComputeSynthRequests() int32` - -GetVclOnComputeSynthRequests returns the VclOnComputeSynthRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeSynthRequestsOk - -`func (o *RealtimeEntryAggregated) GetVclOnComputeSynthRequestsOk() (*int32, bool)` - -GetVclOnComputeSynthRequestsOk returns a tuple with the VclOnComputeSynthRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeSynthRequests - -`func (o *RealtimeEntryAggregated) SetVclOnComputeSynthRequests(v int32)` - -SetVclOnComputeSynthRequests sets VclOnComputeSynthRequests field to given value. - -### HasVclOnComputeSynthRequests - -`func (o *RealtimeEntryAggregated) HasVclOnComputeSynthRequests() bool` - -HasVclOnComputeSynthRequests returns a boolean if a field has been set. - -### GetVclOnComputeEdgeHitRequests - -`func (o *RealtimeEntryAggregated) GetVclOnComputeEdgeHitRequests() int32` - -GetVclOnComputeEdgeHitRequests returns the VclOnComputeEdgeHitRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeEdgeHitRequestsOk - -`func (o *RealtimeEntryAggregated) GetVclOnComputeEdgeHitRequestsOk() (*int32, bool)` - -GetVclOnComputeEdgeHitRequestsOk returns a tuple with the VclOnComputeEdgeHitRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeEdgeHitRequests - -`func (o *RealtimeEntryAggregated) SetVclOnComputeEdgeHitRequests(v int32)` - -SetVclOnComputeEdgeHitRequests sets VclOnComputeEdgeHitRequests field to given value. - -### HasVclOnComputeEdgeHitRequests - -`func (o *RealtimeEntryAggregated) HasVclOnComputeEdgeHitRequests() bool` - -HasVclOnComputeEdgeHitRequests returns a boolean if a field has been set. - -### GetVclOnComputeEdgeMissRequests - -`func (o *RealtimeEntryAggregated) GetVclOnComputeEdgeMissRequests() int32` - -GetVclOnComputeEdgeMissRequests returns the VclOnComputeEdgeMissRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeEdgeMissRequestsOk - -`func (o *RealtimeEntryAggregated) GetVclOnComputeEdgeMissRequestsOk() (*int32, bool)` - -GetVclOnComputeEdgeMissRequestsOk returns a tuple with the VclOnComputeEdgeMissRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeEdgeMissRequests - -`func (o *RealtimeEntryAggregated) SetVclOnComputeEdgeMissRequests(v int32)` - -SetVclOnComputeEdgeMissRequests sets VclOnComputeEdgeMissRequests field to given value. - -### HasVclOnComputeEdgeMissRequests - -`func (o *RealtimeEntryAggregated) HasVclOnComputeEdgeMissRequests() bool` - -HasVclOnComputeEdgeMissRequests returns a boolean if a field has been set. - ### GetAllHitRequests `func (o *RealtimeEntryAggregated) GetAllHitRequests() int32` @@ -6524,5 +6345,80 @@ SetRequestDeniedGetHeadBody sets RequestDeniedGetHeadBody field to given value. HasRequestDeniedGetHeadBody returns a boolean if a field has been set. +### GetServiceDdosRequestsDetected + +`func (o *RealtimeEntryAggregated) GetServiceDdosRequestsDetected() int32` + +GetServiceDdosRequestsDetected returns the ServiceDdosRequestsDetected field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsDetectedOk + +`func (o *RealtimeEntryAggregated) GetServiceDdosRequestsDetectedOk() (*int32, bool)` + +GetServiceDdosRequestsDetectedOk returns a tuple with the ServiceDdosRequestsDetected field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsDetected + +`func (o *RealtimeEntryAggregated) SetServiceDdosRequestsDetected(v int32)` + +SetServiceDdosRequestsDetected sets ServiceDdosRequestsDetected field to given value. + +### HasServiceDdosRequestsDetected + +`func (o *RealtimeEntryAggregated) HasServiceDdosRequestsDetected() bool` + +HasServiceDdosRequestsDetected returns a boolean if a field has been set. + +### GetServiceDdosRequestsMitigated + +`func (o *RealtimeEntryAggregated) GetServiceDdosRequestsMitigated() int32` + +GetServiceDdosRequestsMitigated returns the ServiceDdosRequestsMitigated field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsMitigatedOk + +`func (o *RealtimeEntryAggregated) GetServiceDdosRequestsMitigatedOk() (*int32, bool)` + +GetServiceDdosRequestsMitigatedOk returns a tuple with the ServiceDdosRequestsMitigated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsMitigated + +`func (o *RealtimeEntryAggregated) SetServiceDdosRequestsMitigated(v int32)` + +SetServiceDdosRequestsMitigated sets ServiceDdosRequestsMitigated field to given value. + +### HasServiceDdosRequestsMitigated + +`func (o *RealtimeEntryAggregated) HasServiceDdosRequestsMitigated() bool` + +HasServiceDdosRequestsMitigated returns a boolean if a field has been set. + +### GetServiceDdosRequestsAllowed + +`func (o *RealtimeEntryAggregated) GetServiceDdosRequestsAllowed() int32` + +GetServiceDdosRequestsAllowed returns the ServiceDdosRequestsAllowed field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsAllowedOk + +`func (o *RealtimeEntryAggregated) GetServiceDdosRequestsAllowedOk() (*int32, bool)` + +GetServiceDdosRequestsAllowedOk returns a tuple with the ServiceDdosRequestsAllowed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsAllowed + +`func (o *RealtimeEntryAggregated) SetServiceDdosRequestsAllowed(v int32)` + +SetServiceDdosRequestsAllowed sets ServiceDdosRequestsAllowed field to given value. + +### HasServiceDdosRequestsAllowed + +`func (o *RealtimeEntryAggregated) HasServiceDdosRequestsAllowed() bool` + +HasServiceDdosRequestsAllowed 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 7f85a95..6a34718 100644 --- a/docs/RealtimeMeasurements.md +++ b/docs/RealtimeMeasurements.md @@ -233,13 +233,6 @@ Name | Type | Description | Notes **BotChallengeCompleteTokensIssued** | Pointer to **int32** | The number of challenge-complete tokens issued. For example, issuing a challenge-complete token after a series of CAPTCHA challenges ending in success. | [optional] **DdosActionDowngrade** | Pointer to **int32** | The number of times the downgrade action was taken. The downgrade action restricts the client to http1. | [optional] **DdosActionDowngradedConnections** | Pointer to **int32** | The number of connections the downgrade action was applied to. The downgrade action restricts the connection to http1. | [optional] -**VclOnComputeHitRequests** | Pointer to **int32** | Number of cache hits for a VCL service running on Compute. | [optional] -**VclOnComputeMissRequests** | Pointer to **int32** | Number of cache misses for a VCL service running on Compute. | [optional] -**VclOnComputePassRequests** | Pointer to **int32** | Number of requests that passed through the CDN without being cached for a VCL service running on Compute. | [optional] -**VclOnComputeErrorRequests** | Pointer to **int32** | Number of cache errors for a VCL service running on Compute. | [optional] -**VclOnComputeSynthRequests** | Pointer to **int32** | Number of requests that returned a synthetic response (i.e., response objects created with the `synthetic` VCL statement) for a VCL service running on Compute. | [optional] -**VclOnComputeEdgeHitRequests** | Pointer to **int32** | Number of requests sent by end users to Fastly that resulted in a hit at the edge for a VCL service running on Compute. | [optional] -**VclOnComputeEdgeMissRequests** | Pointer to **int32** | Number of requests sent by end users to Fastly that resulted in a miss at the edge for a VCL service running on Compute. | [optional] **AllHitRequests** | Pointer to **int32** | Number of cache hits for a VCL service. | [optional] **AllMissRequests** | Pointer to **int32** | Number of cache misses for a VCL service. | [optional] **AllPassRequests** | Pointer to **int32** | Number of requests that passed through the CDN without being cached for a VCL service. | [optional] @@ -254,6 +247,9 @@ Name | Type | Description | Notes **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] +**ServiceDdosRequestsDetected** | Pointer to **int32** | Number of requests classified as a DDoS attack against a customer origin or service. | [optional] +**ServiceDdosRequestsMitigated** | Pointer to **int32** | Number of requests classified as a DDoS attack against a customer origin or service that were mitigated by the Fastly platform. | [optional] +**ServiceDdosRequestsAllowed** | Pointer to **int32** | Number of requests analyzed for DDoS attacks against a customer origin or service, but with no DDoS detected. | [optional] ## Methods @@ -5999,181 +5995,6 @@ SetDdosActionDowngradedConnections sets DdosActionDowngradedConnections field to HasDdosActionDowngradedConnections returns a boolean if a field has been set. -### GetVclOnComputeHitRequests - -`func (o *RealtimeMeasurements) GetVclOnComputeHitRequests() int32` - -GetVclOnComputeHitRequests returns the VclOnComputeHitRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeHitRequestsOk - -`func (o *RealtimeMeasurements) GetVclOnComputeHitRequestsOk() (*int32, bool)` - -GetVclOnComputeHitRequestsOk returns a tuple with the VclOnComputeHitRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeHitRequests - -`func (o *RealtimeMeasurements) SetVclOnComputeHitRequests(v int32)` - -SetVclOnComputeHitRequests sets VclOnComputeHitRequests field to given value. - -### HasVclOnComputeHitRequests - -`func (o *RealtimeMeasurements) HasVclOnComputeHitRequests() bool` - -HasVclOnComputeHitRequests returns a boolean if a field has been set. - -### GetVclOnComputeMissRequests - -`func (o *RealtimeMeasurements) GetVclOnComputeMissRequests() int32` - -GetVclOnComputeMissRequests returns the VclOnComputeMissRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeMissRequestsOk - -`func (o *RealtimeMeasurements) GetVclOnComputeMissRequestsOk() (*int32, bool)` - -GetVclOnComputeMissRequestsOk returns a tuple with the VclOnComputeMissRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeMissRequests - -`func (o *RealtimeMeasurements) SetVclOnComputeMissRequests(v int32)` - -SetVclOnComputeMissRequests sets VclOnComputeMissRequests field to given value. - -### HasVclOnComputeMissRequests - -`func (o *RealtimeMeasurements) HasVclOnComputeMissRequests() bool` - -HasVclOnComputeMissRequests returns a boolean if a field has been set. - -### GetVclOnComputePassRequests - -`func (o *RealtimeMeasurements) GetVclOnComputePassRequests() int32` - -GetVclOnComputePassRequests returns the VclOnComputePassRequests field if non-nil, zero value otherwise. - -### GetVclOnComputePassRequestsOk - -`func (o *RealtimeMeasurements) GetVclOnComputePassRequestsOk() (*int32, bool)` - -GetVclOnComputePassRequestsOk returns a tuple with the VclOnComputePassRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputePassRequests - -`func (o *RealtimeMeasurements) SetVclOnComputePassRequests(v int32)` - -SetVclOnComputePassRequests sets VclOnComputePassRequests field to given value. - -### HasVclOnComputePassRequests - -`func (o *RealtimeMeasurements) HasVclOnComputePassRequests() bool` - -HasVclOnComputePassRequests returns a boolean if a field has been set. - -### GetVclOnComputeErrorRequests - -`func (o *RealtimeMeasurements) GetVclOnComputeErrorRequests() int32` - -GetVclOnComputeErrorRequests returns the VclOnComputeErrorRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeErrorRequestsOk - -`func (o *RealtimeMeasurements) GetVclOnComputeErrorRequestsOk() (*int32, bool)` - -GetVclOnComputeErrorRequestsOk returns a tuple with the VclOnComputeErrorRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeErrorRequests - -`func (o *RealtimeMeasurements) SetVclOnComputeErrorRequests(v int32)` - -SetVclOnComputeErrorRequests sets VclOnComputeErrorRequests field to given value. - -### HasVclOnComputeErrorRequests - -`func (o *RealtimeMeasurements) HasVclOnComputeErrorRequests() bool` - -HasVclOnComputeErrorRequests returns a boolean if a field has been set. - -### GetVclOnComputeSynthRequests - -`func (o *RealtimeMeasurements) GetVclOnComputeSynthRequests() int32` - -GetVclOnComputeSynthRequests returns the VclOnComputeSynthRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeSynthRequestsOk - -`func (o *RealtimeMeasurements) GetVclOnComputeSynthRequestsOk() (*int32, bool)` - -GetVclOnComputeSynthRequestsOk returns a tuple with the VclOnComputeSynthRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeSynthRequests - -`func (o *RealtimeMeasurements) SetVclOnComputeSynthRequests(v int32)` - -SetVclOnComputeSynthRequests sets VclOnComputeSynthRequests field to given value. - -### HasVclOnComputeSynthRequests - -`func (o *RealtimeMeasurements) HasVclOnComputeSynthRequests() bool` - -HasVclOnComputeSynthRequests returns a boolean if a field has been set. - -### GetVclOnComputeEdgeHitRequests - -`func (o *RealtimeMeasurements) GetVclOnComputeEdgeHitRequests() int32` - -GetVclOnComputeEdgeHitRequests returns the VclOnComputeEdgeHitRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeEdgeHitRequestsOk - -`func (o *RealtimeMeasurements) GetVclOnComputeEdgeHitRequestsOk() (*int32, bool)` - -GetVclOnComputeEdgeHitRequestsOk returns a tuple with the VclOnComputeEdgeHitRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeEdgeHitRequests - -`func (o *RealtimeMeasurements) SetVclOnComputeEdgeHitRequests(v int32)` - -SetVclOnComputeEdgeHitRequests sets VclOnComputeEdgeHitRequests field to given value. - -### HasVclOnComputeEdgeHitRequests - -`func (o *RealtimeMeasurements) HasVclOnComputeEdgeHitRequests() bool` - -HasVclOnComputeEdgeHitRequests returns a boolean if a field has been set. - -### GetVclOnComputeEdgeMissRequests - -`func (o *RealtimeMeasurements) GetVclOnComputeEdgeMissRequests() int32` - -GetVclOnComputeEdgeMissRequests returns the VclOnComputeEdgeMissRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeEdgeMissRequestsOk - -`func (o *RealtimeMeasurements) GetVclOnComputeEdgeMissRequestsOk() (*int32, bool)` - -GetVclOnComputeEdgeMissRequestsOk returns a tuple with the VclOnComputeEdgeMissRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeEdgeMissRequests - -`func (o *RealtimeMeasurements) SetVclOnComputeEdgeMissRequests(v int32)` - -SetVclOnComputeEdgeMissRequests sets VclOnComputeEdgeMissRequests field to given value. - -### HasVclOnComputeEdgeMissRequests - -`func (o *RealtimeMeasurements) HasVclOnComputeEdgeMissRequests() bool` - -HasVclOnComputeEdgeMissRequests returns a boolean if a field has been set. - ### GetAllHitRequests `func (o *RealtimeMeasurements) GetAllHitRequests() int32` @@ -6524,5 +6345,80 @@ SetRequestDeniedGetHeadBody sets RequestDeniedGetHeadBody field to given value. HasRequestDeniedGetHeadBody returns a boolean if a field has been set. +### GetServiceDdosRequestsDetected + +`func (o *RealtimeMeasurements) GetServiceDdosRequestsDetected() int32` + +GetServiceDdosRequestsDetected returns the ServiceDdosRequestsDetected field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsDetectedOk + +`func (o *RealtimeMeasurements) GetServiceDdosRequestsDetectedOk() (*int32, bool)` + +GetServiceDdosRequestsDetectedOk returns a tuple with the ServiceDdosRequestsDetected field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsDetected + +`func (o *RealtimeMeasurements) SetServiceDdosRequestsDetected(v int32)` + +SetServiceDdosRequestsDetected sets ServiceDdosRequestsDetected field to given value. + +### HasServiceDdosRequestsDetected + +`func (o *RealtimeMeasurements) HasServiceDdosRequestsDetected() bool` + +HasServiceDdosRequestsDetected returns a boolean if a field has been set. + +### GetServiceDdosRequestsMitigated + +`func (o *RealtimeMeasurements) GetServiceDdosRequestsMitigated() int32` + +GetServiceDdosRequestsMitigated returns the ServiceDdosRequestsMitigated field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsMitigatedOk + +`func (o *RealtimeMeasurements) GetServiceDdosRequestsMitigatedOk() (*int32, bool)` + +GetServiceDdosRequestsMitigatedOk returns a tuple with the ServiceDdosRequestsMitigated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsMitigated + +`func (o *RealtimeMeasurements) SetServiceDdosRequestsMitigated(v int32)` + +SetServiceDdosRequestsMitigated sets ServiceDdosRequestsMitigated field to given value. + +### HasServiceDdosRequestsMitigated + +`func (o *RealtimeMeasurements) HasServiceDdosRequestsMitigated() bool` + +HasServiceDdosRequestsMitigated returns a boolean if a field has been set. + +### GetServiceDdosRequestsAllowed + +`func (o *RealtimeMeasurements) GetServiceDdosRequestsAllowed() int32` + +GetServiceDdosRequestsAllowed returns the ServiceDdosRequestsAllowed field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsAllowedOk + +`func (o *RealtimeMeasurements) GetServiceDdosRequestsAllowedOk() (*int32, bool)` + +GetServiceDdosRequestsAllowedOk returns a tuple with the ServiceDdosRequestsAllowed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsAllowed + +`func (o *RealtimeMeasurements) SetServiceDdosRequestsAllowed(v int32)` + +SetServiceDdosRequestsAllowed sets ServiceDdosRequestsAllowed field to given value. + +### HasServiceDdosRequestsAllowed + +`func (o *RealtimeMeasurements) HasServiceDdosRequestsAllowed() bool` + +HasServiceDdosRequestsAllowed 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/Results.md b/docs/Results.md index cbdb7be..ab47de8 100644 --- a/docs/Results.md +++ b/docs/Results.md @@ -233,13 +233,6 @@ Name | Type | Description | Notes **BotChallengesFailed** | Pointer to **int32** | The number of failed challenge solutions processed. For example, an incorrect CAPTCHA solution. | [optional] **DdosActionDowngrade** | Pointer to **int32** | The number of times the downgrade action was taken. The downgrade action restricts the client to http1. | [optional] **DdosActionDowngradedConnections** | Pointer to **int32** | The number of connections the downgrade action was applied to. The downgrade action restricts the connection to http1. | [optional] -**VclOnComputeHitRequests** | Pointer to **int32** | Number of cache hits for a VCL service running on Compute. | [optional] -**VclOnComputeMissRequests** | Pointer to **int32** | Number of cache misses for a VCL service running on Compute. | [optional] -**VclOnComputePassRequests** | Pointer to **int32** | Number of requests that passed through the CDN without being cached for a VCL service running on Compute. | [optional] -**VclOnComputeErrorRequests** | Pointer to **int32** | Number of cache errors for a VCL service running on Compute. | [optional] -**VclOnComputeSynthRequests** | Pointer to **int32** | Number of requests that returned a synthetic response (i.e., response objects created with the `synthetic` VCL statement) for a VCL service running on Compute. | [optional] -**VclOnComputeEdgeHitRequests** | Pointer to **int32** | Number of requests sent by end users to Fastly that resulted in a hit at the edge for a VCL service running on Compute. | [optional] -**VclOnComputeEdgeMissRequests** | Pointer to **int32** | Number of requests sent by end users to Fastly that resulted in a miss at the edge for a VCL service running on Compute. | [optional] **AllHitRequests** | Pointer to **int32** | Number of cache hits for a VCL service. | [optional] **AllMissRequests** | Pointer to **int32** | Number of cache misses for a VCL service. | [optional] **AllPassRequests** | Pointer to **int32** | Number of requests that passed through the CDN without being cached for a VCL service. | [optional] @@ -254,6 +247,9 @@ Name | Type | Description | Notes **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] +**ServiceDdosRequestsDetected** | Pointer to **int32** | Number of requests classified as a DDoS attack against a customer origin or service. | [optional] +**ServiceDdosRequestsMitigated** | Pointer to **int32** | Number of requests classified as a DDoS attack against a customer origin or service that were mitigated by the Fastly platform. | [optional] +**ServiceDdosRequestsAllowed** | Pointer to **int32** | Number of requests analyzed for DDoS attacks against a customer origin or service, but with no DDoS detected. | [optional] **ServiceID** | Pointer to **string** | | [optional] [readonly] **StartTime** | Pointer to **int32** | Timestamp for the start of the time period being reported | [optional] @@ -6011,181 +6007,6 @@ SetDdosActionDowngradedConnections sets DdosActionDowngradedConnections field to HasDdosActionDowngradedConnections returns a boolean if a field has been set. -### GetVclOnComputeHitRequests - -`func (o *Results) GetVclOnComputeHitRequests() int32` - -GetVclOnComputeHitRequests returns the VclOnComputeHitRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeHitRequestsOk - -`func (o *Results) GetVclOnComputeHitRequestsOk() (*int32, bool)` - -GetVclOnComputeHitRequestsOk returns a tuple with the VclOnComputeHitRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeHitRequests - -`func (o *Results) SetVclOnComputeHitRequests(v int32)` - -SetVclOnComputeHitRequests sets VclOnComputeHitRequests field to given value. - -### HasVclOnComputeHitRequests - -`func (o *Results) HasVclOnComputeHitRequests() bool` - -HasVclOnComputeHitRequests returns a boolean if a field has been set. - -### GetVclOnComputeMissRequests - -`func (o *Results) GetVclOnComputeMissRequests() int32` - -GetVclOnComputeMissRequests returns the VclOnComputeMissRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeMissRequestsOk - -`func (o *Results) GetVclOnComputeMissRequestsOk() (*int32, bool)` - -GetVclOnComputeMissRequestsOk returns a tuple with the VclOnComputeMissRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeMissRequests - -`func (o *Results) SetVclOnComputeMissRequests(v int32)` - -SetVclOnComputeMissRequests sets VclOnComputeMissRequests field to given value. - -### HasVclOnComputeMissRequests - -`func (o *Results) HasVclOnComputeMissRequests() bool` - -HasVclOnComputeMissRequests returns a boolean if a field has been set. - -### GetVclOnComputePassRequests - -`func (o *Results) GetVclOnComputePassRequests() int32` - -GetVclOnComputePassRequests returns the VclOnComputePassRequests field if non-nil, zero value otherwise. - -### GetVclOnComputePassRequestsOk - -`func (o *Results) GetVclOnComputePassRequestsOk() (*int32, bool)` - -GetVclOnComputePassRequestsOk returns a tuple with the VclOnComputePassRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputePassRequests - -`func (o *Results) SetVclOnComputePassRequests(v int32)` - -SetVclOnComputePassRequests sets VclOnComputePassRequests field to given value. - -### HasVclOnComputePassRequests - -`func (o *Results) HasVclOnComputePassRequests() bool` - -HasVclOnComputePassRequests returns a boolean if a field has been set. - -### GetVclOnComputeErrorRequests - -`func (o *Results) GetVclOnComputeErrorRequests() int32` - -GetVclOnComputeErrorRequests returns the VclOnComputeErrorRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeErrorRequestsOk - -`func (o *Results) GetVclOnComputeErrorRequestsOk() (*int32, bool)` - -GetVclOnComputeErrorRequestsOk returns a tuple with the VclOnComputeErrorRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeErrorRequests - -`func (o *Results) SetVclOnComputeErrorRequests(v int32)` - -SetVclOnComputeErrorRequests sets VclOnComputeErrorRequests field to given value. - -### HasVclOnComputeErrorRequests - -`func (o *Results) HasVclOnComputeErrorRequests() bool` - -HasVclOnComputeErrorRequests returns a boolean if a field has been set. - -### GetVclOnComputeSynthRequests - -`func (o *Results) GetVclOnComputeSynthRequests() int32` - -GetVclOnComputeSynthRequests returns the VclOnComputeSynthRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeSynthRequestsOk - -`func (o *Results) GetVclOnComputeSynthRequestsOk() (*int32, bool)` - -GetVclOnComputeSynthRequestsOk returns a tuple with the VclOnComputeSynthRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeSynthRequests - -`func (o *Results) SetVclOnComputeSynthRequests(v int32)` - -SetVclOnComputeSynthRequests sets VclOnComputeSynthRequests field to given value. - -### HasVclOnComputeSynthRequests - -`func (o *Results) HasVclOnComputeSynthRequests() bool` - -HasVclOnComputeSynthRequests returns a boolean if a field has been set. - -### GetVclOnComputeEdgeHitRequests - -`func (o *Results) GetVclOnComputeEdgeHitRequests() int32` - -GetVclOnComputeEdgeHitRequests returns the VclOnComputeEdgeHitRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeEdgeHitRequestsOk - -`func (o *Results) GetVclOnComputeEdgeHitRequestsOk() (*int32, bool)` - -GetVclOnComputeEdgeHitRequestsOk returns a tuple with the VclOnComputeEdgeHitRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeEdgeHitRequests - -`func (o *Results) SetVclOnComputeEdgeHitRequests(v int32)` - -SetVclOnComputeEdgeHitRequests sets VclOnComputeEdgeHitRequests field to given value. - -### HasVclOnComputeEdgeHitRequests - -`func (o *Results) HasVclOnComputeEdgeHitRequests() bool` - -HasVclOnComputeEdgeHitRequests returns a boolean if a field has been set. - -### GetVclOnComputeEdgeMissRequests - -`func (o *Results) GetVclOnComputeEdgeMissRequests() int32` - -GetVclOnComputeEdgeMissRequests returns the VclOnComputeEdgeMissRequests field if non-nil, zero value otherwise. - -### GetVclOnComputeEdgeMissRequestsOk - -`func (o *Results) GetVclOnComputeEdgeMissRequestsOk() (*int32, bool)` - -GetVclOnComputeEdgeMissRequestsOk returns a tuple with the VclOnComputeEdgeMissRequests field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVclOnComputeEdgeMissRequests - -`func (o *Results) SetVclOnComputeEdgeMissRequests(v int32)` - -SetVclOnComputeEdgeMissRequests sets VclOnComputeEdgeMissRequests field to given value. - -### HasVclOnComputeEdgeMissRequests - -`func (o *Results) HasVclOnComputeEdgeMissRequests() bool` - -HasVclOnComputeEdgeMissRequests returns a boolean if a field has been set. - ### GetAllHitRequests `func (o *Results) GetAllHitRequests() int32` @@ -6536,6 +6357,81 @@ SetRequestDeniedGetHeadBody sets RequestDeniedGetHeadBody field to given value. HasRequestDeniedGetHeadBody returns a boolean if a field has been set. +### GetServiceDdosRequestsDetected + +`func (o *Results) GetServiceDdosRequestsDetected() int32` + +GetServiceDdosRequestsDetected returns the ServiceDdosRequestsDetected field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsDetectedOk + +`func (o *Results) GetServiceDdosRequestsDetectedOk() (*int32, bool)` + +GetServiceDdosRequestsDetectedOk returns a tuple with the ServiceDdosRequestsDetected field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsDetected + +`func (o *Results) SetServiceDdosRequestsDetected(v int32)` + +SetServiceDdosRequestsDetected sets ServiceDdosRequestsDetected field to given value. + +### HasServiceDdosRequestsDetected + +`func (o *Results) HasServiceDdosRequestsDetected() bool` + +HasServiceDdosRequestsDetected returns a boolean if a field has been set. + +### GetServiceDdosRequestsMitigated + +`func (o *Results) GetServiceDdosRequestsMitigated() int32` + +GetServiceDdosRequestsMitigated returns the ServiceDdosRequestsMitigated field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsMitigatedOk + +`func (o *Results) GetServiceDdosRequestsMitigatedOk() (*int32, bool)` + +GetServiceDdosRequestsMitigatedOk returns a tuple with the ServiceDdosRequestsMitigated field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsMitigated + +`func (o *Results) SetServiceDdosRequestsMitigated(v int32)` + +SetServiceDdosRequestsMitigated sets ServiceDdosRequestsMitigated field to given value. + +### HasServiceDdosRequestsMitigated + +`func (o *Results) HasServiceDdosRequestsMitigated() bool` + +HasServiceDdosRequestsMitigated returns a boolean if a field has been set. + +### GetServiceDdosRequestsAllowed + +`func (o *Results) GetServiceDdosRequestsAllowed() int32` + +GetServiceDdosRequestsAllowed returns the ServiceDdosRequestsAllowed field if non-nil, zero value otherwise. + +### GetServiceDdosRequestsAllowedOk + +`func (o *Results) GetServiceDdosRequestsAllowedOk() (*int32, bool)` + +GetServiceDdosRequestsAllowedOk returns a tuple with the ServiceDdosRequestsAllowed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceDdosRequestsAllowed + +`func (o *Results) SetServiceDdosRequestsAllowed(v int32)` + +SetServiceDdosRequestsAllowed sets ServiceDdosRequestsAllowed field to given value. + +### HasServiceDdosRequestsAllowed + +`func (o *Results) HasServiceDdosRequestsAllowed() bool` + +HasServiceDdosRequestsAllowed returns a boolean if a field has been set. + ### GetServiceID `func (o *Results) GetServiceID() string` diff --git a/docs/SetConfiguration.md b/docs/SetConfiguration.md index defdcce..1c3d8a0 100644 --- a/docs/SetConfiguration.md +++ b/docs/SetConfiguration.md @@ -6,6 +6,7 @@ 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] +**Mode** | Pointer to **string** | The new mode to run the product in. One of `block`, `log`, or `off`. Optional in the `PATCH` request body for `ddos_protection`. | [optional] ## Methods @@ -76,5 +77,30 @@ SetTrafficRamp sets TrafficRamp field to given value. HasTrafficRamp returns a boolean if a field has been set. +### GetMode + +`func (o *SetConfiguration) GetMode() string` + +GetMode returns the Mode field if non-nil, zero value otherwise. + +### GetModeOk + +`func (o *SetConfiguration) GetModeOk() (*string, bool)` + +GetModeOk returns a tuple with the Mode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMode + +`func (o *SetConfiguration) SetMode(v string)` + +SetMode sets Mode field to given value. + +### HasMode + +`func (o *SetConfiguration) HasMode() bool` + +HasMode 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/Usagemetric.md b/docs/Usagemetric.md new file mode 100644 index 0000000..4b7144c --- /dev/null +++ b/docs/Usagemetric.md @@ -0,0 +1,262 @@ +# Usagemetric + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Month** | Pointer to **string** | The year and month of the usage element. | [optional] +**UsageType** | Pointer to **string** | The usage type identifier for the usage. This is a single, billable metric for the product. | [optional] +**Name** | Pointer to **string** | Full name of the product usage type as it might appear on a customer's invoice. | [optional] +**Region** | Pointer to **string** | The geographical area applicable for regionally based products. | [optional] +**Unit** | Pointer to **string** | The unit for the usage as shown on an invoice. If there is no explicit unit, this field will be \"unit\" (e.g., a request with `product_id` of 'cdn_usage' and `usage_type` of 'North America Requests' has no unit, and will return \"unit\"). | [optional] +**Quantity** | Pointer to **float32** | The quantity of the usage for the product. | [optional] +**RawQuantity** | Pointer to **float32** | The raw units measured for the product. | [optional] +**ProductID** | Pointer to **string** | The product identifier associated with the usage type. This corresponds to a Fastly product offering. | [optional] +**LastUpdatedAt** | Pointer to **string** | The date when the usage metric was last updated. | [optional] + +## Methods + +### NewUsagemetric + +`func NewUsagemetric() *Usagemetric` + +NewUsagemetric instantiates a new Usagemetric 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 + +### NewUsagemetricWithDefaults + +`func NewUsagemetricWithDefaults() *Usagemetric` + +NewUsagemetricWithDefaults instantiates a new Usagemetric 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 + +### GetMonth + +`func (o *Usagemetric) GetMonth() string` + +GetMonth returns the Month field if non-nil, zero value otherwise. + +### GetMonthOk + +`func (o *Usagemetric) GetMonthOk() (*string, bool)` + +GetMonthOk returns a tuple with the Month field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMonth + +`func (o *Usagemetric) SetMonth(v string)` + +SetMonth sets Month field to given value. + +### HasMonth + +`func (o *Usagemetric) HasMonth() bool` + +HasMonth returns a boolean if a field has been set. + +### GetUsageType + +`func (o *Usagemetric) GetUsageType() string` + +GetUsageType returns the UsageType field if non-nil, zero value otherwise. + +### GetUsageTypeOk + +`func (o *Usagemetric) GetUsageTypeOk() (*string, bool)` + +GetUsageTypeOk returns a tuple with the UsageType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageType + +`func (o *Usagemetric) SetUsageType(v string)` + +SetUsageType sets UsageType field to given value. + +### HasUsageType + +`func (o *Usagemetric) HasUsageType() bool` + +HasUsageType returns a boolean if a field has been set. + +### GetName + +`func (o *Usagemetric) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Usagemetric) 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 *Usagemetric) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Usagemetric) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetRegion + +`func (o *Usagemetric) GetRegion() string` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *Usagemetric) 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 *Usagemetric) SetRegion(v string)` + +SetRegion sets Region field to given value. + +### HasRegion + +`func (o *Usagemetric) HasRegion() bool` + +HasRegion returns a boolean if a field has been set. + +### GetUnit + +`func (o *Usagemetric) GetUnit() string` + +GetUnit returns the Unit field if non-nil, zero value otherwise. + +### GetUnitOk + +`func (o *Usagemetric) GetUnitOk() (*string, bool)` + +GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnit + +`func (o *Usagemetric) SetUnit(v string)` + +SetUnit sets Unit field to given value. + +### HasUnit + +`func (o *Usagemetric) HasUnit() bool` + +HasUnit returns a boolean if a field has been set. + +### GetQuantity + +`func (o *Usagemetric) GetQuantity() float32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *Usagemetric) GetQuantityOk() (*float32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *Usagemetric) SetQuantity(v float32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *Usagemetric) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetRawQuantity + +`func (o *Usagemetric) GetRawQuantity() float32` + +GetRawQuantity returns the RawQuantity field if non-nil, zero value otherwise. + +### GetRawQuantityOk + +`func (o *Usagemetric) GetRawQuantityOk() (*float32, bool)` + +GetRawQuantityOk returns a tuple with the RawQuantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRawQuantity + +`func (o *Usagemetric) SetRawQuantity(v float32)` + +SetRawQuantity sets RawQuantity field to given value. + +### HasRawQuantity + +`func (o *Usagemetric) HasRawQuantity() bool` + +HasRawQuantity returns a boolean if a field has been set. + +### GetProductID + +`func (o *Usagemetric) GetProductID() string` + +GetProductID returns the ProductID field if non-nil, zero value otherwise. + +### GetProductIDOk + +`func (o *Usagemetric) GetProductIDOk() (*string, bool)` + +GetProductIDOk returns a tuple with the ProductID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProductID + +`func (o *Usagemetric) SetProductID(v string)` + +SetProductID sets ProductID field to given value. + +### HasProductID + +`func (o *Usagemetric) HasProductID() bool` + +HasProductID returns a boolean if a field has been set. + +### GetLastUpdatedAt + +`func (o *Usagemetric) GetLastUpdatedAt() string` + +GetLastUpdatedAt returns the LastUpdatedAt field if non-nil, zero value otherwise. + +### GetLastUpdatedAtOk + +`func (o *Usagemetric) GetLastUpdatedAtOk() (*string, bool)` + +GetLastUpdatedAtOk returns a tuple with the LastUpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastUpdatedAt + +`func (o *Usagemetric) SetLastUpdatedAt(v string)` + +SetLastUpdatedAt sets LastUpdatedAt field to given value. + +### HasLastUpdatedAt + +`func (o *Usagemetric) HasLastUpdatedAt() bool` + +HasLastUpdatedAt 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/Usagemetrics.md b/docs/Usagemetrics.md new file mode 100644 index 0000000..7df2d42 --- /dev/null +++ b/docs/Usagemetrics.md @@ -0,0 +1,54 @@ +# Usagemetrics + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | Pointer to [**[]Usagemetric**](Usagemetric.md) | | [optional] + +## Methods + +### NewUsagemetrics + +`func NewUsagemetrics() *Usagemetrics` + +NewUsagemetrics instantiates a new Usagemetrics 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 + +### NewUsagemetricsWithDefaults + +`func NewUsagemetricsWithDefaults() *Usagemetrics` + +NewUsagemetricsWithDefaults instantiates a new Usagemetrics 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 *Usagemetrics) GetData() []Usagemetric` + +GetData returns the Data field if non-nil, zero value otherwise. + +### GetDataOk + +`func (o *Usagemetrics) GetDataOk() (*[]Usagemetric, 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 *Usagemetrics) SetData(v []Usagemetric)` + +SetData sets Data field to given value. + +### HasData + +`func (o *Usagemetrics) 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/Values503Responses.md b/docs/Values503Responses.md new file mode 100644 index 0000000..9dfde39 --- /dev/null +++ b/docs/Values503Responses.md @@ -0,0 +1,106 @@ +# Values503Responses + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**URL** | Pointer to **string** | The HTTP request path. | [optional] +**RatePerURL** | Pointer to **float32** | The rate at which the reason in this dimension occurs among responses to this URL with a 503 status code. | [optional] +**Var503RatePerURL** | Pointer to **float32** | The rate at which 503 status codes are returned for this URL. | [optional] + +## Methods + +### NewValues503Responses + +`func NewValues503Responses() *Values503Responses` + +NewValues503Responses instantiates a new Values503Responses 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 + +### NewValues503ResponsesWithDefaults + +`func NewValues503ResponsesWithDefaults() *Values503Responses` + +NewValues503ResponsesWithDefaults instantiates a new Values503Responses 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 + +### GetURL + +`func (o *Values503Responses) GetURL() string` + +GetURL returns the URL field if non-nil, zero value otherwise. + +### GetURLOk + +`func (o *Values503Responses) GetURLOk() (*string, bool)` + +GetURLOk returns a tuple with the URL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetURL + +`func (o *Values503Responses) SetURL(v string)` + +SetURL sets URL field to given value. + +### HasURL + +`func (o *Values503Responses) HasURL() bool` + +HasURL returns a boolean if a field has been set. + +### GetRatePerURL + +`func (o *Values503Responses) GetRatePerURL() float32` + +GetRatePerURL returns the RatePerURL field if non-nil, zero value otherwise. + +### GetRatePerURLOk + +`func (o *Values503Responses) GetRatePerURLOk() (*float32, bool)` + +GetRatePerURLOk returns a tuple with the RatePerURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRatePerURL + +`func (o *Values503Responses) SetRatePerURL(v float32)` + +SetRatePerURL sets RatePerURL field to given value. + +### HasRatePerURL + +`func (o *Values503Responses) HasRatePerURL() bool` + +HasRatePerURL returns a boolean if a field has been set. + +### GetVar503RatePerURL + +`func (o *Values503Responses) GetVar503RatePerURL() float32` + +GetVar503RatePerURL returns the Var503RatePerURL field if non-nil, zero value otherwise. + +### GetVar503RatePerURLOk + +`func (o *Values503Responses) GetVar503RatePerURLOk() (*float32, bool)` + +GetVar503RatePerURLOk returns a tuple with the Var503RatePerURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVar503RatePerURL + +`func (o *Values503Responses) SetVar503RatePerURL(v float32)` + +SetVar503RatePerURL sets Var503RatePerURL field to given value. + +### HasVar503RatePerURL + +`func (o *Values503Responses) HasVar503RatePerURL() bool` + +HasVar503RatePerURL 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/ValuesBandwidth.md b/docs/ValuesBandwidth.md new file mode 100644 index 0000000..49369d6 --- /dev/null +++ b/docs/ValuesBandwidth.md @@ -0,0 +1,80 @@ +# ValuesBandwidth + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AverageBandwidthBytes** | Pointer to **float32** | The average bandwidth in bytes for responses to requests to the URL in the current dimension. | [optional] +**BandwidthPercentage** | Pointer to **float32** | The total bandwidth percentage for all responses to requests to the URL in the current dimension. | [optional] + +## Methods + +### NewValuesBandwidth + +`func NewValuesBandwidth() *ValuesBandwidth` + +NewValuesBandwidth instantiates a new ValuesBandwidth 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 + +### NewValuesBandwidthWithDefaults + +`func NewValuesBandwidthWithDefaults() *ValuesBandwidth` + +NewValuesBandwidthWithDefaults instantiates a new ValuesBandwidth 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 + +### GetAverageBandwidthBytes + +`func (o *ValuesBandwidth) GetAverageBandwidthBytes() float32` + +GetAverageBandwidthBytes returns the AverageBandwidthBytes field if non-nil, zero value otherwise. + +### GetAverageBandwidthBytesOk + +`func (o *ValuesBandwidth) GetAverageBandwidthBytesOk() (*float32, bool)` + +GetAverageBandwidthBytesOk returns a tuple with the AverageBandwidthBytes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAverageBandwidthBytes + +`func (o *ValuesBandwidth) SetAverageBandwidthBytes(v float32)` + +SetAverageBandwidthBytes sets AverageBandwidthBytes field to given value. + +### HasAverageBandwidthBytes + +`func (o *ValuesBandwidth) HasAverageBandwidthBytes() bool` + +HasAverageBandwidthBytes returns a boolean if a field has been set. + +### GetBandwidthPercentage + +`func (o *ValuesBandwidth) GetBandwidthPercentage() float32` + +GetBandwidthPercentage returns the BandwidthPercentage field if non-nil, zero value otherwise. + +### GetBandwidthPercentageOk + +`func (o *ValuesBandwidth) GetBandwidthPercentageOk() (*float32, bool)` + +GetBandwidthPercentageOk returns a tuple with the BandwidthPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBandwidthPercentage + +`func (o *ValuesBandwidth) SetBandwidthPercentage(v float32)` + +SetBandwidthPercentage sets BandwidthPercentage field to given value. + +### HasBandwidthPercentage + +`func (o *ValuesBandwidth) HasBandwidthPercentage() bool` + +HasBandwidthPercentage 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/ValuesBrowser.md b/docs/ValuesBrowser.md new file mode 100644 index 0000000..e237c93 --- /dev/null +++ b/docs/ValuesBrowser.md @@ -0,0 +1,80 @@ +# ValuesBrowser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BrowserVersion** | Pointer to **string** | The version of the client's browser. | [optional] +**Rate** | Pointer to **float32** | The percentage of requests by this version of the browser specified in the dimension. | [optional] + +## Methods + +### NewValuesBrowser + +`func NewValuesBrowser() *ValuesBrowser` + +NewValuesBrowser instantiates a new ValuesBrowser 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 + +### NewValuesBrowserWithDefaults + +`func NewValuesBrowserWithDefaults() *ValuesBrowser` + +NewValuesBrowserWithDefaults instantiates a new ValuesBrowser 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 + +### GetBrowserVersion + +`func (o *ValuesBrowser) GetBrowserVersion() string` + +GetBrowserVersion returns the BrowserVersion field if non-nil, zero value otherwise. + +### GetBrowserVersionOk + +`func (o *ValuesBrowser) GetBrowserVersionOk() (*string, bool)` + +GetBrowserVersionOk returns a tuple with the BrowserVersion field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBrowserVersion + +`func (o *ValuesBrowser) SetBrowserVersion(v string)` + +SetBrowserVersion sets BrowserVersion field to given value. + +### HasBrowserVersion + +`func (o *ValuesBrowser) HasBrowserVersion() bool` + +HasBrowserVersion returns a boolean if a field has been set. + +### GetRate + +`func (o *ValuesBrowser) GetRate() float32` + +GetRate returns the Rate field if non-nil, zero value otherwise. + +### GetRateOk + +`func (o *ValuesBrowser) GetRateOk() (*float32, bool)` + +GetRateOk returns a tuple with the Rate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRate + +`func (o *ValuesBrowser) SetRate(v float32)` + +SetRate sets Rate field to given value. + +### HasRate + +`func (o *ValuesBrowser) HasRate() bool` + +HasRate 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/ValuesCacheHitRatio.md b/docs/ValuesCacheHitRatio.md new file mode 100644 index 0000000..22d8674 --- /dev/null +++ b/docs/ValuesCacheHitRatio.md @@ -0,0 +1,54 @@ +# ValuesCacheHitRatio + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CacheHitRatio** | Pointer to **float32** | The cache hit ratio for the URL specified in the dimension. | [optional] + +## Methods + +### NewValuesCacheHitRatio + +`func NewValuesCacheHitRatio() *ValuesCacheHitRatio` + +NewValuesCacheHitRatio instantiates a new ValuesCacheHitRatio 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 + +### NewValuesCacheHitRatioWithDefaults + +`func NewValuesCacheHitRatioWithDefaults() *ValuesCacheHitRatio` + +NewValuesCacheHitRatioWithDefaults instantiates a new ValuesCacheHitRatio 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 + +### GetCacheHitRatio + +`func (o *ValuesCacheHitRatio) GetCacheHitRatio() float32` + +GetCacheHitRatio returns the CacheHitRatio field if non-nil, zero value otherwise. + +### GetCacheHitRatioOk + +`func (o *ValuesCacheHitRatio) GetCacheHitRatioOk() (*float32, bool)` + +GetCacheHitRatioOk returns a tuple with the CacheHitRatio field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCacheHitRatio + +`func (o *ValuesCacheHitRatio) SetCacheHitRatio(v float32)` + +SetCacheHitRatio sets CacheHitRatio field to given value. + +### HasCacheHitRatio + +`func (o *ValuesCacheHitRatio) HasCacheHitRatio() bool` + +HasCacheHitRatio 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/ValuesCountryStats.md b/docs/ValuesCountryStats.md new file mode 100644 index 0000000..483d45c --- /dev/null +++ b/docs/ValuesCountryStats.md @@ -0,0 +1,106 @@ +# ValuesCountryStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Region** | Pointer to **string** | The client's country subdivision code as defined by ISO 3166-2. | [optional] +**RegionChr** | Pointer to **float32** | The cache hit ratio for the region. | [optional] +**RegionErrorRate** | Pointer to **float32** | The error rate for the region. | [optional] + +## Methods + +### NewValuesCountryStats + +`func NewValuesCountryStats() *ValuesCountryStats` + +NewValuesCountryStats instantiates a new ValuesCountryStats 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 + +### NewValuesCountryStatsWithDefaults + +`func NewValuesCountryStatsWithDefaults() *ValuesCountryStats` + +NewValuesCountryStatsWithDefaults instantiates a new ValuesCountryStats 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 + +### GetRegion + +`func (o *ValuesCountryStats) GetRegion() string` + +GetRegion returns the Region field if non-nil, zero value otherwise. + +### GetRegionOk + +`func (o *ValuesCountryStats) 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 *ValuesCountryStats) SetRegion(v string)` + +SetRegion sets Region field to given value. + +### HasRegion + +`func (o *ValuesCountryStats) HasRegion() bool` + +HasRegion returns a boolean if a field has been set. + +### GetRegionChr + +`func (o *ValuesCountryStats) GetRegionChr() float32` + +GetRegionChr returns the RegionChr field if non-nil, zero value otherwise. + +### GetRegionChrOk + +`func (o *ValuesCountryStats) GetRegionChrOk() (*float32, bool)` + +GetRegionChrOk returns a tuple with the RegionChr field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegionChr + +`func (o *ValuesCountryStats) SetRegionChr(v float32)` + +SetRegionChr sets RegionChr field to given value. + +### HasRegionChr + +`func (o *ValuesCountryStats) HasRegionChr() bool` + +HasRegionChr returns a boolean if a field has been set. + +### GetRegionErrorRate + +`func (o *ValuesCountryStats) GetRegionErrorRate() float32` + +GetRegionErrorRate returns the RegionErrorRate field if non-nil, zero value otherwise. + +### GetRegionErrorRateOk + +`func (o *ValuesCountryStats) GetRegionErrorRateOk() (*float32, bool)` + +GetRegionErrorRateOk returns a tuple with the RegionErrorRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRegionErrorRate + +`func (o *ValuesCountryStats) SetRegionErrorRate(v float32)` + +SetRegionErrorRate sets RegionErrorRate field to given value. + +### HasRegionErrorRate + +`func (o *ValuesCountryStats) HasRegionErrorRate() bool` + +HasRegionErrorRate 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/ValuesDuration.md b/docs/ValuesDuration.md new file mode 100644 index 0000000..80afca7 --- /dev/null +++ b/docs/ValuesDuration.md @@ -0,0 +1,106 @@ +# ValuesDuration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AverageResponseTime** | Pointer to **float32** | The average time in seconds to respond to requests to the URL in the current dimension. | [optional] +**P95ResponseTime** | Pointer to **float32** | The P95 time in seconds to respond to requests to the URL in the current dimension. | [optional] +**ResponseTimePercentage** | Pointer to **float32** | The total percentage of time to respond to all requests to the URL in the current dimension. | [optional] + +## Methods + +### NewValuesDuration + +`func NewValuesDuration() *ValuesDuration` + +NewValuesDuration instantiates a new ValuesDuration 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 + +### NewValuesDurationWithDefaults + +`func NewValuesDurationWithDefaults() *ValuesDuration` + +NewValuesDurationWithDefaults instantiates a new ValuesDuration 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 + +### GetAverageResponseTime + +`func (o *ValuesDuration) GetAverageResponseTime() float32` + +GetAverageResponseTime returns the AverageResponseTime field if non-nil, zero value otherwise. + +### GetAverageResponseTimeOk + +`func (o *ValuesDuration) GetAverageResponseTimeOk() (*float32, bool)` + +GetAverageResponseTimeOk returns a tuple with the AverageResponseTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAverageResponseTime + +`func (o *ValuesDuration) SetAverageResponseTime(v float32)` + +SetAverageResponseTime sets AverageResponseTime field to given value. + +### HasAverageResponseTime + +`func (o *ValuesDuration) HasAverageResponseTime() bool` + +HasAverageResponseTime returns a boolean if a field has been set. + +### GetP95ResponseTime + +`func (o *ValuesDuration) GetP95ResponseTime() float32` + +GetP95ResponseTime returns the P95ResponseTime field if non-nil, zero value otherwise. + +### GetP95ResponseTimeOk + +`func (o *ValuesDuration) GetP95ResponseTimeOk() (*float32, bool)` + +GetP95ResponseTimeOk returns a tuple with the P95ResponseTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetP95ResponseTime + +`func (o *ValuesDuration) SetP95ResponseTime(v float32)` + +SetP95ResponseTime sets P95ResponseTime field to given value. + +### HasP95ResponseTime + +`func (o *ValuesDuration) HasP95ResponseTime() bool` + +HasP95ResponseTime returns a boolean if a field has been set. + +### GetResponseTimePercentage + +`func (o *ValuesDuration) GetResponseTimePercentage() float32` + +GetResponseTimePercentage returns the ResponseTimePercentage field if non-nil, zero value otherwise. + +### GetResponseTimePercentageOk + +`func (o *ValuesDuration) GetResponseTimePercentageOk() (*float32, bool)` + +GetResponseTimePercentageOk returns a tuple with the ResponseTimePercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResponseTimePercentage + +`func (o *ValuesDuration) SetResponseTimePercentage(v float32)` + +SetResponseTimePercentage sets ResponseTimePercentage field to given value. + +### HasResponseTimePercentage + +`func (o *ValuesDuration) HasResponseTimePercentage() bool` + +HasResponseTimePercentage 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/ValuesMisses.md b/docs/ValuesMisses.md new file mode 100644 index 0000000..0364cf6 --- /dev/null +++ b/docs/ValuesMisses.md @@ -0,0 +1,54 @@ +# ValuesMisses + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MissRate** | Pointer to **float32** | The miss rate for requests to the URL in the current dimension. | [optional] + +## Methods + +### NewValuesMisses + +`func NewValuesMisses() *ValuesMisses` + +NewValuesMisses instantiates a new ValuesMisses 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 + +### NewValuesMissesWithDefaults + +`func NewValuesMissesWithDefaults() *ValuesMisses` + +NewValuesMissesWithDefaults instantiates a new ValuesMisses 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 + +### GetMissRate + +`func (o *ValuesMisses) GetMissRate() float32` + +GetMissRate returns the MissRate field if non-nil, zero value otherwise. + +### GetMissRateOk + +`func (o *ValuesMisses) GetMissRateOk() (*float32, bool)` + +GetMissRateOk returns a tuple with the MissRate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMissRate + +`func (o *ValuesMisses) SetMissRate(v float32)` + +SetMissRate sets MissRate field to given value. + +### HasMissRate + +`func (o *ValuesMisses) HasMissRate() bool` + +HasMissRate 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/ValuesRate.md b/docs/ValuesRate.md new file mode 100644 index 0000000..f039ea4 --- /dev/null +++ b/docs/ValuesRate.md @@ -0,0 +1,54 @@ +# ValuesRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Rate** | Pointer to **float32** | The percentage of requests matching the value in the current dimension. | [optional] + +## Methods + +### NewValuesRate + +`func NewValuesRate() *ValuesRate` + +NewValuesRate instantiates a new ValuesRate 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 + +### NewValuesRateWithDefaults + +`func NewValuesRateWithDefaults() *ValuesRate` + +NewValuesRateWithDefaults instantiates a new ValuesRate 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 + +### GetRate + +`func (o *ValuesRate) GetRate() float32` + +GetRate returns the Rate field if non-nil, zero value otherwise. + +### GetRateOk + +`func (o *ValuesRate) GetRateOk() (*float32, bool)` + +GetRateOk returns a tuple with the Rate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRate + +`func (o *ValuesRate) SetRate(v float32)` + +SetRate sets Rate field to given value. + +### HasRate + +`func (o *ValuesRate) HasRate() bool` + +HasRate 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/ValuesRequests.md b/docs/ValuesRequests.md new file mode 100644 index 0000000..12a5015 --- /dev/null +++ b/docs/ValuesRequests.md @@ -0,0 +1,54 @@ +# ValuesRequests + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequestPercentage** | Pointer to **float32** | The percentage of all requests made to the URL in the current dimension. | [optional] + +## Methods + +### NewValuesRequests + +`func NewValuesRequests() *ValuesRequests` + +NewValuesRequests instantiates a new ValuesRequests 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 + +### NewValuesRequestsWithDefaults + +`func NewValuesRequestsWithDefaults() *ValuesRequests` + +NewValuesRequestsWithDefaults instantiates a new ValuesRequests 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 + +### GetRequestPercentage + +`func (o *ValuesRequests) GetRequestPercentage() float32` + +GetRequestPercentage returns the RequestPercentage field if non-nil, zero value otherwise. + +### GetRequestPercentageOk + +`func (o *ValuesRequests) GetRequestPercentageOk() (*float32, bool)` + +GetRequestPercentageOk returns a tuple with the RequestPercentage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestPercentage + +`func (o *ValuesRequests) SetRequestPercentage(v float32)` + +SetRequestPercentage sets RequestPercentage field to given value. + +### HasRequestPercentage + +`func (o *ValuesRequests) HasRequestPercentage() bool` + +HasRequestPercentage 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/ValuesStatusCodes.md b/docs/ValuesStatusCodes.md new file mode 100644 index 0000000..e6face8 --- /dev/null +++ b/docs/ValuesStatusCodes.md @@ -0,0 +1,106 @@ +# ValuesStatusCodes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**URL** | Pointer to **string** | The HTTP request path. | [optional] +**RatePerStatus** | Pointer to **float32** | The URL accounts for this percentage of the status code in this dimension. | [optional] +**RatePerURL** | Pointer to **float32** | The rate at which the status code in this dimension occurs for this URL. | [optional] + +## Methods + +### NewValuesStatusCodes + +`func NewValuesStatusCodes() *ValuesStatusCodes` + +NewValuesStatusCodes instantiates a new ValuesStatusCodes 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 + +### NewValuesStatusCodesWithDefaults + +`func NewValuesStatusCodesWithDefaults() *ValuesStatusCodes` + +NewValuesStatusCodesWithDefaults instantiates a new ValuesStatusCodes 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 + +### GetURL + +`func (o *ValuesStatusCodes) GetURL() string` + +GetURL returns the URL field if non-nil, zero value otherwise. + +### GetURLOk + +`func (o *ValuesStatusCodes) GetURLOk() (*string, bool)` + +GetURLOk returns a tuple with the URL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetURL + +`func (o *ValuesStatusCodes) SetURL(v string)` + +SetURL sets URL field to given value. + +### HasURL + +`func (o *ValuesStatusCodes) HasURL() bool` + +HasURL returns a boolean if a field has been set. + +### GetRatePerStatus + +`func (o *ValuesStatusCodes) GetRatePerStatus() float32` + +GetRatePerStatus returns the RatePerStatus field if non-nil, zero value otherwise. + +### GetRatePerStatusOk + +`func (o *ValuesStatusCodes) GetRatePerStatusOk() (*float32, bool)` + +GetRatePerStatusOk returns a tuple with the RatePerStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRatePerStatus + +`func (o *ValuesStatusCodes) SetRatePerStatus(v float32)` + +SetRatePerStatus sets RatePerStatus field to given value. + +### HasRatePerStatus + +`func (o *ValuesStatusCodes) HasRatePerStatus() bool` + +HasRatePerStatus returns a boolean if a field has been set. + +### GetRatePerURL + +`func (o *ValuesStatusCodes) GetRatePerURL() float32` + +GetRatePerURL returns the RatePerURL field if non-nil, zero value otherwise. + +### GetRatePerURLOk + +`func (o *ValuesStatusCodes) GetRatePerURLOk() (*float32, bool)` + +GetRatePerURLOk returns a tuple with the RatePerURL field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRatePerURL + +`func (o *ValuesStatusCodes) SetRatePerURL(v float32)` + +SetRatePerURL sets RatePerURL field to given value. + +### HasRatePerURL + +`func (o *ValuesStatusCodes) HasRatePerURL() bool` + +HasRatePerURL 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 index 86d5d95..fb51250 100644 --- a/fastly/api_acls_in_compute.go +++ b/fastly/api_acls_in_compute.go @@ -944,15 +944,15 @@ func (a *ACLsInComputeAPIService) ComputeACLLookupAclsExecute(r APIComputeACLLoo // APIComputeACLUpdateAclsRequest represents a request for the resource. type APIComputeACLUpdateAclsRequest struct { - ctx context.Context - APIService ACLsInComputeAPI - aclID string - computeACLUpdateEntry *[]ComputeACLUpdateEntry + ctx context.Context + APIService ACLsInComputeAPI + aclID string + computeACLUpdate *ComputeACLUpdate } -// ComputeACLUpdateEntry returns a pointer to a request. -func (r *APIComputeACLUpdateAclsRequest) ComputeACLUpdateEntry(computeACLUpdateEntry []ComputeACLUpdateEntry) *APIComputeACLUpdateAclsRequest { - r.computeACLUpdateEntry = &computeACLUpdateEntry +// ComputeACLUpdate returns a pointer to a request. +func (r *APIComputeACLUpdateAclsRequest) ComputeACLUpdate(computeACLUpdate ComputeACLUpdate) *APIComputeACLUpdateAclsRequest { + r.computeACLUpdate = &computeACLUpdate return r } @@ -1016,7 +1016,7 @@ func (a *ACLsInComputeAPIService) ComputeACLUpdateAclsExecute(r APIComputeACLUpd localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } // body params - localVarPostBody = r.computeACLUpdateEntry + localVarPostBody = r.computeACLUpdate if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { diff --git a/fastly/api_billing_usage_metrics.go b/fastly/api_billing_usage_metrics.go index 909729c..33a2ebf 100644 --- a/fastly/api_billing_usage_metrics.go +++ b/fastly/api_billing_usage_metrics.go @@ -19,7 +19,6 @@ import ( "net/http" gourl "net/url" "strconv" - "strings" ) // Linger please @@ -36,29 +35,27 @@ type BillingUsageMetricsAPI interface { Returns product usage, broken down by service. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param customerID Alphanumeric string identifying the customer. @return APIGetServiceLevelUsageRequest */ - GetServiceLevelUsage(ctx context.Context, customerID string) APIGetServiceLevelUsageRequest + GetServiceLevelUsage(ctx context.Context) APIGetServiceLevelUsageRequest // GetServiceLevelUsageExecute executes the request // @return Serviceusagemetrics GetServiceLevelUsageExecute(r APIGetServiceLevelUsageRequest) (*Serviceusagemetrics, *http.Response, error) /* - GetServiceLevelUsageTypes Retrieve product usage types for a customer. + GetUsageMetrics Get monthly usage metrics - Returns product usage types reported by the customer's services. + Returns monthly usage metrics for customer by product. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param customerID Alphanumeric string identifying the customer. - @return APIGetServiceLevelUsageTypesRequest + @return APIGetUsageMetricsRequest */ - GetServiceLevelUsageTypes(ctx context.Context, customerID string) APIGetServiceLevelUsageTypesRequest + GetUsageMetrics(ctx context.Context) APIGetUsageMetricsRequest - // GetServiceLevelUsageTypesExecute executes the request - // @return Serviceusagetypes - GetServiceLevelUsageTypesExecute(r APIGetServiceLevelUsageTypesRequest) (*Serviceusagetypes, *http.Response, error) + // GetUsageMetricsExecute executes the request + // @return Usagemetric + GetUsageMetricsExecute(r APIGetUsageMetricsRequest) (*Usagemetric, *http.Response, error) } // BillingUsageMetricsAPIService BillingUsageMetricsAPI service @@ -66,18 +63,14 @@ type BillingUsageMetricsAPIService service // APIGetServiceLevelUsageRequest represents a request for the resource. type APIGetServiceLevelUsageRequest struct { - ctx context.Context - APIService BillingUsageMetricsAPI - customerID string - productID *string - usageTypeName *string - timeGranularity *string - startDate *string - endDate *string - startMonth *string - endMonth *string - limit *string - cursor *string + ctx context.Context + APIService BillingUsageMetricsAPI + productID *string + usageTypeName *string + startMonth *string + endMonth *string + limit *string + cursor *string } // ProductID The product identifier for the metrics returned (e.g., `cdn_usage`). This field is not required for CSV requests. @@ -92,24 +85,6 @@ func (r *APIGetServiceLevelUsageRequest) UsageTypeName(usageTypeName string) *AP return r } -// TimeGranularity returns a pointer to a request. -func (r *APIGetServiceLevelUsageRequest) TimeGranularity(timeGranularity string) *APIGetServiceLevelUsageRequest { - r.timeGranularity = &timeGranularity - return r -} - -// StartDate returns a pointer to a request. -func (r *APIGetServiceLevelUsageRequest) StartDate(startDate string) *APIGetServiceLevelUsageRequest { - r.startDate = &startDate - return r -} - -// EndDate returns a pointer to a request. -func (r *APIGetServiceLevelUsageRequest) EndDate(endDate string) *APIGetServiceLevelUsageRequest { - r.endDate = &endDate - return r -} - // StartMonth returns a pointer to a request. func (r *APIGetServiceLevelUsageRequest) StartMonth(startMonth string) *APIGetServiceLevelUsageRequest { r.startMonth = &startMonth @@ -145,14 +120,12 @@ GetServiceLevelUsage Retrieve service-level usage metrics for a product. Returns product usage, broken down by service. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param customerID Alphanumeric string identifying the customer. @return APIGetServiceLevelUsageRequest */ -func (a *BillingUsageMetricsAPIService) GetServiceLevelUsage(ctx context.Context, customerID string) APIGetServiceLevelUsageRequest { +func (a *BillingUsageMetricsAPIService) GetServiceLevelUsage(ctx context.Context) APIGetServiceLevelUsageRequest { return APIGetServiceLevelUsageRequest{ APIService: a, ctx: ctx, - customerID: customerID, } } @@ -171,8 +144,7 @@ func (a *BillingUsageMetricsAPIService) GetServiceLevelUsageExecute(r APIGetServ return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} } - localVarPath := localBasePath + "/billing/v2/account_customers/{customer_id}/service-usage-metrics" - localVarPath = strings.ReplaceAll(localVarPath, "{"+"customer_id"+"}", gourl.PathEscape(parameterToString(r.customerID, ""))) + localVarPath := localBasePath + "/billing/v3/service-usage-metrics" localVarHeaderParams := make(map[string]string) localVarQueryParams := gourl.Values{} @@ -183,19 +155,9 @@ func (a *BillingUsageMetricsAPIService) GetServiceLevelUsageExecute(r APIGetServ if r.usageTypeName == nil { return localVarReturnValue, nil, reportError("usageTypeName is required and must be specified") } - if r.timeGranularity == nil { - return localVarReturnValue, nil, reportError("timeGranularity is required and must be specified") - } localVarQueryParams.Add("product_id", parameterToString(*r.productID, "")) localVarQueryParams.Add("usage_type_name", parameterToString(*r.usageTypeName, "")) - localVarQueryParams.Add("time_granularity", parameterToString(*r.timeGranularity, "")) - if r.startDate != nil { - localVarQueryParams.Add("start_date", parameterToString(*r.startDate, "")) - } - if r.endDate != nil { - localVarQueryParams.Add("end_date", parameterToString(*r.endDate, "")) - } if r.startMonth != nil { localVarQueryParams.Add("start_month", parameterToString(*r.startMonth, "")) } @@ -318,57 +280,73 @@ func (a *BillingUsageMetricsAPIService) GetServiceLevelUsageExecute(r APIGetServ return localVarReturnValue, localVarHTTPResponse, nil } -// APIGetServiceLevelUsageTypesRequest represents a request for the resource. -type APIGetServiceLevelUsageTypesRequest struct { +// APIGetUsageMetricsRequest represents a request for the resource. +type APIGetUsageMetricsRequest struct { ctx context.Context APIService BillingUsageMetricsAPI - customerID string + startMonth *string + endMonth *string +} + +// StartMonth returns a pointer to a request. +func (r *APIGetUsageMetricsRequest) StartMonth(startMonth string) *APIGetUsageMetricsRequest { + r.startMonth = &startMonth + return r +} + +// EndMonth returns a pointer to a request. +func (r *APIGetUsageMetricsRequest) EndMonth(endMonth string) *APIGetUsageMetricsRequest { + r.endMonth = &endMonth + return r } // Execute calls the API using the request data configured. -func (r APIGetServiceLevelUsageTypesRequest) Execute() (*Serviceusagetypes, *http.Response, error) { - return r.APIService.GetServiceLevelUsageTypesExecute(r) +func (r APIGetUsageMetricsRequest) Execute() (*Usagemetric, *http.Response, error) { + return r.APIService.GetUsageMetricsExecute(r) } /* -GetServiceLevelUsageTypes Retrieve product usage types for a customer. +GetUsageMetrics Get monthly usage metrics -Returns product usage types reported by the customer's services. +Returns monthly usage metrics for customer by product. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param customerID Alphanumeric string identifying the customer. - @return APIGetServiceLevelUsageTypesRequest + @return APIGetUsageMetricsRequest */ -func (a *BillingUsageMetricsAPIService) GetServiceLevelUsageTypes(ctx context.Context, customerID string) APIGetServiceLevelUsageTypesRequest { - return APIGetServiceLevelUsageTypesRequest{ +func (a *BillingUsageMetricsAPIService) GetUsageMetrics(ctx context.Context) APIGetUsageMetricsRequest { + return APIGetUsageMetricsRequest{ APIService: a, ctx: ctx, - customerID: customerID, } } -// GetServiceLevelUsageTypesExecute executes the request -// @return Serviceusagetypes -func (a *BillingUsageMetricsAPIService) GetServiceLevelUsageTypesExecute(r APIGetServiceLevelUsageTypesRequest) (*Serviceusagetypes, *http.Response, error) { +// GetUsageMetricsExecute executes the request +// @return Usagemetric +func (a *BillingUsageMetricsAPIService) GetUsageMetricsExecute(r APIGetUsageMetricsRequest) (*Usagemetric, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody any formFiles []formFile - localVarReturnValue *Serviceusagetypes + localVarReturnValue *Usagemetric ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BillingUsageMetricsAPIService.GetServiceLevelUsageTypes") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "BillingUsageMetricsAPIService.GetUsageMetrics") if err != nil { return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} } - localVarPath := localBasePath + "/billing/v2/account_customers/{customer_id}/service-usage-types" - localVarPath = strings.ReplaceAll(localVarPath, "{"+"customer_id"+"}", gourl.PathEscape(parameterToString(r.customerID, ""))) + localVarPath := localBasePath + "/billing/v3/usage-metrics" localVarHeaderParams := make(map[string]string) localVarQueryParams := gourl.Values{} localVarFormParams := gourl.Values{} + if r.startMonth != nil { + localVarQueryParams.Add("start_month", parameterToString(*r.startMonth, "")) + } + if r.endMonth != nil { + localVarQueryParams.Add("end_month", parameterToString(*r.endMonth, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/fastly/api_enabled_products.go b/fastly/api_enabled_products.go index 13dd213..83b00c0 100644 --- a/fastly/api_enabled_products.go +++ b/fastly/api_enabled_products.go @@ -33,7 +33,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`, `websockets`, `bot_management`, and `ngwaf`. + Disable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, `ngwaf`, `ddos_protection`, and `log_explorer_insights`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -48,7 +48,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`, `websockets`, `bot_management`, and `ngwaf`. + Enable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, `ngwaf`, `ddos_protection`, and `log_explorer_insights`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -64,7 +64,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`, `websockets`, `bot_management`, and `ngwaf`. + Get enabled product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, `ngwaf`, `ddos_protection`, and `log_explorer_insights`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -80,7 +80,7 @@ type EnabledProductsAPI interface { /* GetProductConfiguration Get configuration for a product - Get configuration for an enabled product on a service. Supported product IDs: `ngwaf`. + Get configuration for an enabled product on a service. Supported product IDs: `ngwaf` and `ddos_protection`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -96,7 +96,7 @@ type EnabledProductsAPI interface { /* SetProductConfiguration Update configuration for a product - Update configuration for an enabled product on a service. Supported product IDs: `ngwaf`. + Update configuration for an enabled product on a service. Supported product IDs: `ngwaf` and `ddos_protection`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -129,7 +129,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`, `websockets`, `bot_management`, and `ngwaf`. +Disable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, `ngwaf`, `ddos_protection`, and `log_explorer_insights`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -261,7 +261,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`, `websockets`, `bot_management`, and `ngwaf`. +Enable a product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, `ngwaf`, `ddos_protection`, and `log_explorer_insights`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -399,7 +399,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`, `websockets`, `bot_management`, and `ngwaf`. +Get enabled product on a service. Supported product IDs: `brotli_compression`,`domain_inspector`,`fanout`,`image_optimizer`,`origin_inspector`, `websockets`, `bot_management`, `ngwaf`, `ddos_protection`, and `log_explorer_insights`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -535,7 +535,7 @@ func (r APIGetProductConfigurationRequest) Execute() (*ConfiguredProductResponse /* GetProductConfiguration Get configuration for a product -Get configuration for an enabled product on a service. Supported product IDs: `ngwaf`. +Get configuration for an enabled product on a service. Supported product IDs: `ngwaf` and `ddos_protection`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID @@ -678,7 +678,7 @@ func (r APISetProductConfigurationRequest) Execute() (*ConfiguredProductResponse /* SetProductConfiguration Update configuration for a product -Update configuration for an enabled product on a service. Supported product IDs: `ngwaf`. +Update configuration for an enabled product on a service. Supported product IDs: `ngwaf` and `ddos_protection`. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param productID diff --git a/fastly/api_insights.go b/fastly/api_insights.go new file mode 100644 index 0000000..db1d8aa --- /dev/null +++ b/fastly/api_insights.go @@ -0,0 +1,260 @@ +// 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" +) + +// Linger please +var ( + _ context.Context +) + +// InsightsAPI defines an interface for interacting with the resource. +type InsightsAPI interface { + + /* + GetLogInsights Retrieve log insights + + Retrieves statistics from sampled log records. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIGetLogInsightsRequest + */ + GetLogInsights(ctx context.Context) APIGetLogInsightsRequest + + // GetLogInsightsExecute executes the request + // @return GetLogInsightsResponse + GetLogInsightsExecute(r APIGetLogInsightsRequest) (*GetLogInsightsResponse, *http.Response, error) +} + +// InsightsAPIService InsightsAPI service +type InsightsAPIService service + +// APIGetLogInsightsRequest represents a request for the resource. +type APIGetLogInsightsRequest struct { + ctx context.Context + APIService InsightsAPI + visualization *string + serviceID *string + start *string + end *string + pops *string + domain *string + domainExactMatch *bool + limit *float32 +} + +// Visualization returns a pointer to a request. +func (r *APIGetLogInsightsRequest) Visualization(visualization string) *APIGetLogInsightsRequest { + r.visualization = &visualization + return r +} + +// ServiceID returns a pointer to a request. +func (r *APIGetLogInsightsRequest) ServiceID(serviceID string) *APIGetLogInsightsRequest { + r.serviceID = &serviceID + return r +} + +// Start returns a pointer to a request. +func (r *APIGetLogInsightsRequest) Start(start string) *APIGetLogInsightsRequest { + r.start = &start + return r +} + +// End returns a pointer to a request. +func (r *APIGetLogInsightsRequest) End(end string) *APIGetLogInsightsRequest { + r.end = &end + return r +} + +// Pops returns a pointer to a request. +func (r *APIGetLogInsightsRequest) Pops(pops string) *APIGetLogInsightsRequest { + r.pops = &pops + return r +} + +// Domain returns a pointer to a request. +func (r *APIGetLogInsightsRequest) Domain(domain string) *APIGetLogInsightsRequest { + r.domain = &domain + return r +} + +// DomainExactMatch returns a pointer to a request. +func (r *APIGetLogInsightsRequest) DomainExactMatch(domainExactMatch bool) *APIGetLogInsightsRequest { + r.domainExactMatch = &domainExactMatch + return r +} + +// Limit returns a pointer to a request. +func (r *APIGetLogInsightsRequest) Limit(limit float32) *APIGetLogInsightsRequest { + r.limit = &limit + return r +} + +// Execute calls the API using the request data configured. +func (r APIGetLogInsightsRequest) Execute() (*GetLogInsightsResponse, *http.Response, error) { + return r.APIService.GetLogInsightsExecute(r) +} + +/* +GetLogInsights Retrieve log insights + +Retrieves statistics from sampled log records. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIGetLogInsightsRequest +*/ +func (a *InsightsAPIService) GetLogInsights(ctx context.Context) APIGetLogInsightsRequest { + return APIGetLogInsightsRequest{ + APIService: a, + ctx: ctx, + } +} + +// GetLogInsightsExecute executes the request +// @return GetLogInsightsResponse +func (a *InsightsAPIService) GetLogInsightsExecute(r APIGetLogInsightsRequest) (*GetLogInsightsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *GetLogInsightsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InsightsAPIService.GetLogInsights") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/observability/log-insights" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + if r.visualization == nil { + return localVarReturnValue, nil, reportError("visualization is required and must be specified") + } + if r.serviceID == nil { + return localVarReturnValue, nil, reportError("serviceID is required and must be specified") + } + if r.start == nil { + return localVarReturnValue, nil, reportError("start is required and must be specified") + } + if r.end == nil { + return localVarReturnValue, nil, reportError("end is required and must be specified") + } + + localVarQueryParams.Add("visualization", parameterToString(*r.visualization, "")) + localVarQueryParams.Add("service_id", parameterToString(*r.serviceID, "")) + localVarQueryParams.Add("start", parameterToString(*r.start, "")) + localVarQueryParams.Add("end", parameterToString(*r.end, "")) + if r.pops != nil { + localVarQueryParams.Add("pops", parameterToString(*r.pops, "")) + } + if r.domain != nil { + localVarQueryParams.Add("domain", parameterToString(*r.domain, "")) + } + if r.domainExactMatch != nil { + localVarQueryParams.Add("domain_exact_match", parameterToString(*r.domainExactMatch, "")) + } + 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 +} diff --git a/fastly/api_kv_store_item.go b/fastly/api_kv_store_item.go index 670c233..e8a6358 100644 --- a/fastly/api_kv_store_item.go +++ b/fastly/api_kv_store_item.go @@ -223,12 +223,13 @@ func (a *KvStoreItemAPIService) DeleteKeyFromStoreExecute(r APIDeleteKeyFromStor // APIGetKeysRequest represents a request for the resource. type APIGetKeysRequest struct { - ctx context.Context - APIService KvStoreItemAPI - storeID string - cursor *string - limit *int32 - prefix *string + ctx context.Context + APIService KvStoreItemAPI + storeID string + cursor *string + limit *int32 + prefix *string + consistency *string } // Cursor returns a pointer to a request. @@ -249,6 +250,12 @@ func (r *APIGetKeysRequest) Prefix(prefix string) *APIGetKeysRequest { return r } +// Consistency returns a pointer to a request. +func (r *APIGetKeysRequest) Consistency(consistency string) *APIGetKeysRequest { + r.consistency = &consistency + return r +} + // Execute calls the API using the request data configured. func (r APIGetKeysRequest) Execute() (*InlineResponse2004, *http.Response, error) { return r.APIService.GetKeysExecute(r) @@ -302,6 +309,9 @@ func (a *KvStoreItemAPIService) GetKeysExecute(r APIGetKeysRequest) (*InlineResp if r.prefix != nil { localVarQueryParams.Add("prefix", parameterToString(*r.prefix, "")) } + if r.consistency != nil { + localVarQueryParams.Add("consistency", parameterToString(*r.consistency, "")) + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} diff --git a/fastly/api_logging_grafanacloudlogs.go b/fastly/api_logging_grafanacloudlogs.go new file mode 100644 index 0000000..ee51972 --- /dev/null +++ b/fastly/api_logging_grafanacloudlogs.go @@ -0,0 +1,990 @@ +// 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 +) + +// LoggingGrafanacloudlogsAPI defines an interface for interacting with the resource. +type LoggingGrafanacloudlogsAPI interface { + + /* + CreateLogGrafanacloudlogs Create a Grafana Cloud Logs log endpoint + + Create a Grafana Cloud Logs logging object for a particular service and version. + + @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. + @return APICreateLogGrafanacloudlogsRequest + */ + CreateLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32) APICreateLogGrafanacloudlogsRequest + + // CreateLogGrafanacloudlogsExecute executes the request + // @return LoggingGrafanacloudlogsResponse + CreateLogGrafanacloudlogsExecute(r APICreateLogGrafanacloudlogsRequest) (*LoggingGrafanacloudlogsResponse, *http.Response, error) + + /* + DeleteLogGrafanacloudlogs Delete the Grafana Cloud Logs log endpoint + + Delete the Grafana Cloud Logs logging object for a particular service and version. + + @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 loggingGrafanacloudlogsName The name for the real-time logging configuration. + @return APIDeleteLogGrafanacloudlogsRequest + */ + DeleteLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32, loggingGrafanacloudlogsName string) APIDeleteLogGrafanacloudlogsRequest + + // DeleteLogGrafanacloudlogsExecute executes the request + // @return InlineResponse200 + DeleteLogGrafanacloudlogsExecute(r APIDeleteLogGrafanacloudlogsRequest) (*InlineResponse200, *http.Response, error) + + /* + GetLogGrafanacloudlogs Get a Grafana Cloud Logs log endpoint + + Get the details of a Grafana Cloud Logs logging object for a particular service and version. + + @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 loggingGrafanacloudlogsName The name for the real-time logging configuration. + @return APIGetLogGrafanacloudlogsRequest + */ + GetLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32, loggingGrafanacloudlogsName string) APIGetLogGrafanacloudlogsRequest + + // GetLogGrafanacloudlogsExecute executes the request + // @return LoggingGrafanacloudlogsResponse + GetLogGrafanacloudlogsExecute(r APIGetLogGrafanacloudlogsRequest) (*LoggingGrafanacloudlogsResponse, *http.Response, error) + + /* + ListLogGrafanacloudlogs List Grafana Cloud Logs log endpoints + + List all of the Grafana Cloud Logs logging objects for a particular service and version. + + @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. + @return APIListLogGrafanacloudlogsRequest + */ + ListLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32) APIListLogGrafanacloudlogsRequest + + // ListLogGrafanacloudlogsExecute executes the request + // @return []LoggingGrafanacloudlogsResponse + ListLogGrafanacloudlogsExecute(r APIListLogGrafanacloudlogsRequest) ([]LoggingGrafanacloudlogsResponse, *http.Response, error) + + /* + UpdateLogGrafanacloudlogs Update a Grafana Cloud Logs log endpoint + + Update a Grafana Cloud Logs logging object for a particular service and version. + + @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 loggingGrafanacloudlogsName The name for the real-time logging configuration. + @return APIUpdateLogGrafanacloudlogsRequest + */ + UpdateLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32, loggingGrafanacloudlogsName string) APIUpdateLogGrafanacloudlogsRequest + + // UpdateLogGrafanacloudlogsExecute executes the request + // @return LoggingGrafanacloudlogsResponse + UpdateLogGrafanacloudlogsExecute(r APIUpdateLogGrafanacloudlogsRequest) (*LoggingGrafanacloudlogsResponse, *http.Response, error) +} + +// LoggingGrafanacloudlogsAPIService LoggingGrafanacloudlogsAPI service +type LoggingGrafanacloudlogsAPIService service + +// APICreateLogGrafanacloudlogsRequest represents a request for the resource. +type APICreateLogGrafanacloudlogsRequest struct { + ctx context.Context + APIService LoggingGrafanacloudlogsAPI + serviceID string + versionID int32 + name *string + placement *string + responseCondition *string + format *string + formatVersion *int32 + user *string + url *string + token *string + index *string +} + +// Name The name for the real-time logging configuration. +func (r *APICreateLogGrafanacloudlogsRequest) Name(name string) *APICreateLogGrafanacloudlogsRequest { + r.name = &name + return r +} + +// Placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. +func (r *APICreateLogGrafanacloudlogsRequest) Placement(placement string) *APICreateLogGrafanacloudlogsRequest { + r.placement = &placement + return r +} + +// ResponseCondition The name of an existing condition in the configured endpoint, or leave blank to always execute. +func (r *APICreateLogGrafanacloudlogsRequest) ResponseCondition(responseCondition string) *APICreateLogGrafanacloudlogsRequest { + r.responseCondition = &responseCondition + return r +} + +// Format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). +func (r *APICreateLogGrafanacloudlogsRequest) Format(format string) *APICreateLogGrafanacloudlogsRequest { + r.format = &format + return r +} + +// FormatVersion The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. +func (r *APICreateLogGrafanacloudlogsRequest) FormatVersion(formatVersion int32) *APICreateLogGrafanacloudlogsRequest { + r.formatVersion = &formatVersion + return r +} + +// User The Grafana Cloud Logs Dataset you want to log to. +func (r *APICreateLogGrafanacloudlogsRequest) User(user string) *APICreateLogGrafanacloudlogsRequest { + r.user = &user + return r +} + +// URL The URL of the Loki instance in your Grafana stack. +func (r *APICreateLogGrafanacloudlogsRequest) URL(url string) *APICreateLogGrafanacloudlogsRequest { + r.url = &url + return r +} + +// Token The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. +func (r *APICreateLogGrafanacloudlogsRequest) Token(token string) *APICreateLogGrafanacloudlogsRequest { + r.token = &token + return r +} + +// Index The Stream Labels, a JSON string used to identify the stream. +func (r *APICreateLogGrafanacloudlogsRequest) Index(index string) *APICreateLogGrafanacloudlogsRequest { + r.index = &index + return r +} + +// Execute calls the API using the request data configured. +func (r APICreateLogGrafanacloudlogsRequest) Execute() (*LoggingGrafanacloudlogsResponse, *http.Response, error) { + return r.APIService.CreateLogGrafanacloudlogsExecute(r) +} + +/* +CreateLogGrafanacloudlogs Create a Grafana Cloud Logs log endpoint + +Create a Grafana Cloud Logs logging object for a particular service and version. + + @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. + @return APICreateLogGrafanacloudlogsRequest +*/ +func (a *LoggingGrafanacloudlogsAPIService) CreateLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32) APICreateLogGrafanacloudlogsRequest { + return APICreateLogGrafanacloudlogsRequest{ + APIService: a, + ctx: ctx, + serviceID: serviceID, + versionID: versionID, + } +} + +// CreateLogGrafanacloudlogsExecute executes the request +// @return LoggingGrafanacloudlogsResponse +func (a *LoggingGrafanacloudlogsAPIService) CreateLogGrafanacloudlogsExecute(r APICreateLogGrafanacloudlogsRequest) (*LoggingGrafanacloudlogsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *LoggingGrafanacloudlogsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoggingGrafanacloudlogsAPIService.CreateLogGrafanacloudlogs") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service/{service_id}/version/{version_id}/logging/grafanacloudlogs" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"version_id"+"}", gourl.PathEscape(parameterToString(r.versionID, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} + + // 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.name != nil { + localVarFormParams.Add("name", parameterToString(*r.name, "")) + } + if r.placement != nil { + localVarFormParams.Add("placement", parameterToString(*r.placement, "")) + } + if r.responseCondition != nil { + localVarFormParams.Add("response_condition", parameterToString(*r.responseCondition, "")) + } + if r.format != nil { + localVarFormParams.Add("format", parameterToString(*r.format, "")) + } + if r.formatVersion != nil { + localVarFormParams.Add("format_version", parameterToString(*r.formatVersion, "")) + } + if r.user != nil { + localVarFormParams.Add("user", parameterToString(*r.user, "")) + } + if r.url != nil { + localVarFormParams.Add("url", parameterToString(*r.url, "")) + } + if r.token != nil { + localVarFormParams.Add("token", parameterToString(*r.token, "")) + } + if r.index != nil { + localVarFormParams.Add("index", parameterToString(*r.index, "")) + } + 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 +} + +// APIDeleteLogGrafanacloudlogsRequest represents a request for the resource. +type APIDeleteLogGrafanacloudlogsRequest struct { + ctx context.Context + APIService LoggingGrafanacloudlogsAPI + serviceID string + versionID int32 + loggingGrafanacloudlogsName string +} + +// Execute calls the API using the request data configured. +func (r APIDeleteLogGrafanacloudlogsRequest) Execute() (*InlineResponse200, *http.Response, error) { + return r.APIService.DeleteLogGrafanacloudlogsExecute(r) +} + +/* +DeleteLogGrafanacloudlogs Delete the Grafana Cloud Logs log endpoint + +Delete the Grafana Cloud Logs logging object for a particular service and version. + + @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 loggingGrafanacloudlogsName The name for the real-time logging configuration. + @return APIDeleteLogGrafanacloudlogsRequest +*/ +func (a *LoggingGrafanacloudlogsAPIService) DeleteLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32, loggingGrafanacloudlogsName string) APIDeleteLogGrafanacloudlogsRequest { + return APIDeleteLogGrafanacloudlogsRequest{ + APIService: a, + ctx: ctx, + serviceID: serviceID, + versionID: versionID, + loggingGrafanacloudlogsName: loggingGrafanacloudlogsName, + } +} + +// DeleteLogGrafanacloudlogsExecute executes the request +// @return InlineResponse200 +func (a *LoggingGrafanacloudlogsAPIService) DeleteLogGrafanacloudlogsExecute(r APIDeleteLogGrafanacloudlogsRequest) (*InlineResponse200, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + localVarReturnValue *InlineResponse200 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoggingGrafanacloudlogsAPIService.DeleteLogGrafanacloudlogs") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service/{service_id}/version/{version_id}/logging/grafanacloudlogs/{logging_grafanacloudlogs_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, "{"+"logging_grafanacloudlogs_name"+"}", gourl.PathEscape(parameterToString(r.loggingGrafanacloudlogsName, ""))) + + 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 +} + +// APIGetLogGrafanacloudlogsRequest represents a request for the resource. +type APIGetLogGrafanacloudlogsRequest struct { + ctx context.Context + APIService LoggingGrafanacloudlogsAPI + serviceID string + versionID int32 + loggingGrafanacloudlogsName string +} + +// Execute calls the API using the request data configured. +func (r APIGetLogGrafanacloudlogsRequest) Execute() (*LoggingGrafanacloudlogsResponse, *http.Response, error) { + return r.APIService.GetLogGrafanacloudlogsExecute(r) +} + +/* +GetLogGrafanacloudlogs Get a Grafana Cloud Logs log endpoint + +Get the details of a Grafana Cloud Logs logging object for a particular service and version. + + @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 loggingGrafanacloudlogsName The name for the real-time logging configuration. + @return APIGetLogGrafanacloudlogsRequest +*/ +func (a *LoggingGrafanacloudlogsAPIService) GetLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32, loggingGrafanacloudlogsName string) APIGetLogGrafanacloudlogsRequest { + return APIGetLogGrafanacloudlogsRequest{ + APIService: a, + ctx: ctx, + serviceID: serviceID, + versionID: versionID, + loggingGrafanacloudlogsName: loggingGrafanacloudlogsName, + } +} + +// GetLogGrafanacloudlogsExecute executes the request +// @return LoggingGrafanacloudlogsResponse +func (a *LoggingGrafanacloudlogsAPIService) GetLogGrafanacloudlogsExecute(r APIGetLogGrafanacloudlogsRequest) (*LoggingGrafanacloudlogsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *LoggingGrafanacloudlogsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoggingGrafanacloudlogsAPIService.GetLogGrafanacloudlogs") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service/{service_id}/version/{version_id}/logging/grafanacloudlogs/{logging_grafanacloudlogs_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, "{"+"logging_grafanacloudlogs_name"+"}", gourl.PathEscape(parameterToString(r.loggingGrafanacloudlogsName, ""))) + + 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 +} + +// APIListLogGrafanacloudlogsRequest represents a request for the resource. +type APIListLogGrafanacloudlogsRequest struct { + ctx context.Context + APIService LoggingGrafanacloudlogsAPI + serviceID string + versionID int32 +} + +// Execute calls the API using the request data configured. +func (r APIListLogGrafanacloudlogsRequest) Execute() ([]LoggingGrafanacloudlogsResponse, *http.Response, error) { + return r.APIService.ListLogGrafanacloudlogsExecute(r) +} + +/* +ListLogGrafanacloudlogs List Grafana Cloud Logs log endpoints + +List all of the Grafana Cloud Logs logging objects for a particular service and version. + + @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. + @return APIListLogGrafanacloudlogsRequest +*/ +func (a *LoggingGrafanacloudlogsAPIService) ListLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32) APIListLogGrafanacloudlogsRequest { + return APIListLogGrafanacloudlogsRequest{ + APIService: a, + ctx: ctx, + serviceID: serviceID, + versionID: versionID, + } +} + +// ListLogGrafanacloudlogsExecute executes the request +// @return []LoggingGrafanacloudlogsResponse +func (a *LoggingGrafanacloudlogsAPIService) ListLogGrafanacloudlogsExecute(r APIListLogGrafanacloudlogsRequest) ([]LoggingGrafanacloudlogsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue []LoggingGrafanacloudlogsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoggingGrafanacloudlogsAPIService.ListLogGrafanacloudlogs") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service/{service_id}/version/{version_id}/logging/grafanacloudlogs" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"service_id"+"}", gourl.PathEscape(parameterToString(r.serviceID, ""))) + localVarPath = strings.ReplaceAll(localVarPath, "{"+"version_id"+"}", gourl.PathEscape(parameterToString(r.versionID, ""))) + + 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 +} + +// APIUpdateLogGrafanacloudlogsRequest represents a request for the resource. +type APIUpdateLogGrafanacloudlogsRequest struct { + ctx context.Context + APIService LoggingGrafanacloudlogsAPI + serviceID string + versionID int32 + loggingGrafanacloudlogsName string + name *string + placement *string + responseCondition *string + format *string + formatVersion *int32 + user *string + url *string + token *string + index *string +} + +// Name The name for the real-time logging configuration. +func (r *APIUpdateLogGrafanacloudlogsRequest) Name(name string) *APIUpdateLogGrafanacloudlogsRequest { + r.name = &name + return r +} + +// Placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. +func (r *APIUpdateLogGrafanacloudlogsRequest) Placement(placement string) *APIUpdateLogGrafanacloudlogsRequest { + r.placement = &placement + return r +} + +// ResponseCondition The name of an existing condition in the configured endpoint, or leave blank to always execute. +func (r *APIUpdateLogGrafanacloudlogsRequest) ResponseCondition(responseCondition string) *APIUpdateLogGrafanacloudlogsRequest { + r.responseCondition = &responseCondition + return r +} + +// Format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). +func (r *APIUpdateLogGrafanacloudlogsRequest) Format(format string) *APIUpdateLogGrafanacloudlogsRequest { + r.format = &format + return r +} + +// FormatVersion The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. +func (r *APIUpdateLogGrafanacloudlogsRequest) FormatVersion(formatVersion int32) *APIUpdateLogGrafanacloudlogsRequest { + r.formatVersion = &formatVersion + return r +} + +// User The Grafana Cloud Logs Dataset you want to log to. +func (r *APIUpdateLogGrafanacloudlogsRequest) User(user string) *APIUpdateLogGrafanacloudlogsRequest { + r.user = &user + return r +} + +// URL The URL of the Loki instance in your Grafana stack. +func (r *APIUpdateLogGrafanacloudlogsRequest) URL(url string) *APIUpdateLogGrafanacloudlogsRequest { + r.url = &url + return r +} + +// Token The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. +func (r *APIUpdateLogGrafanacloudlogsRequest) Token(token string) *APIUpdateLogGrafanacloudlogsRequest { + r.token = &token + return r +} + +// Index The Stream Labels, a JSON string used to identify the stream. +func (r *APIUpdateLogGrafanacloudlogsRequest) Index(index string) *APIUpdateLogGrafanacloudlogsRequest { + r.index = &index + return r +} + +// Execute calls the API using the request data configured. +func (r APIUpdateLogGrafanacloudlogsRequest) Execute() (*LoggingGrafanacloudlogsResponse, *http.Response, error) { + return r.APIService.UpdateLogGrafanacloudlogsExecute(r) +} + +/* +UpdateLogGrafanacloudlogs Update a Grafana Cloud Logs log endpoint + +Update a Grafana Cloud Logs logging object for a particular service and version. + + @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 loggingGrafanacloudlogsName The name for the real-time logging configuration. + @return APIUpdateLogGrafanacloudlogsRequest +*/ +func (a *LoggingGrafanacloudlogsAPIService) UpdateLogGrafanacloudlogs(ctx context.Context, serviceID string, versionID int32, loggingGrafanacloudlogsName string) APIUpdateLogGrafanacloudlogsRequest { + return APIUpdateLogGrafanacloudlogsRequest{ + APIService: a, + ctx: ctx, + serviceID: serviceID, + versionID: versionID, + loggingGrafanacloudlogsName: loggingGrafanacloudlogsName, + } +} + +// UpdateLogGrafanacloudlogsExecute executes the request +// @return LoggingGrafanacloudlogsResponse +func (a *LoggingGrafanacloudlogsAPIService) UpdateLogGrafanacloudlogsExecute(r APIUpdateLogGrafanacloudlogsRequest) (*LoggingGrafanacloudlogsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody any + formFiles []formFile + localVarReturnValue *LoggingGrafanacloudlogsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LoggingGrafanacloudlogsAPIService.UpdateLogGrafanacloudlogs") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/service/{service_id}/version/{version_id}/logging/grafanacloudlogs/{logging_grafanacloudlogs_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, "{"+"logging_grafanacloudlogs_name"+"}", gourl.PathEscape(parameterToString(r.loggingGrafanacloudlogsName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := gourl.Values{} + localVarFormParams := gourl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} + + // 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.name != nil { + localVarFormParams.Add("name", parameterToString(*r.name, "")) + } + if r.placement != nil { + localVarFormParams.Add("placement", parameterToString(*r.placement, "")) + } + if r.responseCondition != nil { + localVarFormParams.Add("response_condition", parameterToString(*r.responseCondition, "")) + } + if r.format != nil { + localVarFormParams.Add("format", parameterToString(*r.format, "")) + } + if r.formatVersion != nil { + localVarFormParams.Add("format_version", parameterToString(*r.formatVersion, "")) + } + if r.user != nil { + localVarFormParams.Add("user", parameterToString(*r.user, "")) + } + if r.url != nil { + localVarFormParams.Add("url", parameterToString(*r.url, "")) + } + if r.token != nil { + localVarFormParams.Add("token", parameterToString(*r.token, "")) + } + if r.index != nil { + localVarFormParams.Add("index", parameterToString(*r.index, "")) + } + 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 +} diff --git a/fastly/api_object_storage_access_keys.go b/fastly/api_object_storage_access_keys.go new file mode 100644 index 0000000..a133b94 --- /dev/null +++ b/fastly/api_object_storage_access_keys.go @@ -0,0 +1,610 @@ +// 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 +) + +// ObjectStorageAccessKeysAPI defines an interface for interacting with the resource. +type ObjectStorageAccessKeysAPI interface { + + /* + CreateAccessKey Create an access key + + Create an access key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APICreateAccessKeyRequest + */ + CreateAccessKey(ctx context.Context) APICreateAccessKeyRequest + + // CreateAccessKeyExecute executes the request + // @return AccessKeyResponse + CreateAccessKeyExecute(r APICreateAccessKeyRequest) (*AccessKeyResponse, *http.Response, error) + + /* + DeleteAccessKey Delete an access key + + Delete an access key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accessKey + @return APIDeleteAccessKeyRequest + */ + DeleteAccessKey(ctx context.Context, accessKey string) APIDeleteAccessKeyRequest + + // DeleteAccessKeyExecute executes the request + DeleteAccessKeyExecute(r APIDeleteAccessKeyRequest) (*http.Response, error) + + /* + GetAccessKey Get an access key + + Get an access key by its identifier. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accessKey + @return APIGetAccessKeyRequest + */ + GetAccessKey(ctx context.Context, accessKey string) APIGetAccessKeyRequest + + // GetAccessKeyExecute executes the request + // @return AccessKey + GetAccessKeyExecute(r APIGetAccessKeyRequest) (*AccessKey, *http.Response, error) + + /* + ListAccessKeys List access keys + + List access keys. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIListAccessKeysRequest + */ + ListAccessKeys(ctx context.Context) APIListAccessKeysRequest + + // ListAccessKeysExecute executes the request + // @return AccessKeyResponse + ListAccessKeysExecute(r APIListAccessKeysRequest) (*AccessKeyResponse, *http.Response, error) +} + +// ObjectStorageAccessKeysAPIService ObjectStorageAccessKeysAPI service +type ObjectStorageAccessKeysAPIService service + +// APICreateAccessKeyRequest represents a request for the resource. +type APICreateAccessKeyRequest struct { + ctx context.Context + APIService ObjectStorageAccessKeysAPI + accessKey *AccessKey +} + +// AccessKey returns a pointer to a request. +func (r *APICreateAccessKeyRequest) AccessKey(accessKey AccessKey) *APICreateAccessKeyRequest { + r.accessKey = &accessKey + return r +} + +// Execute calls the API using the request data configured. +func (r APICreateAccessKeyRequest) Execute() (*AccessKeyResponse, *http.Response, error) { + return r.APIService.CreateAccessKeyExecute(r) +} + +/* +CreateAccessKey Create an access key + +Create an access key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APICreateAccessKeyRequest +*/ +func (a *ObjectStorageAccessKeysAPIService) CreateAccessKey(ctx context.Context) APICreateAccessKeyRequest { + return APICreateAccessKeyRequest{ + APIService: a, + ctx: ctx, + } +} + +// CreateAccessKeyExecute executes the request +// @return AccessKeyResponse +func (a *ObjectStorageAccessKeysAPIService) CreateAccessKeyExecute(r APICreateAccessKeyRequest) (*AccessKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody any + formFiles []formFile + localVarReturnValue *AccessKeyResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ObjectStorageAccessKeysAPIService.CreateAccessKey") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/object-storage/access-keys" + + 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.accessKey + 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 +} + +// APIDeleteAccessKeyRequest represents a request for the resource. +type APIDeleteAccessKeyRequest struct { + ctx context.Context + APIService ObjectStorageAccessKeysAPI + accessKey string +} + +// Execute calls the API using the request data configured. +func (r APIDeleteAccessKeyRequest) Execute() (*http.Response, error) { + return r.APIService.DeleteAccessKeyExecute(r) +} + +/* +DeleteAccessKey Delete an access key + +Delete an access key. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accessKey + @return APIDeleteAccessKeyRequest +*/ +func (a *ObjectStorageAccessKeysAPIService) DeleteAccessKey(ctx context.Context, accessKey string) APIDeleteAccessKeyRequest { + return APIDeleteAccessKeyRequest{ + APIService: a, + ctx: ctx, + accessKey: accessKey, + } +} + +// DeleteAccessKeyExecute executes the request +func (a *ObjectStorageAccessKeysAPIService) DeleteAccessKeyExecute(r APIDeleteAccessKeyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody any + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ObjectStorageAccessKeysAPIService.DeleteAccessKey") + if err != nil { + return nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/object-storage/access-keys/{access_key}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"access_key"+"}", gourl.PathEscape(parameterToString(r.accessKey, ""))) + + 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 +} + +// APIGetAccessKeyRequest represents a request for the resource. +type APIGetAccessKeyRequest struct { + ctx context.Context + APIService ObjectStorageAccessKeysAPI + accessKey string +} + +// Execute calls the API using the request data configured. +func (r APIGetAccessKeyRequest) Execute() (*AccessKey, *http.Response, error) { + return r.APIService.GetAccessKeyExecute(r) +} + +/* +GetAccessKey Get an access key + +Get an access key by its identifier. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param accessKey + @return APIGetAccessKeyRequest +*/ +func (a *ObjectStorageAccessKeysAPIService) GetAccessKey(ctx context.Context, accessKey string) APIGetAccessKeyRequest { + return APIGetAccessKeyRequest{ + APIService: a, + ctx: ctx, + accessKey: accessKey, + } +} + +// GetAccessKeyExecute executes the request +// @return AccessKey +func (a *ObjectStorageAccessKeysAPIService) GetAccessKeyExecute(r APIGetAccessKeyRequest) (*AccessKey, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *AccessKey + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ObjectStorageAccessKeysAPIService.GetAccessKey") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/object-storage/access-keys/{access_key}" + localVarPath = strings.ReplaceAll(localVarPath, "{"+"access_key"+"}", gourl.PathEscape(parameterToString(r.accessKey, ""))) + + 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 +} + +// APIListAccessKeysRequest represents a request for the resource. +type APIListAccessKeysRequest struct { + ctx context.Context + APIService ObjectStorageAccessKeysAPI +} + +// Execute calls the API using the request data configured. +func (r APIListAccessKeysRequest) Execute() (*AccessKeyResponse, *http.Response, error) { + return r.APIService.ListAccessKeysExecute(r) +} + +/* +ListAccessKeys List access keys + +List access keys. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return APIListAccessKeysRequest +*/ +func (a *ObjectStorageAccessKeysAPIService) ListAccessKeys(ctx context.Context) APIListAccessKeysRequest { + return APIListAccessKeysRequest{ + APIService: a, + ctx: ctx, + } +} + +// ListAccessKeysExecute executes the request +// @return AccessKeyResponse +func (a *ObjectStorageAccessKeysAPIService) ListAccessKeysExecute(r APIListAccessKeysRequest) (*AccessKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody any + formFiles []formFile + localVarReturnValue *AccessKeyResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ObjectStorageAccessKeysAPIService.ListAccessKeys") + if err != nil { + return localVarReturnValue, nil, &GenericAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/resources/object-storage/access-keys" + + 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 +} diff --git a/fastly/client.go b/fastly/client.go index 9941aa2..7bf9575 100644 --- a/fastly/client.go +++ b/fastly/client.go @@ -143,6 +143,8 @@ type APIClient struct { ImageOptimizerDefaultSettingsAPI ImageOptimizerDefaultSettingsAPI + InsightsAPI InsightsAPI + InvitationsAPI InvitationsAPI KvStoreAPI KvStoreAPI @@ -181,6 +183,8 @@ type APIClient struct { LoggingGcsAPI LoggingGcsAPI + LoggingGrafanacloudlogsAPI LoggingGrafanacloudlogsAPI + LoggingHerokuAPI LoggingHerokuAPI LoggingHoneycombAPI LoggingHoneycombAPI @@ -221,6 +225,8 @@ type APIClient struct { MutualAuthenticationAPI MutualAuthenticationAPI + ObjectStorageAccessKeysAPI ObjectStorageAccessKeysAPI + ObservabilityCustomDashboardsAPI ObservabilityCustomDashboardsAPI OriginInspectorHistoricalAPI OriginInspectorHistoricalAPI @@ -369,6 +375,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.IamServiceGroupsAPI = (*IamServiceGroupsAPIService)(&c.common) c.IamUserGroupsAPI = (*IamUserGroupsAPIService)(&c.common) c.ImageOptimizerDefaultSettingsAPI = (*ImageOptimizerDefaultSettingsAPIService)(&c.common) + c.InsightsAPI = (*InsightsAPIService)(&c.common) c.InvitationsAPI = (*InvitationsAPIService)(&c.common) c.KvStoreAPI = (*KvStoreAPIService)(&c.common) c.KvStoreItemAPI = (*KvStoreItemAPIService)(&c.common) @@ -388,6 +395,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.LoggingElasticsearchAPI = (*LoggingElasticsearchAPIService)(&c.common) c.LoggingFtpAPI = (*LoggingFtpAPIService)(&c.common) c.LoggingGcsAPI = (*LoggingGcsAPIService)(&c.common) + c.LoggingGrafanacloudlogsAPI = (*LoggingGrafanacloudlogsAPIService)(&c.common) c.LoggingHerokuAPI = (*LoggingHerokuAPIService)(&c.common) c.LoggingHoneycombAPI = (*LoggingHoneycombAPIService)(&c.common) c.LoggingHTTPSAPI = (*LoggingHTTPSAPIService)(&c.common) @@ -408,6 +416,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.LoggingSumologicAPI = (*LoggingSumologicAPIService)(&c.common) c.LoggingSyslogAPI = (*LoggingSyslogAPIService)(&c.common) c.MutualAuthenticationAPI = (*MutualAuthenticationAPIService)(&c.common) + c.ObjectStorageAccessKeysAPI = (*ObjectStorageAccessKeysAPIService)(&c.common) c.ObservabilityCustomDashboardsAPI = (*ObservabilityCustomDashboardsAPIService)(&c.common) c.OriginInspectorHistoricalAPI = (*OriginInspectorHistoricalAPIService)(&c.common) c.OriginInspectorRealtimeAPI = (*OriginInspectorRealtimeAPIService)(&c.common) diff --git a/fastly/configuration.go b/fastly/configuration.go index 468869d..7aedd03 100644 --- a/fastly/configuration.go +++ b/fastly/configuration.go @@ -104,7 +104,7 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "fastly-go/1.0.0-beta.36", + UserAgent: "fastly-go/1.0.0-beta.37", Debug: false, Servers: ServerConfigurations{ { @@ -381,7 +381,7 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, - "BillingUsageMetricsAPIService.GetServiceLevelUsageTypes": { + "BillingUsageMetricsAPIService.GetUsageMetrics": { { URL: "https://api.fastly.com", Description: "No description provided", @@ -1209,6 +1209,12 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "InsightsAPIService.GetLogInsights": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "InvitationsAPIService.CreateInvitation": { { URL: "https://api.fastly.com", @@ -1683,6 +1689,36 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "LoggingGrafanacloudlogsAPIService.CreateLogGrafanacloudlogs": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "LoggingGrafanacloudlogsAPIService.DeleteLogGrafanacloudlogs": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "LoggingGrafanacloudlogsAPIService.GetLogGrafanacloudlogs": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "LoggingGrafanacloudlogsAPIService.ListLogGrafanacloudlogs": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "LoggingGrafanacloudlogsAPIService.UpdateLogGrafanacloudlogs": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "LoggingHerokuAPIService.CreateLogHeroku": { { URL: "https://api.fastly.com", @@ -2283,6 +2319,30 @@ func NewConfiguration() *Configuration { Description: "No description provided", }, }, + "ObjectStorageAccessKeysAPIService.CreateAccessKey": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ObjectStorageAccessKeysAPIService.DeleteAccessKey": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ObjectStorageAccessKeysAPIService.GetAccessKey": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, + "ObjectStorageAccessKeysAPIService.ListAccessKeys": { + { + URL: "https://api.fastly.com", + Description: "No description provided", + }, + }, "ObservabilityCustomDashboardsAPIService.CreateDashboard": { { URL: "https://api.fastly.com", diff --git a/fastly/model_access_key.go b/fastly/model_access_key.go new file mode 100644 index 0000000..463b02c --- /dev/null +++ b/fastly/model_access_key.go @@ -0,0 +1,216 @@ +// 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" +) + +// AccessKey struct for AccessKey +type AccessKey struct { + // A description of the access key. + Description string `json:"description"` + // The permissions granted to an access key. + Permission string `json:"permission"` + Buckets []string `json:"buckets,omitempty"` + AdditionalProperties map[string]any +} + +type _AccessKey AccessKey + +// NewAccessKey instantiates a new AccessKey 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 NewAccessKey(description string, permission string) *AccessKey { + this := AccessKey{} + this.Description = description + this.Permission = permission + return &this +} + +// NewAccessKeyWithDefaults instantiates a new AccessKey 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 NewAccessKeyWithDefaults() *AccessKey { + this := AccessKey{} + return &this +} + +// GetDescription returns the Description field value +func (o *AccessKey) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *AccessKey) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *AccessKey) SetDescription(v string) { + o.Description = v +} + +// GetPermission returns the Permission field value +func (o *AccessKey) GetPermission() string { + if o == nil { + var ret string + return ret + } + + return o.Permission +} + +// GetPermissionOk returns a tuple with the Permission field value +// and a boolean to check if the value has been set. +func (o *AccessKey) GetPermissionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Permission, true +} + +// SetPermission sets field value +func (o *AccessKey) SetPermission(v string) { + o.Permission = v +} + +// GetBuckets returns the Buckets field value if set, zero value otherwise. +func (o *AccessKey) GetBuckets() []string { + if o == nil || o.Buckets == nil { + var ret []string + return ret + } + return o.Buckets +} + +// GetBucketsOk returns a tuple with the Buckets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessKey) GetBucketsOk() ([]string, bool) { + if o == nil || o.Buckets == nil { + return nil, false + } + return o.Buckets, true +} + +// HasBuckets returns a boolean if a field has been set. +func (o *AccessKey) HasBuckets() bool { + if o != nil && o.Buckets != nil { + return true + } + + return false +} + +// SetBuckets gets a reference to the given []string and assigns it to the Buckets field. +func (o *AccessKey) SetBuckets(v []string) { + o.Buckets = v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AccessKey) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if true { + toSerialize["description"] = o.Description + } + if true { + toSerialize["permission"] = o.Permission + } + if o.Buckets != nil { + toSerialize["buckets"] = o.Buckets + } + + 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 *AccessKey) UnmarshalJSON(bytes []byte) (err error) { + varAccessKey := _AccessKey{} + + if err = json.Unmarshal(bytes, &varAccessKey); err == nil { + *o = AccessKey(varAccessKey) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "description") + delete(additionalProperties, "permission") + delete(additionalProperties, "buckets") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAccessKey is a helper abstraction for handling nullable accesskey types. +type NullableAccessKey struct { + value *AccessKey + isSet bool +} + +// Get returns the value. +func (v NullableAccessKey) Get() *AccessKey { + return v.value +} + +// Set modifies the value. +func (v *NullableAccessKey) Set(val *AccessKey) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAccessKey) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAccessKey) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAccessKey returns a pointer to a new instance of NullableAccessKey. +func NewNullableAccessKey(val *AccessKey) *NullableAccessKey { + return &NullableAccessKey{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 NullableAccessKey) 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 *NullableAccessKey) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_access_key_response.go b/fastly/model_access_key_response.go new file mode 100644 index 0000000..c484582 --- /dev/null +++ b/fastly/model_access_key_response.go @@ -0,0 +1,356 @@ +// 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" + "time" +) + +// AccessKeyResponse struct for AccessKeyResponse +type AccessKeyResponse struct { + // Generated access key. + AccessKey *string `json:"access_key,omitempty"` + // Generated secret key. + SecretKey *string `json:"secret_key,omitempty"` + // Description for the access key. + Description *string `json:"description,omitempty"` + // Permissions granted to an access key. + Permission *string `json:"permission,omitempty"` + Buckets []string `json:"buckets,omitempty"` + // Date and time in ISO 8601 format. + CreatedAt NullableTime `json:"created_at,omitempty"` + AdditionalProperties map[string]any +} + +type _AccessKeyResponse AccessKeyResponse + +// NewAccessKeyResponse instantiates a new AccessKeyResponse 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 NewAccessKeyResponse() *AccessKeyResponse { + this := AccessKeyResponse{} + return &this +} + +// NewAccessKeyResponseWithDefaults instantiates a new AccessKeyResponse 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 NewAccessKeyResponseWithDefaults() *AccessKeyResponse { + this := AccessKeyResponse{} + return &this +} + +// GetAccessKey returns the AccessKey field value if set, zero value otherwise. +func (o *AccessKeyResponse) GetAccessKey() string { + if o == nil || o.AccessKey == nil { + var ret string + return ret + } + return *o.AccessKey +} + +// GetAccessKeyOk returns a tuple with the AccessKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessKeyResponse) GetAccessKeyOk() (*string, bool) { + if o == nil || o.AccessKey == nil { + return nil, false + } + return o.AccessKey, true +} + +// HasAccessKey returns a boolean if a field has been set. +func (o *AccessKeyResponse) HasAccessKey() bool { + if o != nil && o.AccessKey != nil { + return true + } + + return false +} + +// SetAccessKey gets a reference to the given string and assigns it to the AccessKey field. +func (o *AccessKeyResponse) SetAccessKey(v string) { + o.AccessKey = &v +} + +// GetSecretKey returns the SecretKey field value if set, zero value otherwise. +func (o *AccessKeyResponse) GetSecretKey() string { + if o == nil || o.SecretKey == nil { + var ret string + return ret + } + return *o.SecretKey +} + +// GetSecretKeyOk returns a tuple with the SecretKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessKeyResponse) GetSecretKeyOk() (*string, bool) { + if o == nil || o.SecretKey == nil { + return nil, false + } + return o.SecretKey, true +} + +// HasSecretKey returns a boolean if a field has been set. +func (o *AccessKeyResponse) HasSecretKey() bool { + if o != nil && o.SecretKey != nil { + return true + } + + return false +} + +// SetSecretKey gets a reference to the given string and assigns it to the SecretKey field. +func (o *AccessKeyResponse) SetSecretKey(v string) { + o.SecretKey = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AccessKeyResponse) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessKeyResponse) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AccessKeyResponse) HasDescription() bool { + if o != nil && o.Description != nil { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AccessKeyResponse) SetDescription(v string) { + o.Description = &v +} + +// GetPermission returns the Permission field value if set, zero value otherwise. +func (o *AccessKeyResponse) GetPermission() string { + if o == nil || o.Permission == nil { + var ret string + return ret + } + return *o.Permission +} + +// GetPermissionOk returns a tuple with the Permission field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessKeyResponse) GetPermissionOk() (*string, bool) { + if o == nil || o.Permission == nil { + return nil, false + } + return o.Permission, true +} + +// HasPermission returns a boolean if a field has been set. +func (o *AccessKeyResponse) HasPermission() bool { + if o != nil && o.Permission != nil { + return true + } + + return false +} + +// SetPermission gets a reference to the given string and assigns it to the Permission field. +func (o *AccessKeyResponse) SetPermission(v string) { + o.Permission = &v +} + +// GetBuckets returns the Buckets field value if set, zero value otherwise. +func (o *AccessKeyResponse) GetBuckets() []string { + if o == nil || o.Buckets == nil { + var ret []string + return ret + } + return o.Buckets +} + +// GetBucketsOk returns a tuple with the Buckets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessKeyResponse) GetBucketsOk() ([]string, bool) { + if o == nil || o.Buckets == nil { + return nil, false + } + return o.Buckets, true +} + +// HasBuckets returns a boolean if a field has been set. +func (o *AccessKeyResponse) HasBuckets() bool { + if o != nil && o.Buckets != nil { + return true + } + + return false +} + +// SetBuckets gets a reference to the given []string and assigns it to the Buckets field. +func (o *AccessKeyResponse) SetBuckets(v []string) { + o.Buckets = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AccessKeyResponse) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.CreatedAt.Get() +} + +// GetCreatedAtOk returns a tuple with the CreatedAt 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 *AccessKeyResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.CreatedAt.Get(), o.CreatedAt.IsSet() +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AccessKeyResponse) HasCreatedAt() bool { + if o != nil && o.CreatedAt.IsSet() { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given NullableTime and assigns it to the CreatedAt field. +func (o *AccessKeyResponse) SetCreatedAt(v time.Time) { + o.CreatedAt.Set(&v) +} + +// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil +func (o *AccessKeyResponse) SetCreatedAtNil() { + o.CreatedAt.Set(nil) +} + +// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil +func (o *AccessKeyResponse) UnsetCreatedAt() { + o.CreatedAt.Unset() +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o AccessKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.AccessKey != nil { + toSerialize["access_key"] = o.AccessKey + } + if o.SecretKey != nil { + toSerialize["secret_key"] = o.SecretKey + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Permission != nil { + toSerialize["permission"] = o.Permission + } + if o.Buckets != nil { + toSerialize["buckets"] = o.Buckets + } + if o.CreatedAt.IsSet() { + toSerialize["created_at"] = o.CreatedAt.Get() + } + + 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 *AccessKeyResponse) UnmarshalJSON(bytes []byte) (err error) { + varAccessKeyResponse := _AccessKeyResponse{} + + if err = json.Unmarshal(bytes, &varAccessKeyResponse); err == nil { + *o = AccessKeyResponse(varAccessKeyResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "access_key") + delete(additionalProperties, "secret_key") + delete(additionalProperties, "description") + delete(additionalProperties, "permission") + delete(additionalProperties, "buckets") + delete(additionalProperties, "created_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableAccessKeyResponse is a helper abstraction for handling nullable accesskeyresponse types. +type NullableAccessKeyResponse struct { + value *AccessKeyResponse + isSet bool +} + +// Get returns the value. +func (v NullableAccessKeyResponse) Get() *AccessKeyResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableAccessKeyResponse) Set(val *AccessKeyResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableAccessKeyResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableAccessKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableAccessKeyResponse returns a pointer to a new instance of NullableAccessKeyResponse. +func NewNullableAccessKeyResponse(val *AccessKeyResponse) *NullableAccessKeyResponse { + return &NullableAccessKeyResponse{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 NullableAccessKeyResponse) 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 *NullableAccessKeyResponse) 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 index 358e8a4..b9d602d 100644 --- a/fastly/model_compute_acl_list_entries.go +++ b/fastly/model_compute_acl_list_entries.go @@ -16,7 +16,7 @@ import ( "encoding/json" ) -// ComputeACLListEntries An example of an ACL List Response. +// ComputeACLListEntries Defines the structure of what the ACL List endpoint returns. type ComputeACLListEntries struct { Meta *ComputeACLListEntriesMeta `json:"meta,omitempty"` Entries []ComputeACLListEntriesItem `json:"entries,omitempty"` diff --git a/fastly/model_compute_acl_lookup.go b/fastly/model_compute_acl_lookup.go index 9693309..851c40d 100644 --- a/fastly/model_compute_acl_lookup.go +++ b/fastly/model_compute_acl_lookup.go @@ -16,7 +16,7 @@ import ( "encoding/json" ) -// ComputeACLLookup An example of an ACL Lookup response. +// ComputeACLLookup Defines the structure of an ACL Lookup response. type ComputeACLLookup struct { // A valid IPv4 or IPv6 address. Prefix *string `json:"prefix,omitempty"` diff --git a/fastly/model_compute_acl_update.go b/fastly/model_compute_acl_update.go new file mode 100644 index 0000000..068b825 --- /dev/null +++ b/fastly/model_compute_acl_update.go @@ -0,0 +1,154 @@ +// 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" +) + +// ComputeACLUpdate Defines the structure of an ACL update request array. +type ComputeACLUpdate struct { + Entries []ComputeACLUpdateEntry `json:"entries,omitempty"` + AdditionalProperties map[string]any +} + +type _ComputeACLUpdate ComputeACLUpdate + +// NewComputeACLUpdate instantiates a new ComputeACLUpdate 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 NewComputeACLUpdate() *ComputeACLUpdate { + this := ComputeACLUpdate{} + return &this +} + +// NewComputeACLUpdateWithDefaults instantiates a new ComputeACLUpdate 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 NewComputeACLUpdateWithDefaults() *ComputeACLUpdate { + this := ComputeACLUpdate{} + return &this +} + +// GetEntries returns the Entries field value if set, zero value otherwise. +func (o *ComputeACLUpdate) GetEntries() []ComputeACLUpdateEntry { + if o == nil || o.Entries == nil { + var ret []ComputeACLUpdateEntry + 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 *ComputeACLUpdate) GetEntriesOk() ([]ComputeACLUpdateEntry, 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 *ComputeACLUpdate) HasEntries() bool { + if o != nil && o.Entries != nil { + return true + } + + return false +} + +// SetEntries gets a reference to the given []ComputeACLUpdateEntry and assigns it to the Entries field. +func (o *ComputeACLUpdate) SetEntries(v []ComputeACLUpdateEntry) { + 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 ComputeACLUpdate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + 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 *ComputeACLUpdate) UnmarshalJSON(bytes []byte) (err error) { + varComputeACLUpdate := _ComputeACLUpdate{} + + if err = json.Unmarshal(bytes, &varComputeACLUpdate); err == nil { + *o = ComputeACLUpdate(varComputeACLUpdate) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "entries") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableComputeACLUpdate is a helper abstraction for handling nullable computeaclupdate types. +type NullableComputeACLUpdate struct { + value *ComputeACLUpdate + isSet bool +} + +// Get returns the value. +func (v NullableComputeACLUpdate) Get() *ComputeACLUpdate { + return v.value +} + +// Set modifies the value. +func (v *NullableComputeACLUpdate) Set(val *ComputeACLUpdate) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableComputeACLUpdate) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableComputeACLUpdate) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableComputeACLUpdate returns a pointer to a new instance of NullableComputeACLUpdate. +func NewNullableComputeACLUpdate(val *ComputeACLUpdate) *NullableComputeACLUpdate { + return &NullableComputeACLUpdate{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 NullableComputeACLUpdate) 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 *NullableComputeACLUpdate) 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 index f14d33b..e8c6806 100644 --- a/fastly/model_compute_acl_update_entry.go +++ b/fastly/model_compute_acl_update_entry.go @@ -16,7 +16,7 @@ import ( "encoding/json" ) -// ComputeACLUpdateEntry An example of an ACL update request entry. +// ComputeACLUpdateEntry Defines the structure 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"` diff --git a/fastly/model_dimension_attributes_country_stats.go b/fastly/model_dimension_attributes_country_stats.go new file mode 100644 index 0000000..21fedbe --- /dev/null +++ b/fastly/model_dimension_attributes_country_stats.go @@ -0,0 +1,231 @@ +// 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" +) + +// DimensionAttributesCountryStats struct for DimensionAttributesCountryStats +type DimensionAttributesCountryStats struct { + // The cache hit ratio for the country. + CountryChr *float32 `json:"country_chr,omitempty"` + // The error rate for the country. + CountryErrorRate *float32 `json:"country_error_rate,omitempty"` + // This country's percentage of the total requests. + CountryRequestRate *float32 `json:"country_request_rate,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionAttributesCountryStats DimensionAttributesCountryStats + +// NewDimensionAttributesCountryStats instantiates a new DimensionAttributesCountryStats 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 NewDimensionAttributesCountryStats() *DimensionAttributesCountryStats { + this := DimensionAttributesCountryStats{} + return &this +} + +// NewDimensionAttributesCountryStatsWithDefaults instantiates a new DimensionAttributesCountryStats 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 NewDimensionAttributesCountryStatsWithDefaults() *DimensionAttributesCountryStats { + this := DimensionAttributesCountryStats{} + return &this +} + +// GetCountryChr returns the CountryChr field value if set, zero value otherwise. +func (o *DimensionAttributesCountryStats) GetCountryChr() float32 { + if o == nil || o.CountryChr == nil { + var ret float32 + return ret + } + return *o.CountryChr +} + +// GetCountryChrOk returns a tuple with the CountryChr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionAttributesCountryStats) GetCountryChrOk() (*float32, bool) { + if o == nil || o.CountryChr == nil { + return nil, false + } + return o.CountryChr, true +} + +// HasCountryChr returns a boolean if a field has been set. +func (o *DimensionAttributesCountryStats) HasCountryChr() bool { + if o != nil && o.CountryChr != nil { + return true + } + + return false +} + +// SetCountryChr gets a reference to the given float32 and assigns it to the CountryChr field. +func (o *DimensionAttributesCountryStats) SetCountryChr(v float32) { + o.CountryChr = &v +} + +// GetCountryErrorRate returns the CountryErrorRate field value if set, zero value otherwise. +func (o *DimensionAttributesCountryStats) GetCountryErrorRate() float32 { + if o == nil || o.CountryErrorRate == nil { + var ret float32 + return ret + } + return *o.CountryErrorRate +} + +// GetCountryErrorRateOk returns a tuple with the CountryErrorRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionAttributesCountryStats) GetCountryErrorRateOk() (*float32, bool) { + if o == nil || o.CountryErrorRate == nil { + return nil, false + } + return o.CountryErrorRate, true +} + +// HasCountryErrorRate returns a boolean if a field has been set. +func (o *DimensionAttributesCountryStats) HasCountryErrorRate() bool { + if o != nil && o.CountryErrorRate != nil { + return true + } + + return false +} + +// SetCountryErrorRate gets a reference to the given float32 and assigns it to the CountryErrorRate field. +func (o *DimensionAttributesCountryStats) SetCountryErrorRate(v float32) { + o.CountryErrorRate = &v +} + +// GetCountryRequestRate returns the CountryRequestRate field value if set, zero value otherwise. +func (o *DimensionAttributesCountryStats) GetCountryRequestRate() float32 { + if o == nil || o.CountryRequestRate == nil { + var ret float32 + return ret + } + return *o.CountryRequestRate +} + +// GetCountryRequestRateOk returns a tuple with the CountryRequestRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionAttributesCountryStats) GetCountryRequestRateOk() (*float32, bool) { + if o == nil || o.CountryRequestRate == nil { + return nil, false + } + return o.CountryRequestRate, true +} + +// HasCountryRequestRate returns a boolean if a field has been set. +func (o *DimensionAttributesCountryStats) HasCountryRequestRate() bool { + if o != nil && o.CountryRequestRate != nil { + return true + } + + return false +} + +// SetCountryRequestRate gets a reference to the given float32 and assigns it to the CountryRequestRate field. +func (o *DimensionAttributesCountryStats) SetCountryRequestRate(v float32) { + o.CountryRequestRate = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionAttributesCountryStats) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.CountryChr != nil { + toSerialize["country_chr"] = o.CountryChr + } + if o.CountryErrorRate != nil { + toSerialize["country_error_rate"] = o.CountryErrorRate + } + if o.CountryRequestRate != nil { + toSerialize["country_request_rate"] = o.CountryRequestRate + } + + 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 *DimensionAttributesCountryStats) UnmarshalJSON(bytes []byte) (err error) { + varDimensionAttributesCountryStats := _DimensionAttributesCountryStats{} + + if err = json.Unmarshal(bytes, &varDimensionAttributesCountryStats); err == nil { + *o = DimensionAttributesCountryStats(varDimensionAttributesCountryStats) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "country_chr") + delete(additionalProperties, "country_error_rate") + delete(additionalProperties, "country_request_rate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionAttributesCountryStats is a helper abstraction for handling nullable dimensionattributescountrystats types. +type NullableDimensionAttributesCountryStats struct { + value *DimensionAttributesCountryStats + isSet bool +} + +// Get returns the value. +func (v NullableDimensionAttributesCountryStats) Get() *DimensionAttributesCountryStats { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionAttributesCountryStats) Set(val *DimensionAttributesCountryStats) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionAttributesCountryStats) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionAttributesCountryStats) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionAttributesCountryStats returns a pointer to a new instance of NullableDimensionAttributesCountryStats. +func NewNullableDimensionAttributesCountryStats(val *DimensionAttributesCountryStats) *NullableDimensionAttributesCountryStats { + return &NullableDimensionAttributesCountryStats{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 NullableDimensionAttributesCountryStats) 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 *NullableDimensionAttributesCountryStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_attributes_rate.go b/fastly/model_dimension_attributes_rate.go new file mode 100644 index 0000000..eb3a832 --- /dev/null +++ b/fastly/model_dimension_attributes_rate.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" +) + +// DimensionAttributesRate struct for DimensionAttributesRate +type DimensionAttributesRate struct { + // The rate at which the value in the current dimension occurs. + Rate *float32 `json:"rate,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionAttributesRate DimensionAttributesRate + +// NewDimensionAttributesRate instantiates a new DimensionAttributesRate 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 NewDimensionAttributesRate() *DimensionAttributesRate { + this := DimensionAttributesRate{} + return &this +} + +// NewDimensionAttributesRateWithDefaults instantiates a new DimensionAttributesRate 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 NewDimensionAttributesRateWithDefaults() *DimensionAttributesRate { + this := DimensionAttributesRate{} + return &this +} + +// GetRate returns the Rate field value if set, zero value otherwise. +func (o *DimensionAttributesRate) GetRate() float32 { + if o == nil || o.Rate == nil { + var ret float32 + return ret + } + return *o.Rate +} + +// GetRateOk returns a tuple with the Rate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionAttributesRate) GetRateOk() (*float32, bool) { + if o == nil || o.Rate == nil { + return nil, false + } + return o.Rate, true +} + +// HasRate returns a boolean if a field has been set. +func (o *DimensionAttributesRate) HasRate() bool { + if o != nil && o.Rate != nil { + return true + } + + return false +} + +// SetRate gets a reference to the given float32 and assigns it to the Rate field. +func (o *DimensionAttributesRate) SetRate(v float32) { + o.Rate = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionAttributesRate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Rate != nil { + toSerialize["rate"] = o.Rate + } + + 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 *DimensionAttributesRate) UnmarshalJSON(bytes []byte) (err error) { + varDimensionAttributesRate := _DimensionAttributesRate{} + + if err = json.Unmarshal(bytes, &varDimensionAttributesRate); err == nil { + *o = DimensionAttributesRate(varDimensionAttributesRate) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "rate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionAttributesRate is a helper abstraction for handling nullable dimensionattributesrate types. +type NullableDimensionAttributesRate struct { + value *DimensionAttributesRate + isSet bool +} + +// Get returns the value. +func (v NullableDimensionAttributesRate) Get() *DimensionAttributesRate { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionAttributesRate) Set(val *DimensionAttributesRate) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionAttributesRate) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionAttributesRate) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionAttributesRate returns a pointer to a new instance of NullableDimensionAttributesRate. +func NewNullableDimensionAttributesRate(val *DimensionAttributesRate) *NullableDimensionAttributesRate { + return &NullableDimensionAttributesRate{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 NullableDimensionAttributesRate) 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 *NullableDimensionAttributesRate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_browser.go b/fastly/model_dimension_browser.go new file mode 100644 index 0000000..c307ffe --- /dev/null +++ b/fastly/model_dimension_browser.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" +) + +// DimensionBrowser struct for DimensionBrowser +type DimensionBrowser struct { + // The client's browser for this dimension. + Browser *string `json:"browser,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionBrowser DimensionBrowser + +// NewDimensionBrowser instantiates a new DimensionBrowser 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 NewDimensionBrowser() *DimensionBrowser { + this := DimensionBrowser{} + return &this +} + +// NewDimensionBrowserWithDefaults instantiates a new DimensionBrowser 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 NewDimensionBrowserWithDefaults() *DimensionBrowser { + this := DimensionBrowser{} + return &this +} + +// GetBrowser returns the Browser field value if set, zero value otherwise. +func (o *DimensionBrowser) GetBrowser() string { + if o == nil || o.Browser == nil { + var ret string + return ret + } + return *o.Browser +} + +// GetBrowserOk returns a tuple with the Browser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionBrowser) GetBrowserOk() (*string, bool) { + if o == nil || o.Browser == nil { + return nil, false + } + return o.Browser, true +} + +// HasBrowser returns a boolean if a field has been set. +func (o *DimensionBrowser) HasBrowser() bool { + if o != nil && o.Browser != nil { + return true + } + + return false +} + +// SetBrowser gets a reference to the given string and assigns it to the Browser field. +func (o *DimensionBrowser) SetBrowser(v string) { + o.Browser = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionBrowser) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Browser != nil { + toSerialize["browser"] = o.Browser + } + + 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 *DimensionBrowser) UnmarshalJSON(bytes []byte) (err error) { + varDimensionBrowser := _DimensionBrowser{} + + if err = json.Unmarshal(bytes, &varDimensionBrowser); err == nil { + *o = DimensionBrowser(varDimensionBrowser) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "browser") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionBrowser is a helper abstraction for handling nullable dimensionbrowser types. +type NullableDimensionBrowser struct { + value *DimensionBrowser + isSet bool +} + +// Get returns the value. +func (v NullableDimensionBrowser) Get() *DimensionBrowser { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionBrowser) Set(val *DimensionBrowser) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionBrowser) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionBrowser) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionBrowser returns a pointer to a new instance of NullableDimensionBrowser. +func NewNullableDimensionBrowser(val *DimensionBrowser) *NullableDimensionBrowser { + return &NullableDimensionBrowser{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 NullableDimensionBrowser) 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 *NullableDimensionBrowser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_content_type.go b/fastly/model_dimension_content_type.go new file mode 100644 index 0000000..39e2237 --- /dev/null +++ b/fastly/model_dimension_content_type.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" +) + +// DimensionContentType struct for DimensionContentType +type DimensionContentType struct { + // The content type of the response for this dimension. + ContentType *string `json:"content_type,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionContentType DimensionContentType + +// NewDimensionContentType instantiates a new DimensionContentType 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 NewDimensionContentType() *DimensionContentType { + this := DimensionContentType{} + return &this +} + +// NewDimensionContentTypeWithDefaults instantiates a new DimensionContentType 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 NewDimensionContentTypeWithDefaults() *DimensionContentType { + this := DimensionContentType{} + return &this +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *DimensionContentType) GetContentType() string { + if o == nil || o.ContentType == nil { + var ret string + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionContentType) GetContentTypeOk() (*string, bool) { + if o == nil || o.ContentType == nil { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *DimensionContentType) HasContentType() bool { + if o != nil && o.ContentType != nil { + return true + } + + return false +} + +// SetContentType gets a reference to the given string and assigns it to the ContentType field. +func (o *DimensionContentType) SetContentType(v string) { + o.ContentType = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionContentType) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.ContentType != nil { + toSerialize["content_type"] = o.ContentType + } + + 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 *DimensionContentType) UnmarshalJSON(bytes []byte) (err error) { + varDimensionContentType := _DimensionContentType{} + + if err = json.Unmarshal(bytes, &varDimensionContentType); err == nil { + *o = DimensionContentType(varDimensionContentType) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "content_type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionContentType is a helper abstraction for handling nullable dimensioncontenttype types. +type NullableDimensionContentType struct { + value *DimensionContentType + isSet bool +} + +// Get returns the value. +func (v NullableDimensionContentType) Get() *DimensionContentType { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionContentType) Set(val *DimensionContentType) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionContentType) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionContentType) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionContentType returns a pointer to a new instance of NullableDimensionContentType. +func NewNullableDimensionContentType(val *DimensionContentType) *NullableDimensionContentType { + return &NullableDimensionContentType{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 NullableDimensionContentType) 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 *NullableDimensionContentType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_country.go b/fastly/model_dimension_country.go new file mode 100644 index 0000000..a7c3ebd --- /dev/null +++ b/fastly/model_dimension_country.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" +) + +// DimensionCountry struct for DimensionCountry +type DimensionCountry struct { + // The client's country for this dimension. + Country *string `json:"country,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionCountry DimensionCountry + +// NewDimensionCountry instantiates a new DimensionCountry 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 NewDimensionCountry() *DimensionCountry { + this := DimensionCountry{} + return &this +} + +// NewDimensionCountryWithDefaults instantiates a new DimensionCountry 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 NewDimensionCountryWithDefaults() *DimensionCountry { + this := DimensionCountry{} + return &this +} + +// GetCountry returns the Country field value if set, zero value otherwise. +func (o *DimensionCountry) 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 *DimensionCountry) 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 *DimensionCountry) 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 *DimensionCountry) SetCountry(v string) { + o.Country = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionCountry) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Country != nil { + toSerialize["country"] = o.Country + } + + 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 *DimensionCountry) UnmarshalJSON(bytes []byte) (err error) { + varDimensionCountry := _DimensionCountry{} + + if err = json.Unmarshal(bytes, &varDimensionCountry); err == nil { + *o = DimensionCountry(varDimensionCountry) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "country") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionCountry is a helper abstraction for handling nullable dimensioncountry types. +type NullableDimensionCountry struct { + value *DimensionCountry + isSet bool +} + +// Get returns the value. +func (v NullableDimensionCountry) Get() *DimensionCountry { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionCountry) Set(val *DimensionCountry) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionCountry) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionCountry) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionCountry returns a pointer to a new instance of NullableDimensionCountry. +func NewNullableDimensionCountry(val *DimensionCountry) *NullableDimensionCountry { + return &NullableDimensionCountry{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 NullableDimensionCountry) 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 *NullableDimensionCountry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_device.go b/fastly/model_dimension_device.go new file mode 100644 index 0000000..2e4246f --- /dev/null +++ b/fastly/model_dimension_device.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" +) + +// DimensionDevice struct for DimensionDevice +type DimensionDevice struct { + // The client's device type for this dimension. + Device *string `json:"device,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionDevice DimensionDevice + +// NewDimensionDevice instantiates a new DimensionDevice 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 NewDimensionDevice() *DimensionDevice { + this := DimensionDevice{} + return &this +} + +// NewDimensionDeviceWithDefaults instantiates a new DimensionDevice 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 NewDimensionDeviceWithDefaults() *DimensionDevice { + this := DimensionDevice{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *DimensionDevice) GetDevice() string { + if o == nil || o.Device == nil { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionDevice) GetDeviceOk() (*string, bool) { + if o == nil || o.Device == nil { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *DimensionDevice) HasDevice() bool { + if o != nil && o.Device != nil { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *DimensionDevice) SetDevice(v string) { + o.Device = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionDevice) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Device != nil { + toSerialize["device"] = o.Device + } + + 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 *DimensionDevice) UnmarshalJSON(bytes []byte) (err error) { + varDimensionDevice := _DimensionDevice{} + + if err = json.Unmarshal(bytes, &varDimensionDevice); err == nil { + *o = DimensionDevice(varDimensionDevice) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "device") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionDevice is a helper abstraction for handling nullable dimensiondevice types. +type NullableDimensionDevice struct { + value *DimensionDevice + isSet bool +} + +// Get returns the value. +func (v NullableDimensionDevice) Get() *DimensionDevice { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionDevice) Set(val *DimensionDevice) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionDevice) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionDevice) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionDevice returns a pointer to a new instance of NullableDimensionDevice. +func NewNullableDimensionDevice(val *DimensionDevice) *NullableDimensionDevice { + return &NullableDimensionDevice{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 NullableDimensionDevice) 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 *NullableDimensionDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_os.go b/fastly/model_dimension_os.go new file mode 100644 index 0000000..914862a --- /dev/null +++ b/fastly/model_dimension_os.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" +) + +// DimensionOs struct for DimensionOs +type DimensionOs struct { + // The client's operating system for this dimension. + Os *string `json:"os,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionOs DimensionOs + +// NewDimensionOs instantiates a new DimensionOs 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 NewDimensionOs() *DimensionOs { + this := DimensionOs{} + return &this +} + +// NewDimensionOsWithDefaults instantiates a new DimensionOs 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 NewDimensionOsWithDefaults() *DimensionOs { + this := DimensionOs{} + return &this +} + +// GetOs returns the Os field value if set, zero value otherwise. +func (o *DimensionOs) GetOs() string { + if o == nil || o.Os == nil { + var ret string + return ret + } + return *o.Os +} + +// GetOsOk returns a tuple with the Os field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionOs) GetOsOk() (*string, bool) { + if o == nil || o.Os == nil { + return nil, false + } + return o.Os, true +} + +// HasOs returns a boolean if a field has been set. +func (o *DimensionOs) HasOs() bool { + if o != nil && o.Os != nil { + return true + } + + return false +} + +// SetOs gets a reference to the given string and assigns it to the Os field. +func (o *DimensionOs) SetOs(v string) { + o.Os = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionOs) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Os != nil { + toSerialize["os"] = o.Os + } + + 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 *DimensionOs) UnmarshalJSON(bytes []byte) (err error) { + varDimensionOs := _DimensionOs{} + + if err = json.Unmarshal(bytes, &varDimensionOs); err == nil { + *o = DimensionOs(varDimensionOs) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "os") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionOs is a helper abstraction for handling nullable dimensionos types. +type NullableDimensionOs struct { + value *DimensionOs + isSet bool +} + +// Get returns the value. +func (v NullableDimensionOs) Get() *DimensionOs { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionOs) Set(val *DimensionOs) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionOs) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionOs) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionOs returns a pointer to a new instance of NullableDimensionOs. +func NewNullableDimensionOs(val *DimensionOs) *NullableDimensionOs { + return &NullableDimensionOs{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 NullableDimensionOs) 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 *NullableDimensionOs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_response.go b/fastly/model_dimension_response.go new file mode 100644 index 0000000..cb48067 --- /dev/null +++ b/fastly/model_dimension_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" +) + +// DimensionResponse struct for DimensionResponse +type DimensionResponse struct { + // The HTTP reason phrase for this dimension. + Response *string `json:"response,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionResponse DimensionResponse + +// NewDimensionResponse instantiates a new DimensionResponse 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 NewDimensionResponse() *DimensionResponse { + this := DimensionResponse{} + return &this +} + +// NewDimensionResponseWithDefaults instantiates a new DimensionResponse 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 NewDimensionResponseWithDefaults() *DimensionResponse { + this := DimensionResponse{} + return &this +} + +// GetResponse returns the Response field value if set, zero value otherwise. +func (o *DimensionResponse) GetResponse() string { + if o == nil || o.Response == nil { + var ret string + return ret + } + return *o.Response +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionResponse) GetResponseOk() (*string, bool) { + if o == nil || o.Response == nil { + return nil, false + } + return o.Response, true +} + +// HasResponse returns a boolean if a field has been set. +func (o *DimensionResponse) HasResponse() bool { + if o != nil && o.Response != nil { + return true + } + + return false +} + +// SetResponse gets a reference to the given string and assigns it to the Response field. +func (o *DimensionResponse) SetResponse(v string) { + o.Response = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Response != nil { + toSerialize["response"] = o.Response + } + + 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 *DimensionResponse) UnmarshalJSON(bytes []byte) (err error) { + varDimensionResponse := _DimensionResponse{} + + if err = json.Unmarshal(bytes, &varDimensionResponse); err == nil { + *o = DimensionResponse(varDimensionResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionResponse is a helper abstraction for handling nullable dimensionresponse types. +type NullableDimensionResponse struct { + value *DimensionResponse + isSet bool +} + +// Get returns the value. +func (v NullableDimensionResponse) Get() *DimensionResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionResponse) Set(val *DimensionResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionResponse returns a pointer to a new instance of NullableDimensionResponse. +func NewNullableDimensionResponse(val *DimensionResponse) *NullableDimensionResponse { + return &NullableDimensionResponse{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 NullableDimensionResponse) 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 *NullableDimensionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_status_code.go b/fastly/model_dimension_status_code.go new file mode 100644 index 0000000..c559878 --- /dev/null +++ b/fastly/model_dimension_status_code.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" +) + +// DimensionStatusCode struct for DimensionStatusCode +type DimensionStatusCode struct { + // The HTTP response code for this dimension. + StatusCode *string `json:"status-code,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionStatusCode DimensionStatusCode + +// NewDimensionStatusCode instantiates a new DimensionStatusCode 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 NewDimensionStatusCode() *DimensionStatusCode { + this := DimensionStatusCode{} + return &this +} + +// NewDimensionStatusCodeWithDefaults instantiates a new DimensionStatusCode 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 NewDimensionStatusCodeWithDefaults() *DimensionStatusCode { + this := DimensionStatusCode{} + return &this +} + +// GetStatusCode returns the StatusCode field value if set, zero value otherwise. +func (o *DimensionStatusCode) GetStatusCode() string { + if o == nil || o.StatusCode == nil { + var ret string + return ret + } + return *o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionStatusCode) GetStatusCodeOk() (*string, bool) { + if o == nil || o.StatusCode == nil { + return nil, false + } + return o.StatusCode, true +} + +// HasStatusCode returns a boolean if a field has been set. +func (o *DimensionStatusCode) HasStatusCode() bool { + if o != nil && o.StatusCode != nil { + return true + } + + return false +} + +// SetStatusCode gets a reference to the given string and assigns it to the StatusCode field. +func (o *DimensionStatusCode) SetStatusCode(v string) { + o.StatusCode = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionStatusCode) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.StatusCode != nil { + toSerialize["status-code"] = o.StatusCode + } + + 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 *DimensionStatusCode) UnmarshalJSON(bytes []byte) (err error) { + varDimensionStatusCode := _DimensionStatusCode{} + + if err = json.Unmarshal(bytes, &varDimensionStatusCode); err == nil { + *o = DimensionStatusCode(varDimensionStatusCode) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "status-code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionStatusCode is a helper abstraction for handling nullable dimensionstatuscode types. +type NullableDimensionStatusCode struct { + value *DimensionStatusCode + isSet bool +} + +// Get returns the value. +func (v NullableDimensionStatusCode) Get() *DimensionStatusCode { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionStatusCode) Set(val *DimensionStatusCode) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionStatusCode) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionStatusCode) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionStatusCode returns a pointer to a new instance of NullableDimensionStatusCode. +func NewNullableDimensionStatusCode(val *DimensionStatusCode) *NullableDimensionStatusCode { + return &NullableDimensionStatusCode{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 NullableDimensionStatusCode) 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 *NullableDimensionStatusCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_dimension_url.go b/fastly/model_dimension_url.go new file mode 100644 index 0000000..6164741 --- /dev/null +++ b/fastly/model_dimension_url.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" +) + +// DimensionURL struct for DimensionURL +type DimensionURL struct { + // The URL path for this dimension. + URL *string `json:"url,omitempty"` + AdditionalProperties map[string]any +} + +type _DimensionURL DimensionURL + +// NewDimensionURL instantiates a new DimensionURL 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 NewDimensionURL() *DimensionURL { + this := DimensionURL{} + return &this +} + +// NewDimensionURLWithDefaults instantiates a new DimensionURL 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 NewDimensionURLWithDefaults() *DimensionURL { + this := DimensionURL{} + return &this +} + +// GetURL returns the URL field value if set, zero value otherwise. +func (o *DimensionURL) GetURL() string { + if o == nil || o.URL == nil { + var ret string + return ret + } + return *o.URL +} + +// GetURLOk returns a tuple with the URL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DimensionURL) GetURLOk() (*string, bool) { + if o == nil || o.URL == nil { + return nil, false + } + return o.URL, true +} + +// HasURL returns a boolean if a field has been set. +func (o *DimensionURL) HasURL() bool { + if o != nil && o.URL != nil { + return true + } + + return false +} + +// SetURL gets a reference to the given string and assigns it to the URL field. +func (o *DimensionURL) SetURL(v string) { + o.URL = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o DimensionURL) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.URL != nil { + toSerialize["url"] = o.URL + } + + 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 *DimensionURL) UnmarshalJSON(bytes []byte) (err error) { + varDimensionURL := _DimensionURL{} + + if err = json.Unmarshal(bytes, &varDimensionURL); err == nil { + *o = DimensionURL(varDimensionURL) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableDimensionURL is a helper abstraction for handling nullable dimensionurl types. +type NullableDimensionURL struct { + value *DimensionURL + isSet bool +} + +// Get returns the value. +func (v NullableDimensionURL) Get() *DimensionURL { + return v.value +} + +// Set modifies the value. +func (v *NullableDimensionURL) Set(val *DimensionURL) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableDimensionURL) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableDimensionURL) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableDimensionURL returns a pointer to a new instance of NullableDimensionURL. +func NewNullableDimensionURL(val *DimensionURL) *NullableDimensionURL { + return &NullableDimensionURL{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 NullableDimensionURL) 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 *NullableDimensionURL) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_get_log_insights_response.go b/fastly/model_get_log_insights_response.go new file mode 100644 index 0000000..0142207 --- /dev/null +++ b/fastly/model_get_log_insights_response.go @@ -0,0 +1,191 @@ +// 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" +) + +// GetLogInsightsResponse struct for GetLogInsightsResponse +type GetLogInsightsResponse struct { + Data []LogInsights `json:"data,omitempty"` + Meta *LogInsightsMeta `json:"meta,omitempty"` + AdditionalProperties map[string]any +} + +type _GetLogInsightsResponse GetLogInsightsResponse + +// NewGetLogInsightsResponse instantiates a new GetLogInsightsResponse 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 NewGetLogInsightsResponse() *GetLogInsightsResponse { + this := GetLogInsightsResponse{} + return &this +} + +// NewGetLogInsightsResponseWithDefaults instantiates a new GetLogInsightsResponse 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 NewGetLogInsightsResponseWithDefaults() *GetLogInsightsResponse { + this := GetLogInsightsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *GetLogInsightsResponse) GetData() []LogInsights { + if o == nil || o.Data == nil { + var ret []LogInsights + 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 *GetLogInsightsResponse) GetDataOk() ([]LogInsights, 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 *GetLogInsightsResponse) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given []LogInsights and assigns it to the Data field. +func (o *GetLogInsightsResponse) SetData(v []LogInsights) { + o.Data = v +} + +// GetMeta returns the Meta field value if set, zero value otherwise. +func (o *GetLogInsightsResponse) GetMeta() LogInsightsMeta { + if o == nil || o.Meta == nil { + var ret LogInsightsMeta + 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 *GetLogInsightsResponse) GetMetaOk() (*LogInsightsMeta, 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 *GetLogInsightsResponse) HasMeta() bool { + if o != nil && o.Meta != nil { + return true + } + + return false +} + +// SetMeta gets a reference to the given LogInsightsMeta and assigns it to the Meta field. +func (o *GetLogInsightsResponse) SetMeta(v LogInsightsMeta) { + o.Meta = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o GetLogInsightsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Meta != nil { + toSerialize["meta"] = o.Meta + } + + 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 *GetLogInsightsResponse) UnmarshalJSON(bytes []byte) (err error) { + varGetLogInsightsResponse := _GetLogInsightsResponse{} + + if err = json.Unmarshal(bytes, &varGetLogInsightsResponse); err == nil { + *o = GetLogInsightsResponse(varGetLogInsightsResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "data") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableGetLogInsightsResponse is a helper abstraction for handling nullable getloginsightsresponse types. +type NullableGetLogInsightsResponse struct { + value *GetLogInsightsResponse + isSet bool +} + +// Get returns the value. +func (v NullableGetLogInsightsResponse) Get() *GetLogInsightsResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableGetLogInsightsResponse) Set(val *GetLogInsightsResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableGetLogInsightsResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableGetLogInsightsResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableGetLogInsightsResponse returns a pointer to a new instance of NullableGetLogInsightsResponse. +func NewNullableGetLogInsightsResponse(val *GetLogInsightsResponse) *NullableGetLogInsightsResponse { + return &NullableGetLogInsightsResponse{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 NullableGetLogInsightsResponse) 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 *NullableGetLogInsightsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_log_insights.go b/fastly/model_log_insights.go new file mode 100644 index 0000000..eddea6a --- /dev/null +++ b/fastly/model_log_insights.go @@ -0,0 +1,228 @@ +// 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" +) + +// LogInsights struct for LogInsights +type LogInsights struct { + Dimensions *LogInsightsDimensions `json:"dimensions,omitempty"` + DimensionAttributes *LogInsightsDimensionAttributes `json:"dimension_attributes,omitempty"` + Values *LogInsightsValues `json:"values,omitempty"` + AdditionalProperties map[string]any +} + +type _LogInsights LogInsights + +// NewLogInsights instantiates a new LogInsights 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 NewLogInsights() *LogInsights { + this := LogInsights{} + return &this +} + +// NewLogInsightsWithDefaults instantiates a new LogInsights 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 NewLogInsightsWithDefaults() *LogInsights { + this := LogInsights{} + return &this +} + +// GetDimensions returns the Dimensions field value if set, zero value otherwise. +func (o *LogInsights) GetDimensions() LogInsightsDimensions { + if o == nil || o.Dimensions == nil { + var ret LogInsightsDimensions + return ret + } + return *o.Dimensions +} + +// GetDimensionsOk returns a tuple with the Dimensions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogInsights) GetDimensionsOk() (*LogInsightsDimensions, bool) { + if o == nil || o.Dimensions == nil { + return nil, false + } + return o.Dimensions, true +} + +// HasDimensions returns a boolean if a field has been set. +func (o *LogInsights) HasDimensions() bool { + if o != nil && o.Dimensions != nil { + return true + } + + return false +} + +// SetDimensions gets a reference to the given LogInsightsDimensions and assigns it to the Dimensions field. +func (o *LogInsights) SetDimensions(v LogInsightsDimensions) { + o.Dimensions = &v +} + +// GetDimensionAttributes returns the DimensionAttributes field value if set, zero value otherwise. +func (o *LogInsights) GetDimensionAttributes() LogInsightsDimensionAttributes { + if o == nil || o.DimensionAttributes == nil { + var ret LogInsightsDimensionAttributes + return ret + } + return *o.DimensionAttributes +} + +// GetDimensionAttributesOk returns a tuple with the DimensionAttributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogInsights) GetDimensionAttributesOk() (*LogInsightsDimensionAttributes, bool) { + if o == nil || o.DimensionAttributes == nil { + return nil, false + } + return o.DimensionAttributes, true +} + +// HasDimensionAttributes returns a boolean if a field has been set. +func (o *LogInsights) HasDimensionAttributes() bool { + if o != nil && o.DimensionAttributes != nil { + return true + } + + return false +} + +// SetDimensionAttributes gets a reference to the given LogInsightsDimensionAttributes and assigns it to the DimensionAttributes field. +func (o *LogInsights) SetDimensionAttributes(v LogInsightsDimensionAttributes) { + o.DimensionAttributes = &v +} + +// GetValues returns the Values field value if set, zero value otherwise. +func (o *LogInsights) GetValues() LogInsightsValues { + if o == nil || o.Values == nil { + var ret LogInsightsValues + return ret + } + return *o.Values +} + +// GetValuesOk returns a tuple with the Values field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogInsights) GetValuesOk() (*LogInsightsValues, bool) { + if o == nil || o.Values == nil { + return nil, false + } + return o.Values, true +} + +// HasValues returns a boolean if a field has been set. +func (o *LogInsights) HasValues() bool { + if o != nil && o.Values != nil { + return true + } + + return false +} + +// SetValues gets a reference to the given LogInsightsValues and assigns it to the Values field. +func (o *LogInsights) SetValues(v LogInsightsValues) { + o.Values = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o LogInsights) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Dimensions != nil { + toSerialize["dimensions"] = o.Dimensions + } + if o.DimensionAttributes != nil { + toSerialize["dimension_attributes"] = o.DimensionAttributes + } + if o.Values != nil { + toSerialize["values"] = o.Values + } + + 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 *LogInsights) UnmarshalJSON(bytes []byte) (err error) { + varLogInsights := _LogInsights{} + + if err = json.Unmarshal(bytes, &varLogInsights); err == nil { + *o = LogInsights(varLogInsights) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "dimensions") + delete(additionalProperties, "dimension_attributes") + delete(additionalProperties, "values") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableLogInsights is a helper abstraction for handling nullable loginsights types. +type NullableLogInsights struct { + value *LogInsights + isSet bool +} + +// Get returns the value. +func (v NullableLogInsights) Get() *LogInsights { + return v.value +} + +// Set modifies the value. +func (v *NullableLogInsights) Set(val *LogInsights) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableLogInsights) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableLogInsights) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLogInsights returns a pointer to a new instance of NullableLogInsights. +func NewNullableLogInsights(val *LogInsights) *NullableLogInsights { + return &NullableLogInsights{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 NullableLogInsights) 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 *NullableLogInsights) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_log_insights_dimension_attributes.go b/fastly/model_log_insights_dimension_attributes.go new file mode 100644 index 0000000..0ecb287 --- /dev/null +++ b/fastly/model_log_insights_dimension_attributes.go @@ -0,0 +1,159 @@ +// 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" +) + +// LogInsightsDimensionAttributes - struct for LogInsightsDimensionAttributes +type LogInsightsDimensionAttributes struct { + DimensionAttributesCountryStats *DimensionAttributesCountryStats + DimensionAttributesRate *DimensionAttributesRate +} + +// DimensionAttributesCountryStatsAsLogInsightsDimensionAttributes is a convenience function that returns DimensionAttributesCountryStats wrapped in LogInsightsDimensionAttributes +func DimensionAttributesCountryStatsAsLogInsightsDimensionAttributes(v *DimensionAttributesCountryStats) LogInsightsDimensionAttributes { + return LogInsightsDimensionAttributes{ + DimensionAttributesCountryStats: v, + } +} + +// DimensionAttributesRateAsLogInsightsDimensionAttributes is a convenience function that returns DimensionAttributesRate wrapped in LogInsightsDimensionAttributes +func DimensionAttributesRateAsLogInsightsDimensionAttributes(v *DimensionAttributesRate) LogInsightsDimensionAttributes { + return LogInsightsDimensionAttributes{ + DimensionAttributesRate: v, + } +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *LogInsightsDimensionAttributes) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into DimensionAttributesCountryStats + err = newStrictDecoder(data).Decode(&o.DimensionAttributesCountryStats) + if err == nil { + jsonDimensionAttributesCountryStats, _ := json.Marshal(o.DimensionAttributesCountryStats) + if string(jsonDimensionAttributesCountryStats) == "{}" { // empty struct + o.DimensionAttributesCountryStats = nil + } else { + match++ + } + } else { + o.DimensionAttributesCountryStats = nil + } + + // try to unmarshal data into DimensionAttributesRate + err = newStrictDecoder(data).Decode(&o.DimensionAttributesRate) + if err == nil { + jsonDimensionAttributesRate, _ := json.Marshal(o.DimensionAttributesRate) + if string(jsonDimensionAttributesRate) == "{}" { // empty struct + o.DimensionAttributesRate = nil + } else { + match++ + } + } else { + o.DimensionAttributesRate = nil + } + + if match > 1 { // more than 1 match + // reset to nil + o.DimensionAttributesCountryStats = nil + o.DimensionAttributesRate = nil + + return fmt.Errorf("data matches more than one schema in oneOf(LogInsightsDimensionAttributes)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(LogInsightsDimensionAttributes)") + } +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o LogInsightsDimensionAttributes) MarshalJSON() ([]byte, error) { + if o.DimensionAttributesCountryStats != nil { + return json.Marshal(&o.DimensionAttributesCountryStats) + } + + if o.DimensionAttributesRate != nil { + return json.Marshal(&o.DimensionAttributesRate) + } + + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns a specific instance of the type. +func (o *LogInsightsDimensionAttributes) GetActualInstance() any { + if o == nil { + return nil + } + if o.DimensionAttributesCountryStats != nil { + return o.DimensionAttributesCountryStats + } + + if o.DimensionAttributesRate != nil { + return o.DimensionAttributesRate + } + + // all schemas are nil + return nil +} + +// NullableLogInsightsDimensionAttributes is a helper abstraction for handling nullable loginsightsdimensionattributes types. +type NullableLogInsightsDimensionAttributes struct { + value *LogInsightsDimensionAttributes + isSet bool +} + +// Get returns the value. +func (v NullableLogInsightsDimensionAttributes) Get() *LogInsightsDimensionAttributes { + return v.value +} + +// Set modifies the value. +func (v *NullableLogInsightsDimensionAttributes) Set(val *LogInsightsDimensionAttributes) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableLogInsightsDimensionAttributes) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableLogInsightsDimensionAttributes) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLogInsightsDimensionAttributes returns a pointer to a new instance of NullableLogInsightsDimensionAttributes. +func NewNullableLogInsightsDimensionAttributes(val *LogInsightsDimensionAttributes) *NullableLogInsightsDimensionAttributes { + return &NullableLogInsightsDimensionAttributes{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 NullableLogInsightsDimensionAttributes) 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 *NullableLogInsightsDimensionAttributes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_log_insights_dimensions.go b/fastly/model_log_insights_dimensions.go new file mode 100644 index 0000000..22ada5e --- /dev/null +++ b/fastly/model_log_insights_dimensions.go @@ -0,0 +1,339 @@ +// 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" +) + +// LogInsightsDimensions - struct for LogInsightsDimensions +type LogInsightsDimensions struct { + DimensionBrowser *DimensionBrowser + DimensionContentType *DimensionContentType + DimensionCountry *DimensionCountry + DimensionDevice *DimensionDevice + DimensionOs *DimensionOs + DimensionResponse *DimensionResponse + DimensionStatusCode *DimensionStatusCode + DimensionURL *DimensionURL +} + +// DimensionBrowserAsLogInsightsDimensions is a convenience function that returns DimensionBrowser wrapped in LogInsightsDimensions +func DimensionBrowserAsLogInsightsDimensions(v *DimensionBrowser) LogInsightsDimensions { + return LogInsightsDimensions{ + DimensionBrowser: v, + } +} + +// DimensionContentTypeAsLogInsightsDimensions is a convenience function that returns DimensionContentType wrapped in LogInsightsDimensions +func DimensionContentTypeAsLogInsightsDimensions(v *DimensionContentType) LogInsightsDimensions { + return LogInsightsDimensions{ + DimensionContentType: v, + } +} + +// DimensionCountryAsLogInsightsDimensions is a convenience function that returns DimensionCountry wrapped in LogInsightsDimensions +func DimensionCountryAsLogInsightsDimensions(v *DimensionCountry) LogInsightsDimensions { + return LogInsightsDimensions{ + DimensionCountry: v, + } +} + +// DimensionDeviceAsLogInsightsDimensions is a convenience function that returns DimensionDevice wrapped in LogInsightsDimensions +func DimensionDeviceAsLogInsightsDimensions(v *DimensionDevice) LogInsightsDimensions { + return LogInsightsDimensions{ + DimensionDevice: v, + } +} + +// DimensionOsAsLogInsightsDimensions is a convenience function that returns DimensionOs wrapped in LogInsightsDimensions +func DimensionOsAsLogInsightsDimensions(v *DimensionOs) LogInsightsDimensions { + return LogInsightsDimensions{ + DimensionOs: v, + } +} + +// DimensionResponseAsLogInsightsDimensions is a convenience function that returns DimensionResponse wrapped in LogInsightsDimensions +func DimensionResponseAsLogInsightsDimensions(v *DimensionResponse) LogInsightsDimensions { + return LogInsightsDimensions{ + DimensionResponse: v, + } +} + +// DimensionStatusCodeAsLogInsightsDimensions is a convenience function that returns DimensionStatusCode wrapped in LogInsightsDimensions +func DimensionStatusCodeAsLogInsightsDimensions(v *DimensionStatusCode) LogInsightsDimensions { + return LogInsightsDimensions{ + DimensionStatusCode: v, + } +} + +// DimensionURLAsLogInsightsDimensions is a convenience function that returns DimensionURL wrapped in LogInsightsDimensions +func DimensionURLAsLogInsightsDimensions(v *DimensionURL) LogInsightsDimensions { + return LogInsightsDimensions{ + DimensionURL: v, + } +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *LogInsightsDimensions) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into DimensionBrowser + err = newStrictDecoder(data).Decode(&o.DimensionBrowser) + if err == nil { + jsonDimensionBrowser, _ := json.Marshal(o.DimensionBrowser) + if string(jsonDimensionBrowser) == "{}" { // empty struct + o.DimensionBrowser = nil + } else { + match++ + } + } else { + o.DimensionBrowser = nil + } + + // try to unmarshal data into DimensionContentType + err = newStrictDecoder(data).Decode(&o.DimensionContentType) + if err == nil { + jsonDimensionContentType, _ := json.Marshal(o.DimensionContentType) + if string(jsonDimensionContentType) == "{}" { // empty struct + o.DimensionContentType = nil + } else { + match++ + } + } else { + o.DimensionContentType = nil + } + + // try to unmarshal data into DimensionCountry + err = newStrictDecoder(data).Decode(&o.DimensionCountry) + if err == nil { + jsonDimensionCountry, _ := json.Marshal(o.DimensionCountry) + if string(jsonDimensionCountry) == "{}" { // empty struct + o.DimensionCountry = nil + } else { + match++ + } + } else { + o.DimensionCountry = nil + } + + // try to unmarshal data into DimensionDevice + err = newStrictDecoder(data).Decode(&o.DimensionDevice) + if err == nil { + jsonDimensionDevice, _ := json.Marshal(o.DimensionDevice) + if string(jsonDimensionDevice) == "{}" { // empty struct + o.DimensionDevice = nil + } else { + match++ + } + } else { + o.DimensionDevice = nil + } + + // try to unmarshal data into DimensionOs + err = newStrictDecoder(data).Decode(&o.DimensionOs) + if err == nil { + jsonDimensionOs, _ := json.Marshal(o.DimensionOs) + if string(jsonDimensionOs) == "{}" { // empty struct + o.DimensionOs = nil + } else { + match++ + } + } else { + o.DimensionOs = nil + } + + // try to unmarshal data into DimensionResponse + err = newStrictDecoder(data).Decode(&o.DimensionResponse) + if err == nil { + jsonDimensionResponse, _ := json.Marshal(o.DimensionResponse) + if string(jsonDimensionResponse) == "{}" { // empty struct + o.DimensionResponse = nil + } else { + match++ + } + } else { + o.DimensionResponse = nil + } + + // try to unmarshal data into DimensionStatusCode + err = newStrictDecoder(data).Decode(&o.DimensionStatusCode) + if err == nil { + jsonDimensionStatusCode, _ := json.Marshal(o.DimensionStatusCode) + if string(jsonDimensionStatusCode) == "{}" { // empty struct + o.DimensionStatusCode = nil + } else { + match++ + } + } else { + o.DimensionStatusCode = nil + } + + // try to unmarshal data into DimensionURL + err = newStrictDecoder(data).Decode(&o.DimensionURL) + if err == nil { + jsonDimensionURL, _ := json.Marshal(o.DimensionURL) + if string(jsonDimensionURL) == "{}" { // empty struct + o.DimensionURL = nil + } else { + match++ + } + } else { + o.DimensionURL = nil + } + + if match > 1 { // more than 1 match + // reset to nil + o.DimensionBrowser = nil + o.DimensionContentType = nil + o.DimensionCountry = nil + o.DimensionDevice = nil + o.DimensionOs = nil + o.DimensionResponse = nil + o.DimensionStatusCode = nil + o.DimensionURL = nil + + return fmt.Errorf("data matches more than one schema in oneOf(LogInsightsDimensions)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(LogInsightsDimensions)") + } +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o LogInsightsDimensions) MarshalJSON() ([]byte, error) { + if o.DimensionBrowser != nil { + return json.Marshal(&o.DimensionBrowser) + } + + if o.DimensionContentType != nil { + return json.Marshal(&o.DimensionContentType) + } + + if o.DimensionCountry != nil { + return json.Marshal(&o.DimensionCountry) + } + + if o.DimensionDevice != nil { + return json.Marshal(&o.DimensionDevice) + } + + if o.DimensionOs != nil { + return json.Marshal(&o.DimensionOs) + } + + if o.DimensionResponse != nil { + return json.Marshal(&o.DimensionResponse) + } + + if o.DimensionStatusCode != nil { + return json.Marshal(&o.DimensionStatusCode) + } + + if o.DimensionURL != nil { + return json.Marshal(&o.DimensionURL) + } + + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns a specific instance of the type. +func (o *LogInsightsDimensions) GetActualInstance() any { + if o == nil { + return nil + } + if o.DimensionBrowser != nil { + return o.DimensionBrowser + } + + if o.DimensionContentType != nil { + return o.DimensionContentType + } + + if o.DimensionCountry != nil { + return o.DimensionCountry + } + + if o.DimensionDevice != nil { + return o.DimensionDevice + } + + if o.DimensionOs != nil { + return o.DimensionOs + } + + if o.DimensionResponse != nil { + return o.DimensionResponse + } + + if o.DimensionStatusCode != nil { + return o.DimensionStatusCode + } + + if o.DimensionURL != nil { + return o.DimensionURL + } + + // all schemas are nil + return nil +} + +// NullableLogInsightsDimensions is a helper abstraction for handling nullable loginsightsdimensions types. +type NullableLogInsightsDimensions struct { + value *LogInsightsDimensions + isSet bool +} + +// Get returns the value. +func (v NullableLogInsightsDimensions) Get() *LogInsightsDimensions { + return v.value +} + +// Set modifies the value. +func (v *NullableLogInsightsDimensions) Set(val *LogInsightsDimensions) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableLogInsightsDimensions) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableLogInsightsDimensions) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLogInsightsDimensions returns a pointer to a new instance of NullableLogInsightsDimensions. +func NewNullableLogInsightsDimensions(val *LogInsightsDimensions) *NullableLogInsightsDimensions { + return &NullableLogInsightsDimensions{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 NullableLogInsightsDimensions) 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 *NullableLogInsightsDimensions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_log_insights_meta.go b/fastly/model_log_insights_meta.go new file mode 100644 index 0000000..5d08da2 --- /dev/null +++ b/fastly/model_log_insights_meta.go @@ -0,0 +1,154 @@ +// 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" +) + +// LogInsightsMeta Echoes the filters that were supplied in the request. +type LogInsightsMeta struct { + Filters *LogInsightsMetaFilter `json:"filters,omitempty"` + AdditionalProperties map[string]any +} + +type _LogInsightsMeta LogInsightsMeta + +// NewLogInsightsMeta instantiates a new LogInsightsMeta 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 NewLogInsightsMeta() *LogInsightsMeta { + this := LogInsightsMeta{} + return &this +} + +// NewLogInsightsMetaWithDefaults instantiates a new LogInsightsMeta 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 NewLogInsightsMetaWithDefaults() *LogInsightsMeta { + this := LogInsightsMeta{} + return &this +} + +// GetFilters returns the Filters field value if set, zero value otherwise. +func (o *LogInsightsMeta) GetFilters() LogInsightsMetaFilter { + if o == nil || o.Filters == nil { + var ret LogInsightsMetaFilter + return ret + } + return *o.Filters +} + +// GetFiltersOk returns a tuple with the Filters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogInsightsMeta) GetFiltersOk() (*LogInsightsMetaFilter, bool) { + if o == nil || o.Filters == nil { + return nil, false + } + return o.Filters, true +} + +// HasFilters returns a boolean if a field has been set. +func (o *LogInsightsMeta) HasFilters() bool { + if o != nil && o.Filters != nil { + return true + } + + return false +} + +// SetFilters gets a reference to the given LogInsightsMetaFilter and assigns it to the Filters field. +func (o *LogInsightsMeta) SetFilters(v LogInsightsMetaFilter) { + o.Filters = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o LogInsightsMeta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Filters != nil { + toSerialize["filters"] = o.Filters + } + + 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 *LogInsightsMeta) UnmarshalJSON(bytes []byte) (err error) { + varLogInsightsMeta := _LogInsightsMeta{} + + if err = json.Unmarshal(bytes, &varLogInsightsMeta); err == nil { + *o = LogInsightsMeta(varLogInsightsMeta) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "filters") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableLogInsightsMeta is a helper abstraction for handling nullable loginsightsmeta types. +type NullableLogInsightsMeta struct { + value *LogInsightsMeta + isSet bool +} + +// Get returns the value. +func (v NullableLogInsightsMeta) Get() *LogInsightsMeta { + return v.value +} + +// Set modifies the value. +func (v *NullableLogInsightsMeta) Set(val *LogInsightsMeta) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableLogInsightsMeta) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableLogInsightsMeta) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLogInsightsMeta returns a pointer to a new instance of NullableLogInsightsMeta. +func NewNullableLogInsightsMeta(val *LogInsightsMeta) *NullableLogInsightsMeta { + return &NullableLogInsightsMeta{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 NullableLogInsightsMeta) 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 *NullableLogInsightsMeta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_log_insights_meta_filter.go b/fastly/model_log_insights_meta_filter.go new file mode 100644 index 0000000..a7d216d --- /dev/null +++ b/fastly/model_log_insights_meta_filter.go @@ -0,0 +1,311 @@ +// 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" +) + +// LogInsightsMetaFilter The filters that were supplied in the request. +type LogInsightsMetaFilter struct { + // Specifies the ID of the service for which data should be returned. + ServiceID *string `json:"service_id,omitempty"` + // Start time for the query as supplied in the request. + Start *string `json:"start,omitempty"` + // End time for the query as supplied in the request. + End *string `json:"end,omitempty"` + // Value of the `domain_exact_match` filter as supplied in the request. + DomainExactMatch *bool `json:"domain_exact_match,omitempty"` + // Number of records per page. + Limit *int32 `json:"limit,omitempty"` + AdditionalProperties map[string]any +} + +type _LogInsightsMetaFilter LogInsightsMetaFilter + +// NewLogInsightsMetaFilter instantiates a new LogInsightsMetaFilter 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 NewLogInsightsMetaFilter() *LogInsightsMetaFilter { + this := LogInsightsMetaFilter{} + var limit int32 = 20 + this.Limit = &limit + return &this +} + +// NewLogInsightsMetaFilterWithDefaults instantiates a new LogInsightsMetaFilter 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 NewLogInsightsMetaFilterWithDefaults() *LogInsightsMetaFilter { + this := LogInsightsMetaFilter{} + var limit int32 = 20 + this.Limit = &limit + return &this +} + +// GetServiceID returns the ServiceID field value if set, zero value otherwise. +func (o *LogInsightsMetaFilter) 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 *LogInsightsMetaFilter) 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 *LogInsightsMetaFilter) 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 *LogInsightsMetaFilter) SetServiceID(v string) { + o.ServiceID = &v +} + +// GetStart returns the Start field value if set, zero value otherwise. +func (o *LogInsightsMetaFilter) GetStart() string { + if o == nil || o.Start == nil { + var ret string + return ret + } + return *o.Start +} + +// GetStartOk returns a tuple with the Start field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogInsightsMetaFilter) GetStartOk() (*string, bool) { + if o == nil || o.Start == nil { + return nil, false + } + return o.Start, true +} + +// HasStart returns a boolean if a field has been set. +func (o *LogInsightsMetaFilter) HasStart() bool { + if o != nil && o.Start != nil { + return true + } + + return false +} + +// SetStart gets a reference to the given string and assigns it to the Start field. +func (o *LogInsightsMetaFilter) SetStart(v string) { + o.Start = &v +} + +// GetEnd returns the End field value if set, zero value otherwise. +func (o *LogInsightsMetaFilter) GetEnd() string { + if o == nil || o.End == nil { + var ret string + return ret + } + return *o.End +} + +// GetEndOk returns a tuple with the End field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogInsightsMetaFilter) GetEndOk() (*string, bool) { + if o == nil || o.End == nil { + return nil, false + } + return o.End, true +} + +// HasEnd returns a boolean if a field has been set. +func (o *LogInsightsMetaFilter) HasEnd() bool { + if o != nil && o.End != nil { + return true + } + + return false +} + +// SetEnd gets a reference to the given string and assigns it to the End field. +func (o *LogInsightsMetaFilter) SetEnd(v string) { + o.End = &v +} + +// GetDomainExactMatch returns the DomainExactMatch field value if set, zero value otherwise. +func (o *LogInsightsMetaFilter) GetDomainExactMatch() bool { + if o == nil || o.DomainExactMatch == nil { + var ret bool + return ret + } + return *o.DomainExactMatch +} + +// GetDomainExactMatchOk returns a tuple with the DomainExactMatch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LogInsightsMetaFilter) GetDomainExactMatchOk() (*bool, bool) { + if o == nil || o.DomainExactMatch == nil { + return nil, false + } + return o.DomainExactMatch, true +} + +// HasDomainExactMatch returns a boolean if a field has been set. +func (o *LogInsightsMetaFilter) HasDomainExactMatch() bool { + if o != nil && o.DomainExactMatch != nil { + return true + } + + return false +} + +// SetDomainExactMatch gets a reference to the given bool and assigns it to the DomainExactMatch field. +func (o *LogInsightsMetaFilter) SetDomainExactMatch(v bool) { + o.DomainExactMatch = &v +} + +// GetLimit returns the Limit field value if set, zero value otherwise. +func (o *LogInsightsMetaFilter) GetLimit() int32 { + if o == nil || o.Limit == nil { + var ret int32 + 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 *LogInsightsMetaFilter) GetLimitOk() (*int32, 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 *LogInsightsMetaFilter) HasLimit() bool { + if o != nil && o.Limit != nil { + return true + } + + return false +} + +// SetLimit gets a reference to the given int32 and assigns it to the Limit field. +func (o *LogInsightsMetaFilter) SetLimit(v int32) { + o.Limit = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o LogInsightsMetaFilter) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.ServiceID != nil { + toSerialize["service_id"] = o.ServiceID + } + if o.Start != nil { + toSerialize["start"] = o.Start + } + if o.End != nil { + toSerialize["end"] = o.End + } + if o.DomainExactMatch != nil { + toSerialize["domain_exact_match"] = o.DomainExactMatch + } + if o.Limit != nil { + toSerialize["limit"] = o.Limit + } + + 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 *LogInsightsMetaFilter) UnmarshalJSON(bytes []byte) (err error) { + varLogInsightsMetaFilter := _LogInsightsMetaFilter{} + + if err = json.Unmarshal(bytes, &varLogInsightsMetaFilter); err == nil { + *o = LogInsightsMetaFilter(varLogInsightsMetaFilter) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "service_id") + delete(additionalProperties, "start") + delete(additionalProperties, "end") + delete(additionalProperties, "domain_exact_match") + delete(additionalProperties, "limit") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableLogInsightsMetaFilter is a helper abstraction for handling nullable loginsightsmetafilter types. +type NullableLogInsightsMetaFilter struct { + value *LogInsightsMetaFilter + isSet bool +} + +// Get returns the value. +func (v NullableLogInsightsMetaFilter) Get() *LogInsightsMetaFilter { + return v.value +} + +// Set modifies the value. +func (v *NullableLogInsightsMetaFilter) Set(val *LogInsightsMetaFilter) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableLogInsightsMetaFilter) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableLogInsightsMetaFilter) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLogInsightsMetaFilter returns a pointer to a new instance of NullableLogInsightsMetaFilter. +func NewNullableLogInsightsMetaFilter(val *LogInsightsMetaFilter) *NullableLogInsightsMetaFilter { + return &NullableLogInsightsMetaFilter{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 NullableLogInsightsMetaFilter) 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 *NullableLogInsightsMetaFilter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_log_insights_values.go b/fastly/model_log_insights_values.go new file mode 100644 index 0000000..deda208 --- /dev/null +++ b/fastly/model_log_insights_values.go @@ -0,0 +1,399 @@ +// 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" +) + +// LogInsightsValues - struct for LogInsightsValues +type LogInsightsValues struct { + Values503Responses *Values503Responses + ValuesBandwidth *ValuesBandwidth + ValuesBrowser *ValuesBrowser + ValuesCacheHitRatio *ValuesCacheHitRatio + ValuesCountryStats *ValuesCountryStats + ValuesDuration *ValuesDuration + ValuesMisses *ValuesMisses + ValuesRate *ValuesRate + ValuesRequests *ValuesRequests + ValuesStatusCodes *ValuesStatusCodes +} + +// Values503ResponsesAsLogInsightsValues is a convenience function that returns Values503Responses wrapped in LogInsightsValues +func Values503ResponsesAsLogInsightsValues(v *Values503Responses) LogInsightsValues { + return LogInsightsValues{ + Values503Responses: v, + } +} + +// ValuesBandwidthAsLogInsightsValues is a convenience function that returns ValuesBandwidth wrapped in LogInsightsValues +func ValuesBandwidthAsLogInsightsValues(v *ValuesBandwidth) LogInsightsValues { + return LogInsightsValues{ + ValuesBandwidth: v, + } +} + +// ValuesBrowserAsLogInsightsValues is a convenience function that returns ValuesBrowser wrapped in LogInsightsValues +func ValuesBrowserAsLogInsightsValues(v *ValuesBrowser) LogInsightsValues { + return LogInsightsValues{ + ValuesBrowser: v, + } +} + +// ValuesCacheHitRatioAsLogInsightsValues is a convenience function that returns ValuesCacheHitRatio wrapped in LogInsightsValues +func ValuesCacheHitRatioAsLogInsightsValues(v *ValuesCacheHitRatio) LogInsightsValues { + return LogInsightsValues{ + ValuesCacheHitRatio: v, + } +} + +// ValuesCountryStatsAsLogInsightsValues is a convenience function that returns ValuesCountryStats wrapped in LogInsightsValues +func ValuesCountryStatsAsLogInsightsValues(v *ValuesCountryStats) LogInsightsValues { + return LogInsightsValues{ + ValuesCountryStats: v, + } +} + +// ValuesDurationAsLogInsightsValues is a convenience function that returns ValuesDuration wrapped in LogInsightsValues +func ValuesDurationAsLogInsightsValues(v *ValuesDuration) LogInsightsValues { + return LogInsightsValues{ + ValuesDuration: v, + } +} + +// ValuesMissesAsLogInsightsValues is a convenience function that returns ValuesMisses wrapped in LogInsightsValues +func ValuesMissesAsLogInsightsValues(v *ValuesMisses) LogInsightsValues { + return LogInsightsValues{ + ValuesMisses: v, + } +} + +// ValuesRateAsLogInsightsValues is a convenience function that returns ValuesRate wrapped in LogInsightsValues +func ValuesRateAsLogInsightsValues(v *ValuesRate) LogInsightsValues { + return LogInsightsValues{ + ValuesRate: v, + } +} + +// ValuesRequestsAsLogInsightsValues is a convenience function that returns ValuesRequests wrapped in LogInsightsValues +func ValuesRequestsAsLogInsightsValues(v *ValuesRequests) LogInsightsValues { + return LogInsightsValues{ + ValuesRequests: v, + } +} + +// ValuesStatusCodesAsLogInsightsValues is a convenience function that returns ValuesStatusCodes wrapped in LogInsightsValues +func ValuesStatusCodesAsLogInsightsValues(v *ValuesStatusCodes) LogInsightsValues { + return LogInsightsValues{ + ValuesStatusCodes: v, + } +} + +// UnmarshalJSON implements the Unmarshaler interface. +// Unmarshaler is the interface implemented by types that can unmarshal a JSON description of themselves. +func (o *LogInsightsValues) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Values503Responses + err = newStrictDecoder(data).Decode(&o.Values503Responses) + if err == nil { + jsonValues503Responses, _ := json.Marshal(o.Values503Responses) + if string(jsonValues503Responses) == "{}" { // empty struct + o.Values503Responses = nil + } else { + match++ + } + } else { + o.Values503Responses = nil + } + + // try to unmarshal data into ValuesBandwidth + err = newStrictDecoder(data).Decode(&o.ValuesBandwidth) + if err == nil { + jsonValuesBandwidth, _ := json.Marshal(o.ValuesBandwidth) + if string(jsonValuesBandwidth) == "{}" { // empty struct + o.ValuesBandwidth = nil + } else { + match++ + } + } else { + o.ValuesBandwidth = nil + } + + // try to unmarshal data into ValuesBrowser + err = newStrictDecoder(data).Decode(&o.ValuesBrowser) + if err == nil { + jsonValuesBrowser, _ := json.Marshal(o.ValuesBrowser) + if string(jsonValuesBrowser) == "{}" { // empty struct + o.ValuesBrowser = nil + } else { + match++ + } + } else { + o.ValuesBrowser = nil + } + + // try to unmarshal data into ValuesCacheHitRatio + err = newStrictDecoder(data).Decode(&o.ValuesCacheHitRatio) + if err == nil { + jsonValuesCacheHitRatio, _ := json.Marshal(o.ValuesCacheHitRatio) + if string(jsonValuesCacheHitRatio) == "{}" { // empty struct + o.ValuesCacheHitRatio = nil + } else { + match++ + } + } else { + o.ValuesCacheHitRatio = nil + } + + // try to unmarshal data into ValuesCountryStats + err = newStrictDecoder(data).Decode(&o.ValuesCountryStats) + if err == nil { + jsonValuesCountryStats, _ := json.Marshal(o.ValuesCountryStats) + if string(jsonValuesCountryStats) == "{}" { // empty struct + o.ValuesCountryStats = nil + } else { + match++ + } + } else { + o.ValuesCountryStats = nil + } + + // try to unmarshal data into ValuesDuration + err = newStrictDecoder(data).Decode(&o.ValuesDuration) + if err == nil { + jsonValuesDuration, _ := json.Marshal(o.ValuesDuration) + if string(jsonValuesDuration) == "{}" { // empty struct + o.ValuesDuration = nil + } else { + match++ + } + } else { + o.ValuesDuration = nil + } + + // try to unmarshal data into ValuesMisses + err = newStrictDecoder(data).Decode(&o.ValuesMisses) + if err == nil { + jsonValuesMisses, _ := json.Marshal(o.ValuesMisses) + if string(jsonValuesMisses) == "{}" { // empty struct + o.ValuesMisses = nil + } else { + match++ + } + } else { + o.ValuesMisses = nil + } + + // try to unmarshal data into ValuesRate + err = newStrictDecoder(data).Decode(&o.ValuesRate) + if err == nil { + jsonValuesRate, _ := json.Marshal(o.ValuesRate) + if string(jsonValuesRate) == "{}" { // empty struct + o.ValuesRate = nil + } else { + match++ + } + } else { + o.ValuesRate = nil + } + + // try to unmarshal data into ValuesRequests + err = newStrictDecoder(data).Decode(&o.ValuesRequests) + if err == nil { + jsonValuesRequests, _ := json.Marshal(o.ValuesRequests) + if string(jsonValuesRequests) == "{}" { // empty struct + o.ValuesRequests = nil + } else { + match++ + } + } else { + o.ValuesRequests = nil + } + + // try to unmarshal data into ValuesStatusCodes + err = newStrictDecoder(data).Decode(&o.ValuesStatusCodes) + if err == nil { + jsonValuesStatusCodes, _ := json.Marshal(o.ValuesStatusCodes) + if string(jsonValuesStatusCodes) == "{}" { // empty struct + o.ValuesStatusCodes = nil + } else { + match++ + } + } else { + o.ValuesStatusCodes = nil + } + + if match > 1 { // more than 1 match + // reset to nil + o.Values503Responses = nil + o.ValuesBandwidth = nil + o.ValuesBrowser = nil + o.ValuesCacheHitRatio = nil + o.ValuesCountryStats = nil + o.ValuesDuration = nil + o.ValuesMisses = nil + o.ValuesRate = nil + o.ValuesRequests = nil + o.ValuesStatusCodes = nil + + return fmt.Errorf("data matches more than one schema in oneOf(LogInsightsValues)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(LogInsightsValues)") + } +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o LogInsightsValues) MarshalJSON() ([]byte, error) { + if o.Values503Responses != nil { + return json.Marshal(&o.Values503Responses) + } + + if o.ValuesBandwidth != nil { + return json.Marshal(&o.ValuesBandwidth) + } + + if o.ValuesBrowser != nil { + return json.Marshal(&o.ValuesBrowser) + } + + if o.ValuesCacheHitRatio != nil { + return json.Marshal(&o.ValuesCacheHitRatio) + } + + if o.ValuesCountryStats != nil { + return json.Marshal(&o.ValuesCountryStats) + } + + if o.ValuesDuration != nil { + return json.Marshal(&o.ValuesDuration) + } + + if o.ValuesMisses != nil { + return json.Marshal(&o.ValuesMisses) + } + + if o.ValuesRate != nil { + return json.Marshal(&o.ValuesRate) + } + + if o.ValuesRequests != nil { + return json.Marshal(&o.ValuesRequests) + } + + if o.ValuesStatusCodes != nil { + return json.Marshal(&o.ValuesStatusCodes) + } + + return nil, nil // no data in oneOf schemas +} + +// GetActualInstance returns a specific instance of the type. +func (o *LogInsightsValues) GetActualInstance() any { + if o == nil { + return nil + } + if o.Values503Responses != nil { + return o.Values503Responses + } + + if o.ValuesBandwidth != nil { + return o.ValuesBandwidth + } + + if o.ValuesBrowser != nil { + return o.ValuesBrowser + } + + if o.ValuesCacheHitRatio != nil { + return o.ValuesCacheHitRatio + } + + if o.ValuesCountryStats != nil { + return o.ValuesCountryStats + } + + if o.ValuesDuration != nil { + return o.ValuesDuration + } + + if o.ValuesMisses != nil { + return o.ValuesMisses + } + + if o.ValuesRate != nil { + return o.ValuesRate + } + + if o.ValuesRequests != nil { + return o.ValuesRequests + } + + if o.ValuesStatusCodes != nil { + return o.ValuesStatusCodes + } + + // all schemas are nil + return nil +} + +// NullableLogInsightsValues is a helper abstraction for handling nullable loginsightsvalues types. +type NullableLogInsightsValues struct { + value *LogInsightsValues + isSet bool +} + +// Get returns the value. +func (v NullableLogInsightsValues) Get() *LogInsightsValues { + return v.value +} + +// Set modifies the value. +func (v *NullableLogInsightsValues) Set(val *LogInsightsValues) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableLogInsightsValues) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableLogInsightsValues) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLogInsightsValues returns a pointer to a new instance of NullableLogInsightsValues. +func NewNullableLogInsightsValues(val *LogInsightsValues) *NullableLogInsightsValues { + return &NullableLogInsightsValues{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 NullableLogInsightsValues) 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 *NullableLogInsightsValues) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_logging_grafanacloudlogs_additional.go b/fastly/model_logging_grafanacloudlogs_additional.go new file mode 100644 index 0000000..0460b20 --- /dev/null +++ b/fastly/model_logging_grafanacloudlogs_additional.go @@ -0,0 +1,307 @@ +// 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" +) + +// LoggingGrafanacloudlogsAdditional struct for LoggingGrafanacloudlogsAdditional +type LoggingGrafanacloudlogsAdditional struct { + // A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). + Format *string `json:"format,omitempty"` + // The Grafana Cloud Logs Dataset you want to log to. + User *string `json:"user,omitempty"` + // The URL of the Loki instance in your Grafana stack. + URL *string `json:"url,omitempty"` + // The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. + Token *string `json:"token,omitempty"` + // The Stream Labels, a JSON string used to identify the stream. + Index *string `json:"index,omitempty"` + AdditionalProperties map[string]any +} + +type _LoggingGrafanacloudlogsAdditional LoggingGrafanacloudlogsAdditional + +// NewLoggingGrafanacloudlogsAdditional instantiates a new LoggingGrafanacloudlogsAdditional 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 NewLoggingGrafanacloudlogsAdditional() *LoggingGrafanacloudlogsAdditional { + this := LoggingGrafanacloudlogsAdditional{} + return &this +} + +// NewLoggingGrafanacloudlogsAdditionalWithDefaults instantiates a new LoggingGrafanacloudlogsAdditional 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 NewLoggingGrafanacloudlogsAdditionalWithDefaults() *LoggingGrafanacloudlogsAdditional { + this := LoggingGrafanacloudlogsAdditional{} + return &this +} + +// GetFormat returns the Format field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsAdditional) GetFormat() string { + if o == nil || o.Format == nil { + var ret string + return ret + } + return *o.Format +} + +// GetFormatOk returns a tuple with the Format field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsAdditional) GetFormatOk() (*string, bool) { + if o == nil || o.Format == nil { + return nil, false + } + return o.Format, true +} + +// HasFormat returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsAdditional) HasFormat() bool { + if o != nil && o.Format != nil { + return true + } + + return false +} + +// SetFormat gets a reference to the given string and assigns it to the Format field. +func (o *LoggingGrafanacloudlogsAdditional) SetFormat(v string) { + o.Format = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsAdditional) GetUser() string { + if o == nil || o.User == nil { + var ret string + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsAdditional) GetUserOk() (*string, bool) { + if o == nil || o.User == nil { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsAdditional) HasUser() bool { + if o != nil && o.User != nil { + return true + } + + return false +} + +// SetUser gets a reference to the given string and assigns it to the User field. +func (o *LoggingGrafanacloudlogsAdditional) SetUser(v string) { + o.User = &v +} + +// GetURL returns the URL field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsAdditional) GetURL() string { + if o == nil || o.URL == nil { + var ret string + return ret + } + return *o.URL +} + +// GetURLOk returns a tuple with the URL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsAdditional) GetURLOk() (*string, bool) { + if o == nil || o.URL == nil { + return nil, false + } + return o.URL, true +} + +// HasURL returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsAdditional) HasURL() bool { + if o != nil && o.URL != nil { + return true + } + + return false +} + +// SetURL gets a reference to the given string and assigns it to the URL field. +func (o *LoggingGrafanacloudlogsAdditional) SetURL(v string) { + o.URL = &v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsAdditional) GetToken() string { + if o == nil || o.Token == nil { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsAdditional) GetTokenOk() (*string, bool) { + if o == nil || o.Token == nil { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsAdditional) HasToken() bool { + if o != nil && o.Token != nil { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *LoggingGrafanacloudlogsAdditional) SetToken(v string) { + o.Token = &v +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsAdditional) GetIndex() string { + if o == nil || o.Index == nil { + var ret string + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsAdditional) GetIndexOk() (*string, bool) { + if o == nil || o.Index == nil { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsAdditional) HasIndex() bool { + if o != nil && o.Index != nil { + return true + } + + return false +} + +// SetIndex gets a reference to the given string and assigns it to the Index field. +func (o *LoggingGrafanacloudlogsAdditional) SetIndex(v string) { + o.Index = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o LoggingGrafanacloudlogsAdditional) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Format != nil { + toSerialize["format"] = o.Format + } + if o.User != nil { + toSerialize["user"] = o.User + } + if o.URL != nil { + toSerialize["url"] = o.URL + } + if o.Token != nil { + toSerialize["token"] = o.Token + } + if o.Index != nil { + toSerialize["index"] = o.Index + } + + 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 *LoggingGrafanacloudlogsAdditional) UnmarshalJSON(bytes []byte) (err error) { + varLoggingGrafanacloudlogsAdditional := _LoggingGrafanacloudlogsAdditional{} + + if err = json.Unmarshal(bytes, &varLoggingGrafanacloudlogsAdditional); err == nil { + *o = LoggingGrafanacloudlogsAdditional(varLoggingGrafanacloudlogsAdditional) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "format") + delete(additionalProperties, "user") + delete(additionalProperties, "url") + delete(additionalProperties, "token") + delete(additionalProperties, "index") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableLoggingGrafanacloudlogsAdditional is a helper abstraction for handling nullable logginggrafanacloudlogsadditional types. +type NullableLoggingGrafanacloudlogsAdditional struct { + value *LoggingGrafanacloudlogsAdditional + isSet bool +} + +// Get returns the value. +func (v NullableLoggingGrafanacloudlogsAdditional) Get() *LoggingGrafanacloudlogsAdditional { + return v.value +} + +// Set modifies the value. +func (v *NullableLoggingGrafanacloudlogsAdditional) Set(val *LoggingGrafanacloudlogsAdditional) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableLoggingGrafanacloudlogsAdditional) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableLoggingGrafanacloudlogsAdditional) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLoggingGrafanacloudlogsAdditional returns a pointer to a new instance of NullableLoggingGrafanacloudlogsAdditional. +func NewNullableLoggingGrafanacloudlogsAdditional(val *LoggingGrafanacloudlogsAdditional) *NullableLoggingGrafanacloudlogsAdditional { + return &NullableLoggingGrafanacloudlogsAdditional{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 NullableLoggingGrafanacloudlogsAdditional) 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 *NullableLoggingGrafanacloudlogsAdditional) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_logging_grafanacloudlogs_response.go b/fastly/model_logging_grafanacloudlogs_response.go new file mode 100644 index 0000000..f7dec54 --- /dev/null +++ b/fastly/model_logging_grafanacloudlogs_response.go @@ -0,0 +1,707 @@ +// 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" + "time" +) + +// LoggingGrafanacloudlogsResponse struct for LoggingGrafanacloudlogsResponse +type LoggingGrafanacloudlogsResponse struct { + // The name for the real-time logging configuration. + Name *string `json:"name,omitempty"` + // Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. + Placement NullableString `json:"placement,omitempty"` + // The name of an existing condition in the configured endpoint, or leave blank to always execute. + ResponseCondition NullableString `json:"response_condition,omitempty"` + // A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). + Format *string `json:"format,omitempty"` + // The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. + FormatVersion *string `json:"format_version,omitempty"` + // The Grafana Cloud Logs Dataset you want to log to. + User *string `json:"user,omitempty"` + // The URL of the Loki instance in your Grafana stack. + URL *string `json:"url,omitempty"` + // The Grafana Access Policy token with `logs:write` access scoped to your Loki instance. + Token *string `json:"token,omitempty"` + // The Stream Labels, a JSON string used to identify the stream. + Index *string `json:"index,omitempty"` + // Date and time in ISO 8601 format. + CreatedAt NullableTime `json:"created_at,omitempty"` + // Date and time in ISO 8601 format. + DeletedAt NullableTime `json:"deleted_at,omitempty"` + // Date and time in ISO 8601 format. + UpdatedAt NullableTime `json:"updated_at,omitempty"` + ServiceID *string `json:"service_id,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]any +} + +type _LoggingGrafanacloudlogsResponse LoggingGrafanacloudlogsResponse + +// NewLoggingGrafanacloudlogsResponse instantiates a new LoggingGrafanacloudlogsResponse 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 NewLoggingGrafanacloudlogsResponse() *LoggingGrafanacloudlogsResponse { + this := LoggingGrafanacloudlogsResponse{} + var formatVersion string = "2" + this.FormatVersion = &formatVersion + return &this +} + +// NewLoggingGrafanacloudlogsResponseWithDefaults instantiates a new LoggingGrafanacloudlogsResponse 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 NewLoggingGrafanacloudlogsResponseWithDefaults() *LoggingGrafanacloudlogsResponse { + this := LoggingGrafanacloudlogsResponse{} + var formatVersion string = "2" + this.FormatVersion = &formatVersion + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) 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 *LoggingGrafanacloudlogsResponse) 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 *LoggingGrafanacloudlogsResponse) 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 *LoggingGrafanacloudlogsResponse) SetName(v string) { + o.Name = &v +} + +// GetPlacement returns the Placement field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LoggingGrafanacloudlogsResponse) GetPlacement() string { + if o == nil || o.Placement.Get() == nil { + var ret string + return ret + } + return *o.Placement.Get() +} + +// GetPlacementOk returns a tuple with the Placement 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 *LoggingGrafanacloudlogsResponse) GetPlacementOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Placement.Get(), o.Placement.IsSet() +} + +// HasPlacement returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasPlacement() bool { + if o != nil && o.Placement.IsSet() { + return true + } + + return false +} + +// SetPlacement gets a reference to the given NullableString and assigns it to the Placement field. +func (o *LoggingGrafanacloudlogsResponse) SetPlacement(v string) { + o.Placement.Set(&v) +} + +// SetPlacementNil sets the value for Placement to be an explicit nil +func (o *LoggingGrafanacloudlogsResponse) SetPlacementNil() { + o.Placement.Set(nil) +} + +// UnsetPlacement ensures that no value is present for Placement, not even an explicit nil +func (o *LoggingGrafanacloudlogsResponse) UnsetPlacement() { + o.Placement.Unset() +} + +// GetResponseCondition returns the ResponseCondition field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LoggingGrafanacloudlogsResponse) GetResponseCondition() string { + if o == nil || o.ResponseCondition.Get() == nil { + var ret string + return ret + } + return *o.ResponseCondition.Get() +} + +// GetResponseConditionOk returns a tuple with the ResponseCondition 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 *LoggingGrafanacloudlogsResponse) GetResponseConditionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ResponseCondition.Get(), o.ResponseCondition.IsSet() +} + +// HasResponseCondition returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasResponseCondition() bool { + if o != nil && o.ResponseCondition.IsSet() { + return true + } + + return false +} + +// SetResponseCondition gets a reference to the given NullableString and assigns it to the ResponseCondition field. +func (o *LoggingGrafanacloudlogsResponse) SetResponseCondition(v string) { + o.ResponseCondition.Set(&v) +} + +// SetResponseConditionNil sets the value for ResponseCondition to be an explicit nil +func (o *LoggingGrafanacloudlogsResponse) SetResponseConditionNil() { + o.ResponseCondition.Set(nil) +} + +// UnsetResponseCondition ensures that no value is present for ResponseCondition, not even an explicit nil +func (o *LoggingGrafanacloudlogsResponse) UnsetResponseCondition() { + o.ResponseCondition.Unset() +} + +// GetFormat returns the Format field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) GetFormat() string { + if o == nil || o.Format == nil { + var ret string + return ret + } + return *o.Format +} + +// GetFormatOk returns a tuple with the Format field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsResponse) GetFormatOk() (*string, bool) { + if o == nil || o.Format == nil { + return nil, false + } + return o.Format, true +} + +// HasFormat returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasFormat() bool { + if o != nil && o.Format != nil { + return true + } + + return false +} + +// SetFormat gets a reference to the given string and assigns it to the Format field. +func (o *LoggingGrafanacloudlogsResponse) SetFormat(v string) { + o.Format = &v +} + +// GetFormatVersion returns the FormatVersion field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) GetFormatVersion() string { + if o == nil || o.FormatVersion == nil { + var ret string + return ret + } + return *o.FormatVersion +} + +// GetFormatVersionOk returns a tuple with the FormatVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsResponse) GetFormatVersionOk() (*string, bool) { + if o == nil || o.FormatVersion == nil { + return nil, false + } + return o.FormatVersion, true +} + +// HasFormatVersion returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasFormatVersion() bool { + if o != nil && o.FormatVersion != nil { + return true + } + + return false +} + +// SetFormatVersion gets a reference to the given string and assigns it to the FormatVersion field. +func (o *LoggingGrafanacloudlogsResponse) SetFormatVersion(v string) { + o.FormatVersion = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) GetUser() string { + if o == nil || o.User == nil { + var ret string + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsResponse) GetUserOk() (*string, bool) { + if o == nil || o.User == nil { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasUser() bool { + if o != nil && o.User != nil { + return true + } + + return false +} + +// SetUser gets a reference to the given string and assigns it to the User field. +func (o *LoggingGrafanacloudlogsResponse) SetUser(v string) { + o.User = &v +} + +// GetURL returns the URL field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) GetURL() string { + if o == nil || o.URL == nil { + var ret string + return ret + } + return *o.URL +} + +// GetURLOk returns a tuple with the URL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsResponse) GetURLOk() (*string, bool) { + if o == nil || o.URL == nil { + return nil, false + } + return o.URL, true +} + +// HasURL returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasURL() bool { + if o != nil && o.URL != nil { + return true + } + + return false +} + +// SetURL gets a reference to the given string and assigns it to the URL field. +func (o *LoggingGrafanacloudlogsResponse) SetURL(v string) { + o.URL = &v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) GetToken() string { + if o == nil || o.Token == nil { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsResponse) GetTokenOk() (*string, bool) { + if o == nil || o.Token == nil { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasToken() bool { + if o != nil && o.Token != nil { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *LoggingGrafanacloudlogsResponse) SetToken(v string) { + o.Token = &v +} + +// GetIndex returns the Index field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) GetIndex() string { + if o == nil || o.Index == nil { + var ret string + return ret + } + return *o.Index +} + +// GetIndexOk returns a tuple with the Index field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsResponse) GetIndexOk() (*string, bool) { + if o == nil || o.Index == nil { + return nil, false + } + return o.Index, true +} + +// HasIndex returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasIndex() bool { + if o != nil && o.Index != nil { + return true + } + + return false +} + +// SetIndex gets a reference to the given string and assigns it to the Index field. +func (o *LoggingGrafanacloudlogsResponse) SetIndex(v string) { + o.Index = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LoggingGrafanacloudlogsResponse) GetCreatedAt() time.Time { + if o == nil || o.CreatedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.CreatedAt.Get() +} + +// GetCreatedAtOk returns a tuple with the CreatedAt 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 *LoggingGrafanacloudlogsResponse) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.CreatedAt.Get(), o.CreatedAt.IsSet() +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasCreatedAt() bool { + if o != nil && o.CreatedAt.IsSet() { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given NullableTime and assigns it to the CreatedAt field. +func (o *LoggingGrafanacloudlogsResponse) SetCreatedAt(v time.Time) { + o.CreatedAt.Set(&v) +} + +// SetCreatedAtNil sets the value for CreatedAt to be an explicit nil +func (o *LoggingGrafanacloudlogsResponse) SetCreatedAtNil() { + o.CreatedAt.Set(nil) +} + +// UnsetCreatedAt ensures that no value is present for CreatedAt, not even an explicit nil +func (o *LoggingGrafanacloudlogsResponse) UnsetCreatedAt() { + o.CreatedAt.Unset() +} + +// GetDeletedAt returns the DeletedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LoggingGrafanacloudlogsResponse) GetDeletedAt() time.Time { + if o == nil || o.DeletedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.DeletedAt.Get() +} + +// GetDeletedAtOk returns a tuple with the DeletedAt 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 *LoggingGrafanacloudlogsResponse) GetDeletedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.DeletedAt.Get(), o.DeletedAt.IsSet() +} + +// HasDeletedAt returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasDeletedAt() bool { + if o != nil && o.DeletedAt.IsSet() { + return true + } + + return false +} + +// SetDeletedAt gets a reference to the given NullableTime and assigns it to the DeletedAt field. +func (o *LoggingGrafanacloudlogsResponse) SetDeletedAt(v time.Time) { + o.DeletedAt.Set(&v) +} + +// SetDeletedAtNil sets the value for DeletedAt to be an explicit nil +func (o *LoggingGrafanacloudlogsResponse) SetDeletedAtNil() { + o.DeletedAt.Set(nil) +} + +// UnsetDeletedAt ensures that no value is present for DeletedAt, not even an explicit nil +func (o *LoggingGrafanacloudlogsResponse) UnsetDeletedAt() { + o.DeletedAt.Unset() +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LoggingGrafanacloudlogsResponse) GetUpdatedAt() time.Time { + if o == nil || o.UpdatedAt.Get() == nil { + var ret time.Time + return ret + } + return *o.UpdatedAt.Get() +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt 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 *LoggingGrafanacloudlogsResponse) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.UpdatedAt.Get(), o.UpdatedAt.IsSet() +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasUpdatedAt() bool { + if o != nil && o.UpdatedAt.IsSet() { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given NullableTime and assigns it to the UpdatedAt field. +func (o *LoggingGrafanacloudlogsResponse) SetUpdatedAt(v time.Time) { + o.UpdatedAt.Set(&v) +} + +// SetUpdatedAtNil sets the value for UpdatedAt to be an explicit nil +func (o *LoggingGrafanacloudlogsResponse) SetUpdatedAtNil() { + o.UpdatedAt.Set(nil) +} + +// UnsetUpdatedAt ensures that no value is present for UpdatedAt, not even an explicit nil +func (o *LoggingGrafanacloudlogsResponse) UnsetUpdatedAt() { + o.UpdatedAt.Unset() +} + +// GetServiceID returns the ServiceID field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) 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 *LoggingGrafanacloudlogsResponse) 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 *LoggingGrafanacloudlogsResponse) 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 *LoggingGrafanacloudlogsResponse) SetServiceID(v string) { + o.ServiceID = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *LoggingGrafanacloudlogsResponse) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoggingGrafanacloudlogsResponse) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *LoggingGrafanacloudlogsResponse) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *LoggingGrafanacloudlogsResponse) SetVersion(v string) { + o.Version = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o LoggingGrafanacloudlogsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Placement.IsSet() { + toSerialize["placement"] = o.Placement.Get() + } + if o.ResponseCondition.IsSet() { + toSerialize["response_condition"] = o.ResponseCondition.Get() + } + if o.Format != nil { + toSerialize["format"] = o.Format + } + if o.FormatVersion != nil { + toSerialize["format_version"] = o.FormatVersion + } + if o.User != nil { + toSerialize["user"] = o.User + } + if o.URL != nil { + toSerialize["url"] = o.URL + } + if o.Token != nil { + toSerialize["token"] = o.Token + } + if o.Index != nil { + toSerialize["index"] = o.Index + } + if o.CreatedAt.IsSet() { + toSerialize["created_at"] = o.CreatedAt.Get() + } + if o.DeletedAt.IsSet() { + toSerialize["deleted_at"] = o.DeletedAt.Get() + } + if o.UpdatedAt.IsSet() { + toSerialize["updated_at"] = o.UpdatedAt.Get() + } + if o.ServiceID != nil { + toSerialize["service_id"] = o.ServiceID + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + + 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 *LoggingGrafanacloudlogsResponse) UnmarshalJSON(bytes []byte) (err error) { + varLoggingGrafanacloudlogsResponse := _LoggingGrafanacloudlogsResponse{} + + if err = json.Unmarshal(bytes, &varLoggingGrafanacloudlogsResponse); err == nil { + *o = LoggingGrafanacloudlogsResponse(varLoggingGrafanacloudlogsResponse) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "placement") + delete(additionalProperties, "response_condition") + delete(additionalProperties, "format") + delete(additionalProperties, "format_version") + delete(additionalProperties, "user") + delete(additionalProperties, "url") + delete(additionalProperties, "token") + delete(additionalProperties, "index") + delete(additionalProperties, "created_at") + delete(additionalProperties, "deleted_at") + delete(additionalProperties, "updated_at") + delete(additionalProperties, "service_id") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableLoggingGrafanacloudlogsResponse is a helper abstraction for handling nullable logginggrafanacloudlogsresponse types. +type NullableLoggingGrafanacloudlogsResponse struct { + value *LoggingGrafanacloudlogsResponse + isSet bool +} + +// Get returns the value. +func (v NullableLoggingGrafanacloudlogsResponse) Get() *LoggingGrafanacloudlogsResponse { + return v.value +} + +// Set modifies the value. +func (v *NullableLoggingGrafanacloudlogsResponse) Set(val *LoggingGrafanacloudlogsResponse) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableLoggingGrafanacloudlogsResponse) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableLoggingGrafanacloudlogsResponse) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableLoggingGrafanacloudlogsResponse returns a pointer to a new instance of NullableLoggingGrafanacloudlogsResponse. +func NewNullableLoggingGrafanacloudlogsResponse(val *LoggingGrafanacloudlogsResponse) *NullableLoggingGrafanacloudlogsResponse { + return &NullableLoggingGrafanacloudlogsResponse{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 NullableLoggingGrafanacloudlogsResponse) 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 *NullableLoggingGrafanacloudlogsResponse) 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 6c1f3b2..66e594b 100644 --- a/fastly/model_realtime_entry_aggregated.go +++ b/fastly/model_realtime_entry_aggregated.go @@ -478,20 +478,6 @@ type RealtimeEntryAggregated struct { DdosActionDowngrade *int32 `json:"ddos_action_downgrade,omitempty"` // The number of connections the downgrade action was applied to. The downgrade action restricts the connection to http1. DdosActionDowngradedConnections *int32 `json:"ddos_action_downgraded_connections,omitempty"` - // Number of cache hits for a VCL service running on Compute. - VclOnComputeHitRequests *int32 `json:"vcl_on_compute_hit_requests,omitempty"` - // Number of cache misses for a VCL service running on Compute. - VclOnComputeMissRequests *int32 `json:"vcl_on_compute_miss_requests,omitempty"` - // Number of requests that passed through the CDN without being cached for a VCL service running on Compute. - VclOnComputePassRequests *int32 `json:"vcl_on_compute_pass_requests,omitempty"` - // Number of cache errors for a VCL service running on Compute. - VclOnComputeErrorRequests *int32 `json:"vcl_on_compute_error_requests,omitempty"` - // Number of requests that returned a synthetic response (i.e., response objects created with the `synthetic` VCL statement) for a VCL service running on Compute. - VclOnComputeSynthRequests *int32 `json:"vcl_on_compute_synth_requests,omitempty"` - // Number of requests sent by end users to Fastly that resulted in a hit at the edge for a VCL service running on Compute. - VclOnComputeEdgeHitRequests *int32 `json:"vcl_on_compute_edge_hit_requests,omitempty"` - // Number of requests sent by end users to Fastly that resulted in a miss at the edge for a VCL service running on Compute. - VclOnComputeEdgeMissRequests *int32 `json:"vcl_on_compute_edge_miss_requests,omitempty"` // Number of cache hits for a VCL service. AllHitRequests *int32 `json:"all_hit_requests,omitempty"` // Number of cache misses for a VCL service. @@ -520,7 +506,13 @@ type RealtimeEntryAggregated struct { 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 + // Number of requests classified as a DDoS attack against a customer origin or service. + ServiceDdosRequestsDetected *int32 `json:"service_ddos_requests_detected,omitempty"` + // Number of requests classified as a DDoS attack against a customer origin or service that were mitigated by the Fastly platform. + ServiceDdosRequestsMitigated *int32 `json:"service_ddos_requests_mitigated,omitempty"` + // Number of requests analyzed for DDoS attacks against a customer origin or service, but with no DDoS detected. + ServiceDdosRequestsAllowed *int32 `json:"service_ddos_requests_allowed,omitempty"` + AdditionalProperties map[string]any } type _RealtimeEntryAggregated RealtimeEntryAggregated @@ -7876,230 +7868,6 @@ func (o *RealtimeEntryAggregated) SetDdosActionDowngradedConnections(v int32) { o.DdosActionDowngradedConnections = &v } -// GetVclOnComputeHitRequests returns the VclOnComputeHitRequests field value if set, zero value otherwise. -func (o *RealtimeEntryAggregated) GetVclOnComputeHitRequests() int32 { - if o == nil || o.VclOnComputeHitRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeHitRequests -} - -// GetVclOnComputeHitRequestsOk returns a tuple with the VclOnComputeHitRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeEntryAggregated) GetVclOnComputeHitRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeHitRequests == nil { - return nil, false - } - return o.VclOnComputeHitRequests, true -} - -// HasVclOnComputeHitRequests returns a boolean if a field has been set. -func (o *RealtimeEntryAggregated) HasVclOnComputeHitRequests() bool { - if o != nil && o.VclOnComputeHitRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeHitRequests gets a reference to the given int32 and assigns it to the VclOnComputeHitRequests field. -func (o *RealtimeEntryAggregated) SetVclOnComputeHitRequests(v int32) { - o.VclOnComputeHitRequests = &v -} - -// GetVclOnComputeMissRequests returns the VclOnComputeMissRequests field value if set, zero value otherwise. -func (o *RealtimeEntryAggregated) GetVclOnComputeMissRequests() int32 { - if o == nil || o.VclOnComputeMissRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeMissRequests -} - -// GetVclOnComputeMissRequestsOk returns a tuple with the VclOnComputeMissRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeEntryAggregated) GetVclOnComputeMissRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeMissRequests == nil { - return nil, false - } - return o.VclOnComputeMissRequests, true -} - -// HasVclOnComputeMissRequests returns a boolean if a field has been set. -func (o *RealtimeEntryAggregated) HasVclOnComputeMissRequests() bool { - if o != nil && o.VclOnComputeMissRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeMissRequests gets a reference to the given int32 and assigns it to the VclOnComputeMissRequests field. -func (o *RealtimeEntryAggregated) SetVclOnComputeMissRequests(v int32) { - o.VclOnComputeMissRequests = &v -} - -// GetVclOnComputePassRequests returns the VclOnComputePassRequests field value if set, zero value otherwise. -func (o *RealtimeEntryAggregated) GetVclOnComputePassRequests() int32 { - if o == nil || o.VclOnComputePassRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputePassRequests -} - -// GetVclOnComputePassRequestsOk returns a tuple with the VclOnComputePassRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeEntryAggregated) GetVclOnComputePassRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputePassRequests == nil { - return nil, false - } - return o.VclOnComputePassRequests, true -} - -// HasVclOnComputePassRequests returns a boolean if a field has been set. -func (o *RealtimeEntryAggregated) HasVclOnComputePassRequests() bool { - if o != nil && o.VclOnComputePassRequests != nil { - return true - } - - return false -} - -// SetVclOnComputePassRequests gets a reference to the given int32 and assigns it to the VclOnComputePassRequests field. -func (o *RealtimeEntryAggregated) SetVclOnComputePassRequests(v int32) { - o.VclOnComputePassRequests = &v -} - -// GetVclOnComputeErrorRequests returns the VclOnComputeErrorRequests field value if set, zero value otherwise. -func (o *RealtimeEntryAggregated) GetVclOnComputeErrorRequests() int32 { - if o == nil || o.VclOnComputeErrorRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeErrorRequests -} - -// GetVclOnComputeErrorRequestsOk returns a tuple with the VclOnComputeErrorRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeEntryAggregated) GetVclOnComputeErrorRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeErrorRequests == nil { - return nil, false - } - return o.VclOnComputeErrorRequests, true -} - -// HasVclOnComputeErrorRequests returns a boolean if a field has been set. -func (o *RealtimeEntryAggregated) HasVclOnComputeErrorRequests() bool { - if o != nil && o.VclOnComputeErrorRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeErrorRequests gets a reference to the given int32 and assigns it to the VclOnComputeErrorRequests field. -func (o *RealtimeEntryAggregated) SetVclOnComputeErrorRequests(v int32) { - o.VclOnComputeErrorRequests = &v -} - -// GetVclOnComputeSynthRequests returns the VclOnComputeSynthRequests field value if set, zero value otherwise. -func (o *RealtimeEntryAggregated) GetVclOnComputeSynthRequests() int32 { - if o == nil || o.VclOnComputeSynthRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeSynthRequests -} - -// GetVclOnComputeSynthRequestsOk returns a tuple with the VclOnComputeSynthRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeEntryAggregated) GetVclOnComputeSynthRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeSynthRequests == nil { - return nil, false - } - return o.VclOnComputeSynthRequests, true -} - -// HasVclOnComputeSynthRequests returns a boolean if a field has been set. -func (o *RealtimeEntryAggregated) HasVclOnComputeSynthRequests() bool { - if o != nil && o.VclOnComputeSynthRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeSynthRequests gets a reference to the given int32 and assigns it to the VclOnComputeSynthRequests field. -func (o *RealtimeEntryAggregated) SetVclOnComputeSynthRequests(v int32) { - o.VclOnComputeSynthRequests = &v -} - -// GetVclOnComputeEdgeHitRequests returns the VclOnComputeEdgeHitRequests field value if set, zero value otherwise. -func (o *RealtimeEntryAggregated) GetVclOnComputeEdgeHitRequests() int32 { - if o == nil || o.VclOnComputeEdgeHitRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeEdgeHitRequests -} - -// GetVclOnComputeEdgeHitRequestsOk returns a tuple with the VclOnComputeEdgeHitRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeEntryAggregated) GetVclOnComputeEdgeHitRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeEdgeHitRequests == nil { - return nil, false - } - return o.VclOnComputeEdgeHitRequests, true -} - -// HasVclOnComputeEdgeHitRequests returns a boolean if a field has been set. -func (o *RealtimeEntryAggregated) HasVclOnComputeEdgeHitRequests() bool { - if o != nil && o.VclOnComputeEdgeHitRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeEdgeHitRequests gets a reference to the given int32 and assigns it to the VclOnComputeEdgeHitRequests field. -func (o *RealtimeEntryAggregated) SetVclOnComputeEdgeHitRequests(v int32) { - o.VclOnComputeEdgeHitRequests = &v -} - -// GetVclOnComputeEdgeMissRequests returns the VclOnComputeEdgeMissRequests field value if set, zero value otherwise. -func (o *RealtimeEntryAggregated) GetVclOnComputeEdgeMissRequests() int32 { - if o == nil || o.VclOnComputeEdgeMissRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeEdgeMissRequests -} - -// GetVclOnComputeEdgeMissRequestsOk returns a tuple with the VclOnComputeEdgeMissRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeEntryAggregated) GetVclOnComputeEdgeMissRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeEdgeMissRequests == nil { - return nil, false - } - return o.VclOnComputeEdgeMissRequests, true -} - -// HasVclOnComputeEdgeMissRequests returns a boolean if a field has been set. -func (o *RealtimeEntryAggregated) HasVclOnComputeEdgeMissRequests() bool { - if o != nil && o.VclOnComputeEdgeMissRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeEdgeMissRequests gets a reference to the given int32 and assigns it to the VclOnComputeEdgeMissRequests field. -func (o *RealtimeEntryAggregated) SetVclOnComputeEdgeMissRequests(v int32) { - o.VclOnComputeEdgeMissRequests = &v -} - // GetAllHitRequests returns the AllHitRequests field value if set, zero value otherwise. func (o *RealtimeEntryAggregated) GetAllHitRequests() int32 { if o == nil || o.AllHitRequests == nil { @@ -8548,6 +8316,102 @@ func (o *RealtimeEntryAggregated) SetRequestDeniedGetHeadBody(v int32) { o.RequestDeniedGetHeadBody = &v } +// GetServiceDdosRequestsDetected returns the ServiceDdosRequestsDetected field value if set, zero value otherwise. +func (o *RealtimeEntryAggregated) GetServiceDdosRequestsDetected() int32 { + if o == nil || o.ServiceDdosRequestsDetected == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsDetected +} + +// GetServiceDdosRequestsDetectedOk returns a tuple with the ServiceDdosRequestsDetected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RealtimeEntryAggregated) GetServiceDdosRequestsDetectedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsDetected == nil { + return nil, false + } + return o.ServiceDdosRequestsDetected, true +} + +// HasServiceDdosRequestsDetected returns a boolean if a field has been set. +func (o *RealtimeEntryAggregated) HasServiceDdosRequestsDetected() bool { + if o != nil && o.ServiceDdosRequestsDetected != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsDetected gets a reference to the given int32 and assigns it to the ServiceDdosRequestsDetected field. +func (o *RealtimeEntryAggregated) SetServiceDdosRequestsDetected(v int32) { + o.ServiceDdosRequestsDetected = &v +} + +// GetServiceDdosRequestsMitigated returns the ServiceDdosRequestsMitigated field value if set, zero value otherwise. +func (o *RealtimeEntryAggregated) GetServiceDdosRequestsMitigated() int32 { + if o == nil || o.ServiceDdosRequestsMitigated == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsMitigated +} + +// GetServiceDdosRequestsMitigatedOk returns a tuple with the ServiceDdosRequestsMitigated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RealtimeEntryAggregated) GetServiceDdosRequestsMitigatedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsMitigated == nil { + return nil, false + } + return o.ServiceDdosRequestsMitigated, true +} + +// HasServiceDdosRequestsMitigated returns a boolean if a field has been set. +func (o *RealtimeEntryAggregated) HasServiceDdosRequestsMitigated() bool { + if o != nil && o.ServiceDdosRequestsMitigated != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsMitigated gets a reference to the given int32 and assigns it to the ServiceDdosRequestsMitigated field. +func (o *RealtimeEntryAggregated) SetServiceDdosRequestsMitigated(v int32) { + o.ServiceDdosRequestsMitigated = &v +} + +// GetServiceDdosRequestsAllowed returns the ServiceDdosRequestsAllowed field value if set, zero value otherwise. +func (o *RealtimeEntryAggregated) GetServiceDdosRequestsAllowed() int32 { + if o == nil || o.ServiceDdosRequestsAllowed == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsAllowed +} + +// GetServiceDdosRequestsAllowedOk returns a tuple with the ServiceDdosRequestsAllowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RealtimeEntryAggregated) GetServiceDdosRequestsAllowedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsAllowed == nil { + return nil, false + } + return o.ServiceDdosRequestsAllowed, true +} + +// HasServiceDdosRequestsAllowed returns a boolean if a field has been set. +func (o *RealtimeEntryAggregated) HasServiceDdosRequestsAllowed() bool { + if o != nil && o.ServiceDdosRequestsAllowed != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsAllowed gets a reference to the given int32 and assigns it to the ServiceDdosRequestsAllowed field. +func (o *RealtimeEntryAggregated) SetServiceDdosRequestsAllowed(v int32) { + o.ServiceDdosRequestsAllowed = &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) { @@ -9239,27 +9103,6 @@ func (o RealtimeEntryAggregated) MarshalJSON() ([]byte, error) { if o.DdosActionDowngradedConnections != nil { toSerialize["ddos_action_downgraded_connections"] = o.DdosActionDowngradedConnections } - if o.VclOnComputeHitRequests != nil { - toSerialize["vcl_on_compute_hit_requests"] = o.VclOnComputeHitRequests - } - if o.VclOnComputeMissRequests != nil { - toSerialize["vcl_on_compute_miss_requests"] = o.VclOnComputeMissRequests - } - if o.VclOnComputePassRequests != nil { - toSerialize["vcl_on_compute_pass_requests"] = o.VclOnComputePassRequests - } - if o.VclOnComputeErrorRequests != nil { - toSerialize["vcl_on_compute_error_requests"] = o.VclOnComputeErrorRequests - } - if o.VclOnComputeSynthRequests != nil { - toSerialize["vcl_on_compute_synth_requests"] = o.VclOnComputeSynthRequests - } - if o.VclOnComputeEdgeHitRequests != nil { - toSerialize["vcl_on_compute_edge_hit_requests"] = o.VclOnComputeEdgeHitRequests - } - if o.VclOnComputeEdgeMissRequests != nil { - toSerialize["vcl_on_compute_edge_miss_requests"] = o.VclOnComputeEdgeMissRequests - } if o.AllHitRequests != nil { toSerialize["all_hit_requests"] = o.AllHitRequests } @@ -9302,6 +9145,15 @@ func (o RealtimeEntryAggregated) MarshalJSON() ([]byte, error) { if o.RequestDeniedGetHeadBody != nil { toSerialize["request_denied_get_head_body"] = o.RequestDeniedGetHeadBody } + if o.ServiceDdosRequestsDetected != nil { + toSerialize["service_ddos_requests_detected"] = o.ServiceDdosRequestsDetected + } + if o.ServiceDdosRequestsMitigated != nil { + toSerialize["service_ddos_requests_mitigated"] = o.ServiceDdosRequestsMitigated + } + if o.ServiceDdosRequestsAllowed != nil { + toSerialize["service_ddos_requests_allowed"] = o.ServiceDdosRequestsAllowed + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -9551,13 +9403,6 @@ func (o *RealtimeEntryAggregated) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "bot_challenge_complete_tokens_issued") delete(additionalProperties, "ddos_action_downgrade") delete(additionalProperties, "ddos_action_downgraded_connections") - delete(additionalProperties, "vcl_on_compute_hit_requests") - delete(additionalProperties, "vcl_on_compute_miss_requests") - delete(additionalProperties, "vcl_on_compute_pass_requests") - delete(additionalProperties, "vcl_on_compute_error_requests") - delete(additionalProperties, "vcl_on_compute_synth_requests") - delete(additionalProperties, "vcl_on_compute_edge_hit_requests") - delete(additionalProperties, "vcl_on_compute_edge_miss_requests") delete(additionalProperties, "all_hit_requests") delete(additionalProperties, "all_miss_requests") delete(additionalProperties, "all_pass_requests") @@ -9572,6 +9417,9 @@ func (o *RealtimeEntryAggregated) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "all_status_5xx") delete(additionalProperties, "origin_offload") delete(additionalProperties, "request_denied_get_head_body") + delete(additionalProperties, "service_ddos_requests_detected") + delete(additionalProperties, "service_ddos_requests_mitigated") + delete(additionalProperties, "service_ddos_requests_allowed") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_realtime_measurements.go b/fastly/model_realtime_measurements.go index a351491..8cf3837 100644 --- a/fastly/model_realtime_measurements.go +++ b/fastly/model_realtime_measurements.go @@ -478,20 +478,6 @@ type RealtimeMeasurements struct { DdosActionDowngrade *int32 `json:"ddos_action_downgrade,omitempty"` // The number of connections the downgrade action was applied to. The downgrade action restricts the connection to http1. DdosActionDowngradedConnections *int32 `json:"ddos_action_downgraded_connections,omitempty"` - // Number of cache hits for a VCL service running on Compute. - VclOnComputeHitRequests *int32 `json:"vcl_on_compute_hit_requests,omitempty"` - // Number of cache misses for a VCL service running on Compute. - VclOnComputeMissRequests *int32 `json:"vcl_on_compute_miss_requests,omitempty"` - // Number of requests that passed through the CDN without being cached for a VCL service running on Compute. - VclOnComputePassRequests *int32 `json:"vcl_on_compute_pass_requests,omitempty"` - // Number of cache errors for a VCL service running on Compute. - VclOnComputeErrorRequests *int32 `json:"vcl_on_compute_error_requests,omitempty"` - // Number of requests that returned a synthetic response (i.e., response objects created with the `synthetic` VCL statement) for a VCL service running on Compute. - VclOnComputeSynthRequests *int32 `json:"vcl_on_compute_synth_requests,omitempty"` - // Number of requests sent by end users to Fastly that resulted in a hit at the edge for a VCL service running on Compute. - VclOnComputeEdgeHitRequests *int32 `json:"vcl_on_compute_edge_hit_requests,omitempty"` - // Number of requests sent by end users to Fastly that resulted in a miss at the edge for a VCL service running on Compute. - VclOnComputeEdgeMissRequests *int32 `json:"vcl_on_compute_edge_miss_requests,omitempty"` // Number of cache hits for a VCL service. AllHitRequests *int32 `json:"all_hit_requests,omitempty"` // Number of cache misses for a VCL service. @@ -520,7 +506,13 @@ type RealtimeMeasurements struct { 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 + // Number of requests classified as a DDoS attack against a customer origin or service. + ServiceDdosRequestsDetected *int32 `json:"service_ddos_requests_detected,omitempty"` + // Number of requests classified as a DDoS attack against a customer origin or service that were mitigated by the Fastly platform. + ServiceDdosRequestsMitigated *int32 `json:"service_ddos_requests_mitigated,omitempty"` + // Number of requests analyzed for DDoS attacks against a customer origin or service, but with no DDoS detected. + ServiceDdosRequestsAllowed *int32 `json:"service_ddos_requests_allowed,omitempty"` + AdditionalProperties map[string]any } type _RealtimeMeasurements RealtimeMeasurements @@ -7876,230 +7868,6 @@ func (o *RealtimeMeasurements) SetDdosActionDowngradedConnections(v int32) { o.DdosActionDowngradedConnections = &v } -// GetVclOnComputeHitRequests returns the VclOnComputeHitRequests field value if set, zero value otherwise. -func (o *RealtimeMeasurements) GetVclOnComputeHitRequests() int32 { - if o == nil || o.VclOnComputeHitRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeHitRequests -} - -// GetVclOnComputeHitRequestsOk returns a tuple with the VclOnComputeHitRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeMeasurements) GetVclOnComputeHitRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeHitRequests == nil { - return nil, false - } - return o.VclOnComputeHitRequests, true -} - -// HasVclOnComputeHitRequests returns a boolean if a field has been set. -func (o *RealtimeMeasurements) HasVclOnComputeHitRequests() bool { - if o != nil && o.VclOnComputeHitRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeHitRequests gets a reference to the given int32 and assigns it to the VclOnComputeHitRequests field. -func (o *RealtimeMeasurements) SetVclOnComputeHitRequests(v int32) { - o.VclOnComputeHitRequests = &v -} - -// GetVclOnComputeMissRequests returns the VclOnComputeMissRequests field value if set, zero value otherwise. -func (o *RealtimeMeasurements) GetVclOnComputeMissRequests() int32 { - if o == nil || o.VclOnComputeMissRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeMissRequests -} - -// GetVclOnComputeMissRequestsOk returns a tuple with the VclOnComputeMissRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeMeasurements) GetVclOnComputeMissRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeMissRequests == nil { - return nil, false - } - return o.VclOnComputeMissRequests, true -} - -// HasVclOnComputeMissRequests returns a boolean if a field has been set. -func (o *RealtimeMeasurements) HasVclOnComputeMissRequests() bool { - if o != nil && o.VclOnComputeMissRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeMissRequests gets a reference to the given int32 and assigns it to the VclOnComputeMissRequests field. -func (o *RealtimeMeasurements) SetVclOnComputeMissRequests(v int32) { - o.VclOnComputeMissRequests = &v -} - -// GetVclOnComputePassRequests returns the VclOnComputePassRequests field value if set, zero value otherwise. -func (o *RealtimeMeasurements) GetVclOnComputePassRequests() int32 { - if o == nil || o.VclOnComputePassRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputePassRequests -} - -// GetVclOnComputePassRequestsOk returns a tuple with the VclOnComputePassRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeMeasurements) GetVclOnComputePassRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputePassRequests == nil { - return nil, false - } - return o.VclOnComputePassRequests, true -} - -// HasVclOnComputePassRequests returns a boolean if a field has been set. -func (o *RealtimeMeasurements) HasVclOnComputePassRequests() bool { - if o != nil && o.VclOnComputePassRequests != nil { - return true - } - - return false -} - -// SetVclOnComputePassRequests gets a reference to the given int32 and assigns it to the VclOnComputePassRequests field. -func (o *RealtimeMeasurements) SetVclOnComputePassRequests(v int32) { - o.VclOnComputePassRequests = &v -} - -// GetVclOnComputeErrorRequests returns the VclOnComputeErrorRequests field value if set, zero value otherwise. -func (o *RealtimeMeasurements) GetVclOnComputeErrorRequests() int32 { - if o == nil || o.VclOnComputeErrorRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeErrorRequests -} - -// GetVclOnComputeErrorRequestsOk returns a tuple with the VclOnComputeErrorRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeMeasurements) GetVclOnComputeErrorRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeErrorRequests == nil { - return nil, false - } - return o.VclOnComputeErrorRequests, true -} - -// HasVclOnComputeErrorRequests returns a boolean if a field has been set. -func (o *RealtimeMeasurements) HasVclOnComputeErrorRequests() bool { - if o != nil && o.VclOnComputeErrorRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeErrorRequests gets a reference to the given int32 and assigns it to the VclOnComputeErrorRequests field. -func (o *RealtimeMeasurements) SetVclOnComputeErrorRequests(v int32) { - o.VclOnComputeErrorRequests = &v -} - -// GetVclOnComputeSynthRequests returns the VclOnComputeSynthRequests field value if set, zero value otherwise. -func (o *RealtimeMeasurements) GetVclOnComputeSynthRequests() int32 { - if o == nil || o.VclOnComputeSynthRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeSynthRequests -} - -// GetVclOnComputeSynthRequestsOk returns a tuple with the VclOnComputeSynthRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeMeasurements) GetVclOnComputeSynthRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeSynthRequests == nil { - return nil, false - } - return o.VclOnComputeSynthRequests, true -} - -// HasVclOnComputeSynthRequests returns a boolean if a field has been set. -func (o *RealtimeMeasurements) HasVclOnComputeSynthRequests() bool { - if o != nil && o.VclOnComputeSynthRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeSynthRequests gets a reference to the given int32 and assigns it to the VclOnComputeSynthRequests field. -func (o *RealtimeMeasurements) SetVclOnComputeSynthRequests(v int32) { - o.VclOnComputeSynthRequests = &v -} - -// GetVclOnComputeEdgeHitRequests returns the VclOnComputeEdgeHitRequests field value if set, zero value otherwise. -func (o *RealtimeMeasurements) GetVclOnComputeEdgeHitRequests() int32 { - if o == nil || o.VclOnComputeEdgeHitRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeEdgeHitRequests -} - -// GetVclOnComputeEdgeHitRequestsOk returns a tuple with the VclOnComputeEdgeHitRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeMeasurements) GetVclOnComputeEdgeHitRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeEdgeHitRequests == nil { - return nil, false - } - return o.VclOnComputeEdgeHitRequests, true -} - -// HasVclOnComputeEdgeHitRequests returns a boolean if a field has been set. -func (o *RealtimeMeasurements) HasVclOnComputeEdgeHitRequests() bool { - if o != nil && o.VclOnComputeEdgeHitRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeEdgeHitRequests gets a reference to the given int32 and assigns it to the VclOnComputeEdgeHitRequests field. -func (o *RealtimeMeasurements) SetVclOnComputeEdgeHitRequests(v int32) { - o.VclOnComputeEdgeHitRequests = &v -} - -// GetVclOnComputeEdgeMissRequests returns the VclOnComputeEdgeMissRequests field value if set, zero value otherwise. -func (o *RealtimeMeasurements) GetVclOnComputeEdgeMissRequests() int32 { - if o == nil || o.VclOnComputeEdgeMissRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeEdgeMissRequests -} - -// GetVclOnComputeEdgeMissRequestsOk returns a tuple with the VclOnComputeEdgeMissRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RealtimeMeasurements) GetVclOnComputeEdgeMissRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeEdgeMissRequests == nil { - return nil, false - } - return o.VclOnComputeEdgeMissRequests, true -} - -// HasVclOnComputeEdgeMissRequests returns a boolean if a field has been set. -func (o *RealtimeMeasurements) HasVclOnComputeEdgeMissRequests() bool { - if o != nil && o.VclOnComputeEdgeMissRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeEdgeMissRequests gets a reference to the given int32 and assigns it to the VclOnComputeEdgeMissRequests field. -func (o *RealtimeMeasurements) SetVclOnComputeEdgeMissRequests(v int32) { - o.VclOnComputeEdgeMissRequests = &v -} - // GetAllHitRequests returns the AllHitRequests field value if set, zero value otherwise. func (o *RealtimeMeasurements) GetAllHitRequests() int32 { if o == nil || o.AllHitRequests == nil { @@ -8548,6 +8316,102 @@ func (o *RealtimeMeasurements) SetRequestDeniedGetHeadBody(v int32) { o.RequestDeniedGetHeadBody = &v } +// GetServiceDdosRequestsDetected returns the ServiceDdosRequestsDetected field value if set, zero value otherwise. +func (o *RealtimeMeasurements) GetServiceDdosRequestsDetected() int32 { + if o == nil || o.ServiceDdosRequestsDetected == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsDetected +} + +// GetServiceDdosRequestsDetectedOk returns a tuple with the ServiceDdosRequestsDetected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RealtimeMeasurements) GetServiceDdosRequestsDetectedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsDetected == nil { + return nil, false + } + return o.ServiceDdosRequestsDetected, true +} + +// HasServiceDdosRequestsDetected returns a boolean if a field has been set. +func (o *RealtimeMeasurements) HasServiceDdosRequestsDetected() bool { + if o != nil && o.ServiceDdosRequestsDetected != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsDetected gets a reference to the given int32 and assigns it to the ServiceDdosRequestsDetected field. +func (o *RealtimeMeasurements) SetServiceDdosRequestsDetected(v int32) { + o.ServiceDdosRequestsDetected = &v +} + +// GetServiceDdosRequestsMitigated returns the ServiceDdosRequestsMitigated field value if set, zero value otherwise. +func (o *RealtimeMeasurements) GetServiceDdosRequestsMitigated() int32 { + if o == nil || o.ServiceDdosRequestsMitigated == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsMitigated +} + +// GetServiceDdosRequestsMitigatedOk returns a tuple with the ServiceDdosRequestsMitigated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RealtimeMeasurements) GetServiceDdosRequestsMitigatedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsMitigated == nil { + return nil, false + } + return o.ServiceDdosRequestsMitigated, true +} + +// HasServiceDdosRequestsMitigated returns a boolean if a field has been set. +func (o *RealtimeMeasurements) HasServiceDdosRequestsMitigated() bool { + if o != nil && o.ServiceDdosRequestsMitigated != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsMitigated gets a reference to the given int32 and assigns it to the ServiceDdosRequestsMitigated field. +func (o *RealtimeMeasurements) SetServiceDdosRequestsMitigated(v int32) { + o.ServiceDdosRequestsMitigated = &v +} + +// GetServiceDdosRequestsAllowed returns the ServiceDdosRequestsAllowed field value if set, zero value otherwise. +func (o *RealtimeMeasurements) GetServiceDdosRequestsAllowed() int32 { + if o == nil || o.ServiceDdosRequestsAllowed == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsAllowed +} + +// GetServiceDdosRequestsAllowedOk returns a tuple with the ServiceDdosRequestsAllowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RealtimeMeasurements) GetServiceDdosRequestsAllowedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsAllowed == nil { + return nil, false + } + return o.ServiceDdosRequestsAllowed, true +} + +// HasServiceDdosRequestsAllowed returns a boolean if a field has been set. +func (o *RealtimeMeasurements) HasServiceDdosRequestsAllowed() bool { + if o != nil && o.ServiceDdosRequestsAllowed != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsAllowed gets a reference to the given int32 and assigns it to the ServiceDdosRequestsAllowed field. +func (o *RealtimeMeasurements) SetServiceDdosRequestsAllowed(v int32) { + o.ServiceDdosRequestsAllowed = &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) { @@ -9239,27 +9103,6 @@ func (o RealtimeMeasurements) MarshalJSON() ([]byte, error) { if o.DdosActionDowngradedConnections != nil { toSerialize["ddos_action_downgraded_connections"] = o.DdosActionDowngradedConnections } - if o.VclOnComputeHitRequests != nil { - toSerialize["vcl_on_compute_hit_requests"] = o.VclOnComputeHitRequests - } - if o.VclOnComputeMissRequests != nil { - toSerialize["vcl_on_compute_miss_requests"] = o.VclOnComputeMissRequests - } - if o.VclOnComputePassRequests != nil { - toSerialize["vcl_on_compute_pass_requests"] = o.VclOnComputePassRequests - } - if o.VclOnComputeErrorRequests != nil { - toSerialize["vcl_on_compute_error_requests"] = o.VclOnComputeErrorRequests - } - if o.VclOnComputeSynthRequests != nil { - toSerialize["vcl_on_compute_synth_requests"] = o.VclOnComputeSynthRequests - } - if o.VclOnComputeEdgeHitRequests != nil { - toSerialize["vcl_on_compute_edge_hit_requests"] = o.VclOnComputeEdgeHitRequests - } - if o.VclOnComputeEdgeMissRequests != nil { - toSerialize["vcl_on_compute_edge_miss_requests"] = o.VclOnComputeEdgeMissRequests - } if o.AllHitRequests != nil { toSerialize["all_hit_requests"] = o.AllHitRequests } @@ -9302,6 +9145,15 @@ func (o RealtimeMeasurements) MarshalJSON() ([]byte, error) { if o.RequestDeniedGetHeadBody != nil { toSerialize["request_denied_get_head_body"] = o.RequestDeniedGetHeadBody } + if o.ServiceDdosRequestsDetected != nil { + toSerialize["service_ddos_requests_detected"] = o.ServiceDdosRequestsDetected + } + if o.ServiceDdosRequestsMitigated != nil { + toSerialize["service_ddos_requests_mitigated"] = o.ServiceDdosRequestsMitigated + } + if o.ServiceDdosRequestsAllowed != nil { + toSerialize["service_ddos_requests_allowed"] = o.ServiceDdosRequestsAllowed + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -9551,13 +9403,6 @@ func (o *RealtimeMeasurements) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "bot_challenge_complete_tokens_issued") delete(additionalProperties, "ddos_action_downgrade") delete(additionalProperties, "ddos_action_downgraded_connections") - delete(additionalProperties, "vcl_on_compute_hit_requests") - delete(additionalProperties, "vcl_on_compute_miss_requests") - delete(additionalProperties, "vcl_on_compute_pass_requests") - delete(additionalProperties, "vcl_on_compute_error_requests") - delete(additionalProperties, "vcl_on_compute_synth_requests") - delete(additionalProperties, "vcl_on_compute_edge_hit_requests") - delete(additionalProperties, "vcl_on_compute_edge_miss_requests") delete(additionalProperties, "all_hit_requests") delete(additionalProperties, "all_miss_requests") delete(additionalProperties, "all_pass_requests") @@ -9572,6 +9417,9 @@ func (o *RealtimeMeasurements) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "all_status_5xx") delete(additionalProperties, "origin_offload") delete(additionalProperties, "request_denied_get_head_body") + delete(additionalProperties, "service_ddos_requests_detected") + delete(additionalProperties, "service_ddos_requests_mitigated") + delete(additionalProperties, "service_ddos_requests_allowed") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_results.go b/fastly/model_results.go index fc10d31..324164a 100644 --- a/fastly/model_results.go +++ b/fastly/model_results.go @@ -478,20 +478,6 @@ type Results struct { DdosActionDowngrade *int32 `json:"ddos_action_downgrade,omitempty"` // The number of connections the downgrade action was applied to. The downgrade action restricts the connection to http1. DdosActionDowngradedConnections *int32 `json:"ddos_action_downgraded_connections,omitempty"` - // Number of cache hits for a VCL service running on Compute. - VclOnComputeHitRequests *int32 `json:"vcl_on_compute_hit_requests,omitempty"` - // Number of cache misses for a VCL service running on Compute. - VclOnComputeMissRequests *int32 `json:"vcl_on_compute_miss_requests,omitempty"` - // Number of requests that passed through the CDN without being cached for a VCL service running on Compute. - VclOnComputePassRequests *int32 `json:"vcl_on_compute_pass_requests,omitempty"` - // Number of cache errors for a VCL service running on Compute. - VclOnComputeErrorRequests *int32 `json:"vcl_on_compute_error_requests,omitempty"` - // Number of requests that returned a synthetic response (i.e., response objects created with the `synthetic` VCL statement) for a VCL service running on Compute. - VclOnComputeSynthRequests *int32 `json:"vcl_on_compute_synth_requests,omitempty"` - // Number of requests sent by end users to Fastly that resulted in a hit at the edge for a VCL service running on Compute. - VclOnComputeEdgeHitRequests *int32 `json:"vcl_on_compute_edge_hit_requests,omitempty"` - // Number of requests sent by end users to Fastly that resulted in a miss at the edge for a VCL service running on Compute. - VclOnComputeEdgeMissRequests *int32 `json:"vcl_on_compute_edge_miss_requests,omitempty"` // Number of cache hits for a VCL service. AllHitRequests *int32 `json:"all_hit_requests,omitempty"` // Number of cache misses for a VCL service. @@ -519,8 +505,14 @@ type Results struct { // 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"` + RequestDeniedGetHeadBody *int32 `json:"request_denied_get_head_body,omitempty"` + // Number of requests classified as a DDoS attack against a customer origin or service. + ServiceDdosRequestsDetected *int32 `json:"service_ddos_requests_detected,omitempty"` + // Number of requests classified as a DDoS attack against a customer origin or service that were mitigated by the Fastly platform. + ServiceDdosRequestsMitigated *int32 `json:"service_ddos_requests_mitigated,omitempty"` + // Number of requests analyzed for DDoS attacks against a customer origin or service, but with no DDoS detected. + ServiceDdosRequestsAllowed *int32 `json:"service_ddos_requests_allowed,omitempty"` + ServiceID *string `json:"service_id,omitempty"` // Timestamp for the start of the time period being reported StartTime *int32 `json:"start_time,omitempty"` AdditionalProperties map[string]any @@ -7890,230 +7882,6 @@ func (o *Results) SetDdosActionDowngradedConnections(v int32) { o.DdosActionDowngradedConnections = &v } -// GetVclOnComputeHitRequests returns the VclOnComputeHitRequests field value if set, zero value otherwise. -func (o *Results) GetVclOnComputeHitRequests() int32 { - if o == nil || o.VclOnComputeHitRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeHitRequests -} - -// GetVclOnComputeHitRequestsOk returns a tuple with the VclOnComputeHitRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Results) GetVclOnComputeHitRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeHitRequests == nil { - return nil, false - } - return o.VclOnComputeHitRequests, true -} - -// HasVclOnComputeHitRequests returns a boolean if a field has been set. -func (o *Results) HasVclOnComputeHitRequests() bool { - if o != nil && o.VclOnComputeHitRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeHitRequests gets a reference to the given int32 and assigns it to the VclOnComputeHitRequests field. -func (o *Results) SetVclOnComputeHitRequests(v int32) { - o.VclOnComputeHitRequests = &v -} - -// GetVclOnComputeMissRequests returns the VclOnComputeMissRequests field value if set, zero value otherwise. -func (o *Results) GetVclOnComputeMissRequests() int32 { - if o == nil || o.VclOnComputeMissRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeMissRequests -} - -// GetVclOnComputeMissRequestsOk returns a tuple with the VclOnComputeMissRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Results) GetVclOnComputeMissRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeMissRequests == nil { - return nil, false - } - return o.VclOnComputeMissRequests, true -} - -// HasVclOnComputeMissRequests returns a boolean if a field has been set. -func (o *Results) HasVclOnComputeMissRequests() bool { - if o != nil && o.VclOnComputeMissRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeMissRequests gets a reference to the given int32 and assigns it to the VclOnComputeMissRequests field. -func (o *Results) SetVclOnComputeMissRequests(v int32) { - o.VclOnComputeMissRequests = &v -} - -// GetVclOnComputePassRequests returns the VclOnComputePassRequests field value if set, zero value otherwise. -func (o *Results) GetVclOnComputePassRequests() int32 { - if o == nil || o.VclOnComputePassRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputePassRequests -} - -// GetVclOnComputePassRequestsOk returns a tuple with the VclOnComputePassRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Results) GetVclOnComputePassRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputePassRequests == nil { - return nil, false - } - return o.VclOnComputePassRequests, true -} - -// HasVclOnComputePassRequests returns a boolean if a field has been set. -func (o *Results) HasVclOnComputePassRequests() bool { - if o != nil && o.VclOnComputePassRequests != nil { - return true - } - - return false -} - -// SetVclOnComputePassRequests gets a reference to the given int32 and assigns it to the VclOnComputePassRequests field. -func (o *Results) SetVclOnComputePassRequests(v int32) { - o.VclOnComputePassRequests = &v -} - -// GetVclOnComputeErrorRequests returns the VclOnComputeErrorRequests field value if set, zero value otherwise. -func (o *Results) GetVclOnComputeErrorRequests() int32 { - if o == nil || o.VclOnComputeErrorRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeErrorRequests -} - -// GetVclOnComputeErrorRequestsOk returns a tuple with the VclOnComputeErrorRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Results) GetVclOnComputeErrorRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeErrorRequests == nil { - return nil, false - } - return o.VclOnComputeErrorRequests, true -} - -// HasVclOnComputeErrorRequests returns a boolean if a field has been set. -func (o *Results) HasVclOnComputeErrorRequests() bool { - if o != nil && o.VclOnComputeErrorRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeErrorRequests gets a reference to the given int32 and assigns it to the VclOnComputeErrorRequests field. -func (o *Results) SetVclOnComputeErrorRequests(v int32) { - o.VclOnComputeErrorRequests = &v -} - -// GetVclOnComputeSynthRequests returns the VclOnComputeSynthRequests field value if set, zero value otherwise. -func (o *Results) GetVclOnComputeSynthRequests() int32 { - if o == nil || o.VclOnComputeSynthRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeSynthRequests -} - -// GetVclOnComputeSynthRequestsOk returns a tuple with the VclOnComputeSynthRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Results) GetVclOnComputeSynthRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeSynthRequests == nil { - return nil, false - } - return o.VclOnComputeSynthRequests, true -} - -// HasVclOnComputeSynthRequests returns a boolean if a field has been set. -func (o *Results) HasVclOnComputeSynthRequests() bool { - if o != nil && o.VclOnComputeSynthRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeSynthRequests gets a reference to the given int32 and assigns it to the VclOnComputeSynthRequests field. -func (o *Results) SetVclOnComputeSynthRequests(v int32) { - o.VclOnComputeSynthRequests = &v -} - -// GetVclOnComputeEdgeHitRequests returns the VclOnComputeEdgeHitRequests field value if set, zero value otherwise. -func (o *Results) GetVclOnComputeEdgeHitRequests() int32 { - if o == nil || o.VclOnComputeEdgeHitRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeEdgeHitRequests -} - -// GetVclOnComputeEdgeHitRequestsOk returns a tuple with the VclOnComputeEdgeHitRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Results) GetVclOnComputeEdgeHitRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeEdgeHitRequests == nil { - return nil, false - } - return o.VclOnComputeEdgeHitRequests, true -} - -// HasVclOnComputeEdgeHitRequests returns a boolean if a field has been set. -func (o *Results) HasVclOnComputeEdgeHitRequests() bool { - if o != nil && o.VclOnComputeEdgeHitRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeEdgeHitRequests gets a reference to the given int32 and assigns it to the VclOnComputeEdgeHitRequests field. -func (o *Results) SetVclOnComputeEdgeHitRequests(v int32) { - o.VclOnComputeEdgeHitRequests = &v -} - -// GetVclOnComputeEdgeMissRequests returns the VclOnComputeEdgeMissRequests field value if set, zero value otherwise. -func (o *Results) GetVclOnComputeEdgeMissRequests() int32 { - if o == nil || o.VclOnComputeEdgeMissRequests == nil { - var ret int32 - return ret - } - return *o.VclOnComputeEdgeMissRequests -} - -// GetVclOnComputeEdgeMissRequestsOk returns a tuple with the VclOnComputeEdgeMissRequests field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Results) GetVclOnComputeEdgeMissRequestsOk() (*int32, bool) { - if o == nil || o.VclOnComputeEdgeMissRequests == nil { - return nil, false - } - return o.VclOnComputeEdgeMissRequests, true -} - -// HasVclOnComputeEdgeMissRequests returns a boolean if a field has been set. -func (o *Results) HasVclOnComputeEdgeMissRequests() bool { - if o != nil && o.VclOnComputeEdgeMissRequests != nil { - return true - } - - return false -} - -// SetVclOnComputeEdgeMissRequests gets a reference to the given int32 and assigns it to the VclOnComputeEdgeMissRequests field. -func (o *Results) SetVclOnComputeEdgeMissRequests(v int32) { - o.VclOnComputeEdgeMissRequests = &v -} - // GetAllHitRequests returns the AllHitRequests field value if set, zero value otherwise. func (o *Results) GetAllHitRequests() int32 { if o == nil || o.AllHitRequests == nil { @@ -8562,6 +8330,102 @@ func (o *Results) SetRequestDeniedGetHeadBody(v int32) { o.RequestDeniedGetHeadBody = &v } +// GetServiceDdosRequestsDetected returns the ServiceDdosRequestsDetected field value if set, zero value otherwise. +func (o *Results) GetServiceDdosRequestsDetected() int32 { + if o == nil || o.ServiceDdosRequestsDetected == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsDetected +} + +// GetServiceDdosRequestsDetectedOk returns a tuple with the ServiceDdosRequestsDetected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Results) GetServiceDdosRequestsDetectedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsDetected == nil { + return nil, false + } + return o.ServiceDdosRequestsDetected, true +} + +// HasServiceDdosRequestsDetected returns a boolean if a field has been set. +func (o *Results) HasServiceDdosRequestsDetected() bool { + if o != nil && o.ServiceDdosRequestsDetected != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsDetected gets a reference to the given int32 and assigns it to the ServiceDdosRequestsDetected field. +func (o *Results) SetServiceDdosRequestsDetected(v int32) { + o.ServiceDdosRequestsDetected = &v +} + +// GetServiceDdosRequestsMitigated returns the ServiceDdosRequestsMitigated field value if set, zero value otherwise. +func (o *Results) GetServiceDdosRequestsMitigated() int32 { + if o == nil || o.ServiceDdosRequestsMitigated == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsMitigated +} + +// GetServiceDdosRequestsMitigatedOk returns a tuple with the ServiceDdosRequestsMitigated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Results) GetServiceDdosRequestsMitigatedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsMitigated == nil { + return nil, false + } + return o.ServiceDdosRequestsMitigated, true +} + +// HasServiceDdosRequestsMitigated returns a boolean if a field has been set. +func (o *Results) HasServiceDdosRequestsMitigated() bool { + if o != nil && o.ServiceDdosRequestsMitigated != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsMitigated gets a reference to the given int32 and assigns it to the ServiceDdosRequestsMitigated field. +func (o *Results) SetServiceDdosRequestsMitigated(v int32) { + o.ServiceDdosRequestsMitigated = &v +} + +// GetServiceDdosRequestsAllowed returns the ServiceDdosRequestsAllowed field value if set, zero value otherwise. +func (o *Results) GetServiceDdosRequestsAllowed() int32 { + if o == nil || o.ServiceDdosRequestsAllowed == nil { + var ret int32 + return ret + } + return *o.ServiceDdosRequestsAllowed +} + +// GetServiceDdosRequestsAllowedOk returns a tuple with the ServiceDdosRequestsAllowed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Results) GetServiceDdosRequestsAllowedOk() (*int32, bool) { + if o == nil || o.ServiceDdosRequestsAllowed == nil { + return nil, false + } + return o.ServiceDdosRequestsAllowed, true +} + +// HasServiceDdosRequestsAllowed returns a boolean if a field has been set. +func (o *Results) HasServiceDdosRequestsAllowed() bool { + if o != nil && o.ServiceDdosRequestsAllowed != nil { + return true + } + + return false +} + +// SetServiceDdosRequestsAllowed gets a reference to the given int32 and assigns it to the ServiceDdosRequestsAllowed field. +func (o *Results) SetServiceDdosRequestsAllowed(v int32) { + o.ServiceDdosRequestsAllowed = &v +} + // GetServiceID returns the ServiceID field value if set, zero value otherwise. func (o *Results) GetServiceID() string { if o == nil || o.ServiceID == nil { @@ -9317,27 +9181,6 @@ func (o Results) MarshalJSON() ([]byte, error) { if o.DdosActionDowngradedConnections != nil { toSerialize["ddos_action_downgraded_connections"] = o.DdosActionDowngradedConnections } - if o.VclOnComputeHitRequests != nil { - toSerialize["vcl_on_compute_hit_requests"] = o.VclOnComputeHitRequests - } - if o.VclOnComputeMissRequests != nil { - toSerialize["vcl_on_compute_miss_requests"] = o.VclOnComputeMissRequests - } - if o.VclOnComputePassRequests != nil { - toSerialize["vcl_on_compute_pass_requests"] = o.VclOnComputePassRequests - } - if o.VclOnComputeErrorRequests != nil { - toSerialize["vcl_on_compute_error_requests"] = o.VclOnComputeErrorRequests - } - if o.VclOnComputeSynthRequests != nil { - toSerialize["vcl_on_compute_synth_requests"] = o.VclOnComputeSynthRequests - } - if o.VclOnComputeEdgeHitRequests != nil { - toSerialize["vcl_on_compute_edge_hit_requests"] = o.VclOnComputeEdgeHitRequests - } - if o.VclOnComputeEdgeMissRequests != nil { - toSerialize["vcl_on_compute_edge_miss_requests"] = o.VclOnComputeEdgeMissRequests - } if o.AllHitRequests != nil { toSerialize["all_hit_requests"] = o.AllHitRequests } @@ -9380,6 +9223,15 @@ func (o Results) MarshalJSON() ([]byte, error) { if o.RequestDeniedGetHeadBody != nil { toSerialize["request_denied_get_head_body"] = o.RequestDeniedGetHeadBody } + if o.ServiceDdosRequestsDetected != nil { + toSerialize["service_ddos_requests_detected"] = o.ServiceDdosRequestsDetected + } + if o.ServiceDdosRequestsMitigated != nil { + toSerialize["service_ddos_requests_mitigated"] = o.ServiceDdosRequestsMitigated + } + if o.ServiceDdosRequestsAllowed != nil { + toSerialize["service_ddos_requests_allowed"] = o.ServiceDdosRequestsAllowed + } if o.ServiceID != nil { toSerialize["service_id"] = o.ServiceID } @@ -9635,13 +9487,6 @@ func (o *Results) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "bot_challenges_failed") delete(additionalProperties, "ddos_action_downgrade") delete(additionalProperties, "ddos_action_downgraded_connections") - delete(additionalProperties, "vcl_on_compute_hit_requests") - delete(additionalProperties, "vcl_on_compute_miss_requests") - delete(additionalProperties, "vcl_on_compute_pass_requests") - delete(additionalProperties, "vcl_on_compute_error_requests") - delete(additionalProperties, "vcl_on_compute_synth_requests") - delete(additionalProperties, "vcl_on_compute_edge_hit_requests") - delete(additionalProperties, "vcl_on_compute_edge_miss_requests") delete(additionalProperties, "all_hit_requests") delete(additionalProperties, "all_miss_requests") delete(additionalProperties, "all_pass_requests") @@ -9656,6 +9501,9 @@ func (o *Results) UnmarshalJSON(bytes []byte) (err error) { delete(additionalProperties, "all_status_5xx") delete(additionalProperties, "origin_offload") delete(additionalProperties, "request_denied_get_head_body") + delete(additionalProperties, "service_ddos_requests_detected") + delete(additionalProperties, "service_ddos_requests_mitigated") + delete(additionalProperties, "service_ddos_requests_allowed") delete(additionalProperties, "service_id") delete(additionalProperties, "start_time") o.AdditionalProperties = additionalProperties diff --git a/fastly/model_set_configuration.go b/fastly/model_set_configuration.go index 2629bab..328c473 100644 --- a/fastly/model_set_configuration.go +++ b/fastly/model_set_configuration.go @@ -21,7 +21,9 @@ 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"` + TrafficRamp *string `json:"traffic_ramp,omitempty"` + // The new mode to run the product in. One of `block`, `log`, or `off`. Optional in the `PATCH` request body for `ddos_protection`. + Mode *string `json:"mode,omitempty"` AdditionalProperties map[string]any } @@ -108,6 +110,38 @@ func (o *SetConfiguration) SetTrafficRamp(v string) { o.TrafficRamp = &v } +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *SetConfiguration) GetMode() string { + if o == nil || o.Mode == nil { + var ret string + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetConfiguration) GetModeOk() (*string, bool) { + if o == nil || o.Mode == nil { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *SetConfiguration) HasMode() bool { + if o != nil && o.Mode != nil { + return true + } + + return false +} + +// SetMode gets a reference to the given string and assigns it to the Mode field. +func (o *SetConfiguration) SetMode(v string) { + o.Mode = &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) { @@ -118,6 +152,9 @@ func (o SetConfiguration) MarshalJSON() ([]byte, error) { if o.TrafficRamp != nil { toSerialize["traffic_ramp"] = o.TrafficRamp } + if o.Mode != nil { + toSerialize["mode"] = o.Mode + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -140,6 +177,7 @@ func (o *SetConfiguration) UnmarshalJSON(bytes []byte) (err error) { if err = json.Unmarshal(bytes, &additionalProperties); err == nil { delete(additionalProperties, "workspace_id") delete(additionalProperties, "traffic_ramp") + delete(additionalProperties, "mode") o.AdditionalProperties = additionalProperties } diff --git a/fastly/model_usagemetric.go b/fastly/model_usagemetric.go new file mode 100644 index 0000000..e2dae16 --- /dev/null +++ b/fastly/model_usagemetric.go @@ -0,0 +1,459 @@ +// 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" +) + +// Usagemetric struct for Usagemetric +type Usagemetric struct { + // The year and month of the usage element. + Month *string `json:"month,omitempty"` + // The usage type identifier for the usage. This is a single, billable metric for the product. + UsageType *string `json:"usage_type,omitempty"` + // Full name of the product usage type as it might appear on a customer's invoice. + Name *string `json:"name,omitempty"` + // The geographical area applicable for regionally based products. + Region *string `json:"region,omitempty"` + // The unit for the usage as shown on an invoice. If there is no explicit unit, this field will be \"unit\" (e.g., a request with `product_id` of 'cdn_usage' and `usage_type` of 'North America Requests' has no unit, and will return \"unit\"). + Unit *string `json:"unit,omitempty"` + // The quantity of the usage for the product. + Quantity *float32 `json:"quantity,omitempty"` + // The raw units measured for the product. + RawQuantity *float32 `json:"raw_quantity,omitempty"` + // The product identifier associated with the usage type. This corresponds to a Fastly product offering. + ProductID *string `json:"product_id,omitempty"` + // The date when the usage metric was last updated. + LastUpdatedAt *string `json:"last_updated_at,omitempty"` + AdditionalProperties map[string]any +} + +type _Usagemetric Usagemetric + +// NewUsagemetric instantiates a new Usagemetric 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 NewUsagemetric() *Usagemetric { + this := Usagemetric{} + return &this +} + +// NewUsagemetricWithDefaults instantiates a new Usagemetric 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 NewUsagemetricWithDefaults() *Usagemetric { + this := Usagemetric{} + return &this +} + +// GetMonth returns the Month field value if set, zero value otherwise. +func (o *Usagemetric) GetMonth() string { + if o == nil || o.Month == nil { + var ret string + return ret + } + return *o.Month +} + +// GetMonthOk returns a tuple with the Month field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Usagemetric) GetMonthOk() (*string, bool) { + if o == nil || o.Month == nil { + return nil, false + } + return o.Month, true +} + +// HasMonth returns a boolean if a field has been set. +func (o *Usagemetric) HasMonth() bool { + if o != nil && o.Month != nil { + return true + } + + return false +} + +// SetMonth gets a reference to the given string and assigns it to the Month field. +func (o *Usagemetric) SetMonth(v string) { + o.Month = &v +} + +// GetUsageType returns the UsageType field value if set, zero value otherwise. +func (o *Usagemetric) GetUsageType() string { + if o == nil || o.UsageType == nil { + var ret string + return ret + } + return *o.UsageType +} + +// GetUsageTypeOk returns a tuple with the UsageType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Usagemetric) GetUsageTypeOk() (*string, bool) { + if o == nil || o.UsageType == nil { + return nil, false + } + return o.UsageType, true +} + +// HasUsageType returns a boolean if a field has been set. +func (o *Usagemetric) HasUsageType() bool { + if o != nil && o.UsageType != nil { + return true + } + + return false +} + +// SetUsageType gets a reference to the given string and assigns it to the UsageType field. +func (o *Usagemetric) SetUsageType(v string) { + o.UsageType = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Usagemetric) 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 *Usagemetric) 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 *Usagemetric) 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 *Usagemetric) SetName(v string) { + o.Name = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *Usagemetric) 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 *Usagemetric) 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 *Usagemetric) 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 *Usagemetric) SetRegion(v string) { + o.Region = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *Usagemetric) GetUnit() string { + if o == nil || o.Unit == nil { + var ret string + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Usagemetric) GetUnitOk() (*string, bool) { + if o == nil || o.Unit == nil { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *Usagemetric) HasUnit() bool { + if o != nil && o.Unit != nil { + return true + } + + return false +} + +// SetUnit gets a reference to the given string and assigns it to the Unit field. +func (o *Usagemetric) SetUnit(v string) { + o.Unit = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *Usagemetric) GetQuantity() float32 { + if o == nil || o.Quantity == nil { + var ret float32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Usagemetric) GetQuantityOk() (*float32, bool) { + if o == nil || o.Quantity == nil { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *Usagemetric) HasQuantity() bool { + if o != nil && o.Quantity != nil { + return true + } + + return false +} + +// SetQuantity gets a reference to the given float32 and assigns it to the Quantity field. +func (o *Usagemetric) SetQuantity(v float32) { + o.Quantity = &v +} + +// GetRawQuantity returns the RawQuantity field value if set, zero value otherwise. +func (o *Usagemetric) GetRawQuantity() float32 { + if o == nil || o.RawQuantity == nil { + var ret float32 + return ret + } + return *o.RawQuantity +} + +// GetRawQuantityOk returns a tuple with the RawQuantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Usagemetric) GetRawQuantityOk() (*float32, bool) { + if o == nil || o.RawQuantity == nil { + return nil, false + } + return o.RawQuantity, true +} + +// HasRawQuantity returns a boolean if a field has been set. +func (o *Usagemetric) HasRawQuantity() bool { + if o != nil && o.RawQuantity != nil { + return true + } + + return false +} + +// SetRawQuantity gets a reference to the given float32 and assigns it to the RawQuantity field. +func (o *Usagemetric) SetRawQuantity(v float32) { + o.RawQuantity = &v +} + +// GetProductID returns the ProductID field value if set, zero value otherwise. +func (o *Usagemetric) GetProductID() string { + if o == nil || o.ProductID == nil { + var ret string + return ret + } + return *o.ProductID +} + +// GetProductIDOk returns a tuple with the ProductID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Usagemetric) GetProductIDOk() (*string, bool) { + if o == nil || o.ProductID == nil { + return nil, false + } + return o.ProductID, true +} + +// HasProductID returns a boolean if a field has been set. +func (o *Usagemetric) HasProductID() bool { + if o != nil && o.ProductID != nil { + return true + } + + return false +} + +// SetProductID gets a reference to the given string and assigns it to the ProductID field. +func (o *Usagemetric) SetProductID(v string) { + o.ProductID = &v +} + +// GetLastUpdatedAt returns the LastUpdatedAt field value if set, zero value otherwise. +func (o *Usagemetric) GetLastUpdatedAt() string { + if o == nil || o.LastUpdatedAt == nil { + var ret string + return ret + } + return *o.LastUpdatedAt +} + +// GetLastUpdatedAtOk returns a tuple with the LastUpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Usagemetric) GetLastUpdatedAtOk() (*string, bool) { + if o == nil || o.LastUpdatedAt == nil { + return nil, false + } + return o.LastUpdatedAt, true +} + +// HasLastUpdatedAt returns a boolean if a field has been set. +func (o *Usagemetric) HasLastUpdatedAt() bool { + if o != nil && o.LastUpdatedAt != nil { + return true + } + + return false +} + +// SetLastUpdatedAt gets a reference to the given string and assigns it to the LastUpdatedAt field. +func (o *Usagemetric) SetLastUpdatedAt(v string) { + o.LastUpdatedAt = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o Usagemetric) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Month != nil { + toSerialize["month"] = o.Month + } + if o.UsageType != nil { + toSerialize["usage_type"] = o.UsageType + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Region != nil { + toSerialize["region"] = o.Region + } + if o.Unit != nil { + toSerialize["unit"] = o.Unit + } + if o.Quantity != nil { + toSerialize["quantity"] = o.Quantity + } + if o.RawQuantity != nil { + toSerialize["raw_quantity"] = o.RawQuantity + } + if o.ProductID != nil { + toSerialize["product_id"] = o.ProductID + } + if o.LastUpdatedAt != nil { + toSerialize["last_updated_at"] = o.LastUpdatedAt + } + + 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 *Usagemetric) UnmarshalJSON(bytes []byte) (err error) { + varUsagemetric := _Usagemetric{} + + if err = json.Unmarshal(bytes, &varUsagemetric); err == nil { + *o = Usagemetric(varUsagemetric) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "month") + delete(additionalProperties, "usage_type") + delete(additionalProperties, "name") + delete(additionalProperties, "region") + delete(additionalProperties, "unit") + delete(additionalProperties, "quantity") + delete(additionalProperties, "raw_quantity") + delete(additionalProperties, "product_id") + delete(additionalProperties, "last_updated_at") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableUsagemetric is a helper abstraction for handling nullable usagemetric types. +type NullableUsagemetric struct { + value *Usagemetric + isSet bool +} + +// Get returns the value. +func (v NullableUsagemetric) Get() *Usagemetric { + return v.value +} + +// Set modifies the value. +func (v *NullableUsagemetric) Set(val *Usagemetric) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableUsagemetric) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableUsagemetric) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableUsagemetric returns a pointer to a new instance of NullableUsagemetric. +func NewNullableUsagemetric(val *Usagemetric) *NullableUsagemetric { + return &NullableUsagemetric{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 NullableUsagemetric) 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 *NullableUsagemetric) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_usagemetrics.go b/fastly/model_usagemetrics.go new file mode 100644 index 0000000..09d329a --- /dev/null +++ b/fastly/model_usagemetrics.go @@ -0,0 +1,154 @@ +// 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" +) + +// Usagemetrics struct for Usagemetrics +type Usagemetrics struct { + Data []Usagemetric `json:"data,omitempty"` + AdditionalProperties map[string]any +} + +type _Usagemetrics Usagemetrics + +// NewUsagemetrics instantiates a new Usagemetrics 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 NewUsagemetrics() *Usagemetrics { + this := Usagemetrics{} + return &this +} + +// NewUsagemetricsWithDefaults instantiates a new Usagemetrics 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 NewUsagemetricsWithDefaults() *Usagemetrics { + this := Usagemetrics{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *Usagemetrics) GetData() []Usagemetric { + if o == nil || o.Data == nil { + var ret []Usagemetric + 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 *Usagemetrics) GetDataOk() ([]Usagemetric, 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 *Usagemetrics) HasData() bool { + if o != nil && o.Data != nil { + return true + } + + return false +} + +// SetData gets a reference to the given []Usagemetric and assigns it to the Data field. +func (o *Usagemetrics) SetData(v []Usagemetric) { + 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 Usagemetrics) 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 *Usagemetrics) UnmarshalJSON(bytes []byte) (err error) { + varUsagemetrics := _Usagemetrics{} + + if err = json.Unmarshal(bytes, &varUsagemetrics); err == nil { + *o = Usagemetrics(varUsagemetrics) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableUsagemetrics is a helper abstraction for handling nullable usagemetrics types. +type NullableUsagemetrics struct { + value *Usagemetrics + isSet bool +} + +// Get returns the value. +func (v NullableUsagemetrics) Get() *Usagemetrics { + return v.value +} + +// Set modifies the value. +func (v *NullableUsagemetrics) Set(val *Usagemetrics) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableUsagemetrics) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableUsagemetrics) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableUsagemetrics returns a pointer to a new instance of NullableUsagemetrics. +func NewNullableUsagemetrics(val *Usagemetrics) *NullableUsagemetrics { + return &NullableUsagemetrics{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 NullableUsagemetrics) 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 *NullableUsagemetrics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_503_responses.go b/fastly/model_values_503_responses.go new file mode 100644 index 0000000..c21483e --- /dev/null +++ b/fastly/model_values_503_responses.go @@ -0,0 +1,231 @@ +// 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" +) + +// Values503Responses struct for Values503Responses +type Values503Responses struct { + // The HTTP request path. + URL *string `json:"url,omitempty"` + // The rate at which the reason in this dimension occurs among responses to this URL with a 503 status code. + RatePerURL *float32 `json:"rate_per_url,omitempty"` + // The rate at which 503 status codes are returned for this URL. + Var503RatePerURL *float32 `json:"503_rate_per_url,omitempty"` + AdditionalProperties map[string]any +} + +type _Values503Responses Values503Responses + +// NewValues503Responses instantiates a new Values503Responses 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 NewValues503Responses() *Values503Responses { + this := Values503Responses{} + return &this +} + +// NewValues503ResponsesWithDefaults instantiates a new Values503Responses 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 NewValues503ResponsesWithDefaults() *Values503Responses { + this := Values503Responses{} + return &this +} + +// GetURL returns the URL field value if set, zero value otherwise. +func (o *Values503Responses) GetURL() string { + if o == nil || o.URL == nil { + var ret string + return ret + } + return *o.URL +} + +// GetURLOk returns a tuple with the URL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Values503Responses) GetURLOk() (*string, bool) { + if o == nil || o.URL == nil { + return nil, false + } + return o.URL, true +} + +// HasURL returns a boolean if a field has been set. +func (o *Values503Responses) HasURL() bool { + if o != nil && o.URL != nil { + return true + } + + return false +} + +// SetURL gets a reference to the given string and assigns it to the URL field. +func (o *Values503Responses) SetURL(v string) { + o.URL = &v +} + +// GetRatePerURL returns the RatePerURL field value if set, zero value otherwise. +func (o *Values503Responses) GetRatePerURL() float32 { + if o == nil || o.RatePerURL == nil { + var ret float32 + return ret + } + return *o.RatePerURL +} + +// GetRatePerURLOk returns a tuple with the RatePerURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Values503Responses) GetRatePerURLOk() (*float32, bool) { + if o == nil || o.RatePerURL == nil { + return nil, false + } + return o.RatePerURL, true +} + +// HasRatePerURL returns a boolean if a field has been set. +func (o *Values503Responses) HasRatePerURL() bool { + if o != nil && o.RatePerURL != nil { + return true + } + + return false +} + +// SetRatePerURL gets a reference to the given float32 and assigns it to the RatePerURL field. +func (o *Values503Responses) SetRatePerURL(v float32) { + o.RatePerURL = &v +} + +// GetVar503RatePerURL returns the Var503RatePerURL field value if set, zero value otherwise. +func (o *Values503Responses) GetVar503RatePerURL() float32 { + if o == nil || o.Var503RatePerURL == nil { + var ret float32 + return ret + } + return *o.Var503RatePerURL +} + +// GetVar503RatePerURLOk returns a tuple with the Var503RatePerURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Values503Responses) GetVar503RatePerURLOk() (*float32, bool) { + if o == nil || o.Var503RatePerURL == nil { + return nil, false + } + return o.Var503RatePerURL, true +} + +// HasVar503RatePerURL returns a boolean if a field has been set. +func (o *Values503Responses) HasVar503RatePerURL() bool { + if o != nil && o.Var503RatePerURL != nil { + return true + } + + return false +} + +// SetVar503RatePerURL gets a reference to the given float32 and assigns it to the Var503RatePerURL field. +func (o *Values503Responses) SetVar503RatePerURL(v float32) { + o.Var503RatePerURL = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o Values503Responses) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.URL != nil { + toSerialize["url"] = o.URL + } + if o.RatePerURL != nil { + toSerialize["rate_per_url"] = o.RatePerURL + } + if o.Var503RatePerURL != nil { + toSerialize["503_rate_per_url"] = o.Var503RatePerURL + } + + 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 *Values503Responses) UnmarshalJSON(bytes []byte) (err error) { + varValues503Responses := _Values503Responses{} + + if err = json.Unmarshal(bytes, &varValues503Responses); err == nil { + *o = Values503Responses(varValues503Responses) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "url") + delete(additionalProperties, "rate_per_url") + delete(additionalProperties, "503_rate_per_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValues503Responses is a helper abstraction for handling nullable values503responses types. +type NullableValues503Responses struct { + value *Values503Responses + isSet bool +} + +// Get returns the value. +func (v NullableValues503Responses) Get() *Values503Responses { + return v.value +} + +// Set modifies the value. +func (v *NullableValues503Responses) Set(val *Values503Responses) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValues503Responses) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValues503Responses) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValues503Responses returns a pointer to a new instance of NullableValues503Responses. +func NewNullableValues503Responses(val *Values503Responses) *NullableValues503Responses { + return &NullableValues503Responses{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 NullableValues503Responses) 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 *NullableValues503Responses) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_bandwidth.go b/fastly/model_values_bandwidth.go new file mode 100644 index 0000000..76fe774 --- /dev/null +++ b/fastly/model_values_bandwidth.go @@ -0,0 +1,193 @@ +// 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" +) + +// ValuesBandwidth struct for ValuesBandwidth +type ValuesBandwidth struct { + // The average bandwidth in bytes for responses to requests to the URL in the current dimension. + AverageBandwidthBytes *float32 `json:"average_bandwidth_bytes,omitempty"` + // The total bandwidth percentage for all responses to requests to the URL in the current dimension. + BandwidthPercentage *float32 `json:"bandwidth_percentage,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesBandwidth ValuesBandwidth + +// NewValuesBandwidth instantiates a new ValuesBandwidth 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 NewValuesBandwidth() *ValuesBandwidth { + this := ValuesBandwidth{} + return &this +} + +// NewValuesBandwidthWithDefaults instantiates a new ValuesBandwidth 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 NewValuesBandwidthWithDefaults() *ValuesBandwidth { + this := ValuesBandwidth{} + return &this +} + +// GetAverageBandwidthBytes returns the AverageBandwidthBytes field value if set, zero value otherwise. +func (o *ValuesBandwidth) GetAverageBandwidthBytes() float32 { + if o == nil || o.AverageBandwidthBytes == nil { + var ret float32 + return ret + } + return *o.AverageBandwidthBytes +} + +// GetAverageBandwidthBytesOk returns a tuple with the AverageBandwidthBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesBandwidth) GetAverageBandwidthBytesOk() (*float32, bool) { + if o == nil || o.AverageBandwidthBytes == nil { + return nil, false + } + return o.AverageBandwidthBytes, true +} + +// HasAverageBandwidthBytes returns a boolean if a field has been set. +func (o *ValuesBandwidth) HasAverageBandwidthBytes() bool { + if o != nil && o.AverageBandwidthBytes != nil { + return true + } + + return false +} + +// SetAverageBandwidthBytes gets a reference to the given float32 and assigns it to the AverageBandwidthBytes field. +func (o *ValuesBandwidth) SetAverageBandwidthBytes(v float32) { + o.AverageBandwidthBytes = &v +} + +// GetBandwidthPercentage returns the BandwidthPercentage field value if set, zero value otherwise. +func (o *ValuesBandwidth) GetBandwidthPercentage() float32 { + if o == nil || o.BandwidthPercentage == nil { + var ret float32 + return ret + } + return *o.BandwidthPercentage +} + +// GetBandwidthPercentageOk returns a tuple with the BandwidthPercentage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesBandwidth) GetBandwidthPercentageOk() (*float32, bool) { + if o == nil || o.BandwidthPercentage == nil { + return nil, false + } + return o.BandwidthPercentage, true +} + +// HasBandwidthPercentage returns a boolean if a field has been set. +func (o *ValuesBandwidth) HasBandwidthPercentage() bool { + if o != nil && o.BandwidthPercentage != nil { + return true + } + + return false +} + +// SetBandwidthPercentage gets a reference to the given float32 and assigns it to the BandwidthPercentage field. +func (o *ValuesBandwidth) SetBandwidthPercentage(v float32) { + o.BandwidthPercentage = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesBandwidth) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.AverageBandwidthBytes != nil { + toSerialize["average_bandwidth_bytes"] = o.AverageBandwidthBytes + } + if o.BandwidthPercentage != nil { + toSerialize["bandwidth_percentage"] = o.BandwidthPercentage + } + + 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 *ValuesBandwidth) UnmarshalJSON(bytes []byte) (err error) { + varValuesBandwidth := _ValuesBandwidth{} + + if err = json.Unmarshal(bytes, &varValuesBandwidth); err == nil { + *o = ValuesBandwidth(varValuesBandwidth) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "average_bandwidth_bytes") + delete(additionalProperties, "bandwidth_percentage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesBandwidth is a helper abstraction for handling nullable valuesbandwidth types. +type NullableValuesBandwidth struct { + value *ValuesBandwidth + isSet bool +} + +// Get returns the value. +func (v NullableValuesBandwidth) Get() *ValuesBandwidth { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesBandwidth) Set(val *ValuesBandwidth) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesBandwidth) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesBandwidth) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesBandwidth returns a pointer to a new instance of NullableValuesBandwidth. +func NewNullableValuesBandwidth(val *ValuesBandwidth) *NullableValuesBandwidth { + return &NullableValuesBandwidth{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 NullableValuesBandwidth) 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 *NullableValuesBandwidth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_browser.go b/fastly/model_values_browser.go new file mode 100644 index 0000000..ef450c6 --- /dev/null +++ b/fastly/model_values_browser.go @@ -0,0 +1,193 @@ +// 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" +) + +// ValuesBrowser struct for ValuesBrowser +type ValuesBrowser struct { + // The version of the client's browser. + BrowserVersion *string `json:"browser_version,omitempty"` + // The percentage of requests by this version of the browser specified in the dimension. + Rate *float32 `json:"rate,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesBrowser ValuesBrowser + +// NewValuesBrowser instantiates a new ValuesBrowser 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 NewValuesBrowser() *ValuesBrowser { + this := ValuesBrowser{} + return &this +} + +// NewValuesBrowserWithDefaults instantiates a new ValuesBrowser 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 NewValuesBrowserWithDefaults() *ValuesBrowser { + this := ValuesBrowser{} + return &this +} + +// GetBrowserVersion returns the BrowserVersion field value if set, zero value otherwise. +func (o *ValuesBrowser) GetBrowserVersion() string { + if o == nil || o.BrowserVersion == nil { + var ret string + return ret + } + return *o.BrowserVersion +} + +// GetBrowserVersionOk returns a tuple with the BrowserVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesBrowser) GetBrowserVersionOk() (*string, bool) { + if o == nil || o.BrowserVersion == nil { + return nil, false + } + return o.BrowserVersion, true +} + +// HasBrowserVersion returns a boolean if a field has been set. +func (o *ValuesBrowser) HasBrowserVersion() bool { + if o != nil && o.BrowserVersion != nil { + return true + } + + return false +} + +// SetBrowserVersion gets a reference to the given string and assigns it to the BrowserVersion field. +func (o *ValuesBrowser) SetBrowserVersion(v string) { + o.BrowserVersion = &v +} + +// GetRate returns the Rate field value if set, zero value otherwise. +func (o *ValuesBrowser) GetRate() float32 { + if o == nil || o.Rate == nil { + var ret float32 + return ret + } + return *o.Rate +} + +// GetRateOk returns a tuple with the Rate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesBrowser) GetRateOk() (*float32, bool) { + if o == nil || o.Rate == nil { + return nil, false + } + return o.Rate, true +} + +// HasRate returns a boolean if a field has been set. +func (o *ValuesBrowser) HasRate() bool { + if o != nil && o.Rate != nil { + return true + } + + return false +} + +// SetRate gets a reference to the given float32 and assigns it to the Rate field. +func (o *ValuesBrowser) SetRate(v float32) { + o.Rate = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesBrowser) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.BrowserVersion != nil { + toSerialize["browser_version"] = o.BrowserVersion + } + if o.Rate != nil { + toSerialize["rate"] = o.Rate + } + + 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 *ValuesBrowser) UnmarshalJSON(bytes []byte) (err error) { + varValuesBrowser := _ValuesBrowser{} + + if err = json.Unmarshal(bytes, &varValuesBrowser); err == nil { + *o = ValuesBrowser(varValuesBrowser) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "browser_version") + delete(additionalProperties, "rate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesBrowser is a helper abstraction for handling nullable valuesbrowser types. +type NullableValuesBrowser struct { + value *ValuesBrowser + isSet bool +} + +// Get returns the value. +func (v NullableValuesBrowser) Get() *ValuesBrowser { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesBrowser) Set(val *ValuesBrowser) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesBrowser) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesBrowser) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesBrowser returns a pointer to a new instance of NullableValuesBrowser. +func NewNullableValuesBrowser(val *ValuesBrowser) *NullableValuesBrowser { + return &NullableValuesBrowser{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 NullableValuesBrowser) 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 *NullableValuesBrowser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_cache_hit_ratio.go b/fastly/model_values_cache_hit_ratio.go new file mode 100644 index 0000000..d180c97 --- /dev/null +++ b/fastly/model_values_cache_hit_ratio.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" +) + +// ValuesCacheHitRatio struct for ValuesCacheHitRatio +type ValuesCacheHitRatio struct { + // The cache hit ratio for the URL specified in the dimension. + CacheHitRatio *float32 `json:"cache_hit_ratio,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesCacheHitRatio ValuesCacheHitRatio + +// NewValuesCacheHitRatio instantiates a new ValuesCacheHitRatio 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 NewValuesCacheHitRatio() *ValuesCacheHitRatio { + this := ValuesCacheHitRatio{} + return &this +} + +// NewValuesCacheHitRatioWithDefaults instantiates a new ValuesCacheHitRatio 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 NewValuesCacheHitRatioWithDefaults() *ValuesCacheHitRatio { + this := ValuesCacheHitRatio{} + return &this +} + +// GetCacheHitRatio returns the CacheHitRatio field value if set, zero value otherwise. +func (o *ValuesCacheHitRatio) GetCacheHitRatio() float32 { + if o == nil || o.CacheHitRatio == nil { + var ret float32 + return ret + } + return *o.CacheHitRatio +} + +// GetCacheHitRatioOk returns a tuple with the CacheHitRatio field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesCacheHitRatio) GetCacheHitRatioOk() (*float32, bool) { + if o == nil || o.CacheHitRatio == nil { + return nil, false + } + return o.CacheHitRatio, true +} + +// HasCacheHitRatio returns a boolean if a field has been set. +func (o *ValuesCacheHitRatio) HasCacheHitRatio() bool { + if o != nil && o.CacheHitRatio != nil { + return true + } + + return false +} + +// SetCacheHitRatio gets a reference to the given float32 and assigns it to the CacheHitRatio field. +func (o *ValuesCacheHitRatio) SetCacheHitRatio(v float32) { + o.CacheHitRatio = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesCacheHitRatio) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.CacheHitRatio != nil { + toSerialize["cache_hit_ratio"] = o.CacheHitRatio + } + + 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 *ValuesCacheHitRatio) UnmarshalJSON(bytes []byte) (err error) { + varValuesCacheHitRatio := _ValuesCacheHitRatio{} + + if err = json.Unmarshal(bytes, &varValuesCacheHitRatio); err == nil { + *o = ValuesCacheHitRatio(varValuesCacheHitRatio) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "cache_hit_ratio") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesCacheHitRatio is a helper abstraction for handling nullable valuescachehitratio types. +type NullableValuesCacheHitRatio struct { + value *ValuesCacheHitRatio + isSet bool +} + +// Get returns the value. +func (v NullableValuesCacheHitRatio) Get() *ValuesCacheHitRatio { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesCacheHitRatio) Set(val *ValuesCacheHitRatio) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesCacheHitRatio) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesCacheHitRatio) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesCacheHitRatio returns a pointer to a new instance of NullableValuesCacheHitRatio. +func NewNullableValuesCacheHitRatio(val *ValuesCacheHitRatio) *NullableValuesCacheHitRatio { + return &NullableValuesCacheHitRatio{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 NullableValuesCacheHitRatio) 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 *NullableValuesCacheHitRatio) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_country_stats.go b/fastly/model_values_country_stats.go new file mode 100644 index 0000000..d5921c2 --- /dev/null +++ b/fastly/model_values_country_stats.go @@ -0,0 +1,231 @@ +// 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" +) + +// ValuesCountryStats struct for ValuesCountryStats +type ValuesCountryStats struct { + // The client's country subdivision code as defined by ISO 3166-2. + Region *string `json:"region,omitempty"` + // The cache hit ratio for the region. + RegionChr *float32 `json:"region_chr,omitempty"` + // The error rate for the region. + RegionErrorRate *float32 `json:"region_error_rate,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesCountryStats ValuesCountryStats + +// NewValuesCountryStats instantiates a new ValuesCountryStats 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 NewValuesCountryStats() *ValuesCountryStats { + this := ValuesCountryStats{} + return &this +} + +// NewValuesCountryStatsWithDefaults instantiates a new ValuesCountryStats 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 NewValuesCountryStatsWithDefaults() *ValuesCountryStats { + this := ValuesCountryStats{} + return &this +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *ValuesCountryStats) 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 *ValuesCountryStats) 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 *ValuesCountryStats) 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 *ValuesCountryStats) SetRegion(v string) { + o.Region = &v +} + +// GetRegionChr returns the RegionChr field value if set, zero value otherwise. +func (o *ValuesCountryStats) GetRegionChr() float32 { + if o == nil || o.RegionChr == nil { + var ret float32 + return ret + } + return *o.RegionChr +} + +// GetRegionChrOk returns a tuple with the RegionChr field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesCountryStats) GetRegionChrOk() (*float32, bool) { + if o == nil || o.RegionChr == nil { + return nil, false + } + return o.RegionChr, true +} + +// HasRegionChr returns a boolean if a field has been set. +func (o *ValuesCountryStats) HasRegionChr() bool { + if o != nil && o.RegionChr != nil { + return true + } + + return false +} + +// SetRegionChr gets a reference to the given float32 and assigns it to the RegionChr field. +func (o *ValuesCountryStats) SetRegionChr(v float32) { + o.RegionChr = &v +} + +// GetRegionErrorRate returns the RegionErrorRate field value if set, zero value otherwise. +func (o *ValuesCountryStats) GetRegionErrorRate() float32 { + if o == nil || o.RegionErrorRate == nil { + var ret float32 + return ret + } + return *o.RegionErrorRate +} + +// GetRegionErrorRateOk returns a tuple with the RegionErrorRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesCountryStats) GetRegionErrorRateOk() (*float32, bool) { + if o == nil || o.RegionErrorRate == nil { + return nil, false + } + return o.RegionErrorRate, true +} + +// HasRegionErrorRate returns a boolean if a field has been set. +func (o *ValuesCountryStats) HasRegionErrorRate() bool { + if o != nil && o.RegionErrorRate != nil { + return true + } + + return false +} + +// SetRegionErrorRate gets a reference to the given float32 and assigns it to the RegionErrorRate field. +func (o *ValuesCountryStats) SetRegionErrorRate(v float32) { + o.RegionErrorRate = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesCountryStats) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Region != nil { + toSerialize["region"] = o.Region + } + if o.RegionChr != nil { + toSerialize["region_chr"] = o.RegionChr + } + if o.RegionErrorRate != nil { + toSerialize["region_error_rate"] = o.RegionErrorRate + } + + 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 *ValuesCountryStats) UnmarshalJSON(bytes []byte) (err error) { + varValuesCountryStats := _ValuesCountryStats{} + + if err = json.Unmarshal(bytes, &varValuesCountryStats); err == nil { + *o = ValuesCountryStats(varValuesCountryStats) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "region") + delete(additionalProperties, "region_chr") + delete(additionalProperties, "region_error_rate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesCountryStats is a helper abstraction for handling nullable valuescountrystats types. +type NullableValuesCountryStats struct { + value *ValuesCountryStats + isSet bool +} + +// Get returns the value. +func (v NullableValuesCountryStats) Get() *ValuesCountryStats { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesCountryStats) Set(val *ValuesCountryStats) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesCountryStats) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesCountryStats) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesCountryStats returns a pointer to a new instance of NullableValuesCountryStats. +func NewNullableValuesCountryStats(val *ValuesCountryStats) *NullableValuesCountryStats { + return &NullableValuesCountryStats{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 NullableValuesCountryStats) 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 *NullableValuesCountryStats) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_duration.go b/fastly/model_values_duration.go new file mode 100644 index 0000000..9397add --- /dev/null +++ b/fastly/model_values_duration.go @@ -0,0 +1,231 @@ +// 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" +) + +// ValuesDuration struct for ValuesDuration +type ValuesDuration struct { + // The average time in seconds to respond to requests to the URL in the current dimension. + AverageResponseTime *float32 `json:"average_response_time,omitempty"` + // The P95 time in seconds to respond to requests to the URL in the current dimension. + P95ResponseTime *float32 `json:"p95_response_time,omitempty"` + // The total percentage of time to respond to all requests to the URL in the current dimension. + ResponseTimePercentage *float32 `json:"response_time_percentage,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesDuration ValuesDuration + +// NewValuesDuration instantiates a new ValuesDuration 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 NewValuesDuration() *ValuesDuration { + this := ValuesDuration{} + return &this +} + +// NewValuesDurationWithDefaults instantiates a new ValuesDuration 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 NewValuesDurationWithDefaults() *ValuesDuration { + this := ValuesDuration{} + return &this +} + +// GetAverageResponseTime returns the AverageResponseTime field value if set, zero value otherwise. +func (o *ValuesDuration) GetAverageResponseTime() float32 { + if o == nil || o.AverageResponseTime == nil { + var ret float32 + return ret + } + return *o.AverageResponseTime +} + +// GetAverageResponseTimeOk returns a tuple with the AverageResponseTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesDuration) GetAverageResponseTimeOk() (*float32, bool) { + if o == nil || o.AverageResponseTime == nil { + return nil, false + } + return o.AverageResponseTime, true +} + +// HasAverageResponseTime returns a boolean if a field has been set. +func (o *ValuesDuration) HasAverageResponseTime() bool { + if o != nil && o.AverageResponseTime != nil { + return true + } + + return false +} + +// SetAverageResponseTime gets a reference to the given float32 and assigns it to the AverageResponseTime field. +func (o *ValuesDuration) SetAverageResponseTime(v float32) { + o.AverageResponseTime = &v +} + +// GetP95ResponseTime returns the P95ResponseTime field value if set, zero value otherwise. +func (o *ValuesDuration) GetP95ResponseTime() float32 { + if o == nil || o.P95ResponseTime == nil { + var ret float32 + return ret + } + return *o.P95ResponseTime +} + +// GetP95ResponseTimeOk returns a tuple with the P95ResponseTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesDuration) GetP95ResponseTimeOk() (*float32, bool) { + if o == nil || o.P95ResponseTime == nil { + return nil, false + } + return o.P95ResponseTime, true +} + +// HasP95ResponseTime returns a boolean if a field has been set. +func (o *ValuesDuration) HasP95ResponseTime() bool { + if o != nil && o.P95ResponseTime != nil { + return true + } + + return false +} + +// SetP95ResponseTime gets a reference to the given float32 and assigns it to the P95ResponseTime field. +func (o *ValuesDuration) SetP95ResponseTime(v float32) { + o.P95ResponseTime = &v +} + +// GetResponseTimePercentage returns the ResponseTimePercentage field value if set, zero value otherwise. +func (o *ValuesDuration) GetResponseTimePercentage() float32 { + if o == nil || o.ResponseTimePercentage == nil { + var ret float32 + return ret + } + return *o.ResponseTimePercentage +} + +// GetResponseTimePercentageOk returns a tuple with the ResponseTimePercentage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesDuration) GetResponseTimePercentageOk() (*float32, bool) { + if o == nil || o.ResponseTimePercentage == nil { + return nil, false + } + return o.ResponseTimePercentage, true +} + +// HasResponseTimePercentage returns a boolean if a field has been set. +func (o *ValuesDuration) HasResponseTimePercentage() bool { + if o != nil && o.ResponseTimePercentage != nil { + return true + } + + return false +} + +// SetResponseTimePercentage gets a reference to the given float32 and assigns it to the ResponseTimePercentage field. +func (o *ValuesDuration) SetResponseTimePercentage(v float32) { + o.ResponseTimePercentage = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesDuration) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.AverageResponseTime != nil { + toSerialize["average_response_time"] = o.AverageResponseTime + } + if o.P95ResponseTime != nil { + toSerialize["p95_response_time"] = o.P95ResponseTime + } + if o.ResponseTimePercentage != nil { + toSerialize["response_time_percentage"] = o.ResponseTimePercentage + } + + 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 *ValuesDuration) UnmarshalJSON(bytes []byte) (err error) { + varValuesDuration := _ValuesDuration{} + + if err = json.Unmarshal(bytes, &varValuesDuration); err == nil { + *o = ValuesDuration(varValuesDuration) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "average_response_time") + delete(additionalProperties, "p95_response_time") + delete(additionalProperties, "response_time_percentage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesDuration is a helper abstraction for handling nullable valuesduration types. +type NullableValuesDuration struct { + value *ValuesDuration + isSet bool +} + +// Get returns the value. +func (v NullableValuesDuration) Get() *ValuesDuration { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesDuration) Set(val *ValuesDuration) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesDuration) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesDuration) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesDuration returns a pointer to a new instance of NullableValuesDuration. +func NewNullableValuesDuration(val *ValuesDuration) *NullableValuesDuration { + return &NullableValuesDuration{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 NullableValuesDuration) 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 *NullableValuesDuration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_misses.go b/fastly/model_values_misses.go new file mode 100644 index 0000000..65d5414 --- /dev/null +++ b/fastly/model_values_misses.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" +) + +// ValuesMisses struct for ValuesMisses +type ValuesMisses struct { + // The miss rate for requests to the URL in the current dimension. + MissRate *float32 `json:"miss_rate,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesMisses ValuesMisses + +// NewValuesMisses instantiates a new ValuesMisses 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 NewValuesMisses() *ValuesMisses { + this := ValuesMisses{} + return &this +} + +// NewValuesMissesWithDefaults instantiates a new ValuesMisses 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 NewValuesMissesWithDefaults() *ValuesMisses { + this := ValuesMisses{} + return &this +} + +// GetMissRate returns the MissRate field value if set, zero value otherwise. +func (o *ValuesMisses) GetMissRate() float32 { + if o == nil || o.MissRate == nil { + var ret float32 + return ret + } + return *o.MissRate +} + +// GetMissRateOk returns a tuple with the MissRate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesMisses) GetMissRateOk() (*float32, bool) { + if o == nil || o.MissRate == nil { + return nil, false + } + return o.MissRate, true +} + +// HasMissRate returns a boolean if a field has been set. +func (o *ValuesMisses) HasMissRate() bool { + if o != nil && o.MissRate != nil { + return true + } + + return false +} + +// SetMissRate gets a reference to the given float32 and assigns it to the MissRate field. +func (o *ValuesMisses) SetMissRate(v float32) { + o.MissRate = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesMisses) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.MissRate != nil { + toSerialize["miss_rate"] = o.MissRate + } + + 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 *ValuesMisses) UnmarshalJSON(bytes []byte) (err error) { + varValuesMisses := _ValuesMisses{} + + if err = json.Unmarshal(bytes, &varValuesMisses); err == nil { + *o = ValuesMisses(varValuesMisses) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "miss_rate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesMisses is a helper abstraction for handling nullable valuesmisses types. +type NullableValuesMisses struct { + value *ValuesMisses + isSet bool +} + +// Get returns the value. +func (v NullableValuesMisses) Get() *ValuesMisses { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesMisses) Set(val *ValuesMisses) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesMisses) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesMisses) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesMisses returns a pointer to a new instance of NullableValuesMisses. +func NewNullableValuesMisses(val *ValuesMisses) *NullableValuesMisses { + return &NullableValuesMisses{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 NullableValuesMisses) 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 *NullableValuesMisses) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_rate.go b/fastly/model_values_rate.go new file mode 100644 index 0000000..c71d135 --- /dev/null +++ b/fastly/model_values_rate.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" +) + +// ValuesRate struct for ValuesRate +type ValuesRate struct { + // The percentage of requests matching the value in the current dimension. + Rate *float32 `json:"rate,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesRate ValuesRate + +// NewValuesRate instantiates a new ValuesRate 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 NewValuesRate() *ValuesRate { + this := ValuesRate{} + return &this +} + +// NewValuesRateWithDefaults instantiates a new ValuesRate 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 NewValuesRateWithDefaults() *ValuesRate { + this := ValuesRate{} + return &this +} + +// GetRate returns the Rate field value if set, zero value otherwise. +func (o *ValuesRate) GetRate() float32 { + if o == nil || o.Rate == nil { + var ret float32 + return ret + } + return *o.Rate +} + +// GetRateOk returns a tuple with the Rate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesRate) GetRateOk() (*float32, bool) { + if o == nil || o.Rate == nil { + return nil, false + } + return o.Rate, true +} + +// HasRate returns a boolean if a field has been set. +func (o *ValuesRate) HasRate() bool { + if o != nil && o.Rate != nil { + return true + } + + return false +} + +// SetRate gets a reference to the given float32 and assigns it to the Rate field. +func (o *ValuesRate) SetRate(v float32) { + o.Rate = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesRate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.Rate != nil { + toSerialize["rate"] = o.Rate + } + + 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 *ValuesRate) UnmarshalJSON(bytes []byte) (err error) { + varValuesRate := _ValuesRate{} + + if err = json.Unmarshal(bytes, &varValuesRate); err == nil { + *o = ValuesRate(varValuesRate) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "rate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesRate is a helper abstraction for handling nullable valuesrate types. +type NullableValuesRate struct { + value *ValuesRate + isSet bool +} + +// Get returns the value. +func (v NullableValuesRate) Get() *ValuesRate { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesRate) Set(val *ValuesRate) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesRate) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesRate) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesRate returns a pointer to a new instance of NullableValuesRate. +func NewNullableValuesRate(val *ValuesRate) *NullableValuesRate { + return &NullableValuesRate{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 NullableValuesRate) 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 *NullableValuesRate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_requests.go b/fastly/model_values_requests.go new file mode 100644 index 0000000..89f382a --- /dev/null +++ b/fastly/model_values_requests.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" +) + +// ValuesRequests struct for ValuesRequests +type ValuesRequests struct { + // The percentage of all requests made to the URL in the current dimension. + RequestPercentage *float32 `json:"request_percentage,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesRequests ValuesRequests + +// NewValuesRequests instantiates a new ValuesRequests 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 NewValuesRequests() *ValuesRequests { + this := ValuesRequests{} + return &this +} + +// NewValuesRequestsWithDefaults instantiates a new ValuesRequests 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 NewValuesRequestsWithDefaults() *ValuesRequests { + this := ValuesRequests{} + return &this +} + +// GetRequestPercentage returns the RequestPercentage field value if set, zero value otherwise. +func (o *ValuesRequests) GetRequestPercentage() float32 { + if o == nil || o.RequestPercentage == nil { + var ret float32 + return ret + } + return *o.RequestPercentage +} + +// GetRequestPercentageOk returns a tuple with the RequestPercentage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesRequests) GetRequestPercentageOk() (*float32, bool) { + if o == nil || o.RequestPercentage == nil { + return nil, false + } + return o.RequestPercentage, true +} + +// HasRequestPercentage returns a boolean if a field has been set. +func (o *ValuesRequests) HasRequestPercentage() bool { + if o != nil && o.RequestPercentage != nil { + return true + } + + return false +} + +// SetRequestPercentage gets a reference to the given float32 and assigns it to the RequestPercentage field. +func (o *ValuesRequests) SetRequestPercentage(v float32) { + o.RequestPercentage = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesRequests) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.RequestPercentage != nil { + toSerialize["request_percentage"] = o.RequestPercentage + } + + 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 *ValuesRequests) UnmarshalJSON(bytes []byte) (err error) { + varValuesRequests := _ValuesRequests{} + + if err = json.Unmarshal(bytes, &varValuesRequests); err == nil { + *o = ValuesRequests(varValuesRequests) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "request_percentage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesRequests is a helper abstraction for handling nullable valuesrequests types. +type NullableValuesRequests struct { + value *ValuesRequests + isSet bool +} + +// Get returns the value. +func (v NullableValuesRequests) Get() *ValuesRequests { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesRequests) Set(val *ValuesRequests) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesRequests) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesRequests) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesRequests returns a pointer to a new instance of NullableValuesRequests. +func NewNullableValuesRequests(val *ValuesRequests) *NullableValuesRequests { + return &NullableValuesRequests{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 NullableValuesRequests) 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 *NullableValuesRequests) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/fastly/model_values_status_codes.go b/fastly/model_values_status_codes.go new file mode 100644 index 0000000..f1a5211 --- /dev/null +++ b/fastly/model_values_status_codes.go @@ -0,0 +1,231 @@ +// 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" +) + +// ValuesStatusCodes struct for ValuesStatusCodes +type ValuesStatusCodes struct { + // The HTTP request path. + URL *string `json:"url,omitempty"` + // The URL accounts for this percentage of the status code in this dimension. + RatePerStatus *float32 `json:"rate_per_status,omitempty"` + // The rate at which the status code in this dimension occurs for this URL. + RatePerURL *float32 `json:"rate_per_url,omitempty"` + AdditionalProperties map[string]any +} + +type _ValuesStatusCodes ValuesStatusCodes + +// NewValuesStatusCodes instantiates a new ValuesStatusCodes 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 NewValuesStatusCodes() *ValuesStatusCodes { + this := ValuesStatusCodes{} + return &this +} + +// NewValuesStatusCodesWithDefaults instantiates a new ValuesStatusCodes 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 NewValuesStatusCodesWithDefaults() *ValuesStatusCodes { + this := ValuesStatusCodes{} + return &this +} + +// GetURL returns the URL field value if set, zero value otherwise. +func (o *ValuesStatusCodes) GetURL() string { + if o == nil || o.URL == nil { + var ret string + return ret + } + return *o.URL +} + +// GetURLOk returns a tuple with the URL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesStatusCodes) GetURLOk() (*string, bool) { + if o == nil || o.URL == nil { + return nil, false + } + return o.URL, true +} + +// HasURL returns a boolean if a field has been set. +func (o *ValuesStatusCodes) HasURL() bool { + if o != nil && o.URL != nil { + return true + } + + return false +} + +// SetURL gets a reference to the given string and assigns it to the URL field. +func (o *ValuesStatusCodes) SetURL(v string) { + o.URL = &v +} + +// GetRatePerStatus returns the RatePerStatus field value if set, zero value otherwise. +func (o *ValuesStatusCodes) GetRatePerStatus() float32 { + if o == nil || o.RatePerStatus == nil { + var ret float32 + return ret + } + return *o.RatePerStatus +} + +// GetRatePerStatusOk returns a tuple with the RatePerStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesStatusCodes) GetRatePerStatusOk() (*float32, bool) { + if o == nil || o.RatePerStatus == nil { + return nil, false + } + return o.RatePerStatus, true +} + +// HasRatePerStatus returns a boolean if a field has been set. +func (o *ValuesStatusCodes) HasRatePerStatus() bool { + if o != nil && o.RatePerStatus != nil { + return true + } + + return false +} + +// SetRatePerStatus gets a reference to the given float32 and assigns it to the RatePerStatus field. +func (o *ValuesStatusCodes) SetRatePerStatus(v float32) { + o.RatePerStatus = &v +} + +// GetRatePerURL returns the RatePerURL field value if set, zero value otherwise. +func (o *ValuesStatusCodes) GetRatePerURL() float32 { + if o == nil || o.RatePerURL == nil { + var ret float32 + return ret + } + return *o.RatePerURL +} + +// GetRatePerURLOk returns a tuple with the RatePerURL field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValuesStatusCodes) GetRatePerURLOk() (*float32, bool) { + if o == nil || o.RatePerURL == nil { + return nil, false + } + return o.RatePerURL, true +} + +// HasRatePerURL returns a boolean if a field has been set. +func (o *ValuesStatusCodes) HasRatePerURL() bool { + if o != nil && o.RatePerURL != nil { + return true + } + + return false +} + +// SetRatePerURL gets a reference to the given float32 and assigns it to the RatePerURL field. +func (o *ValuesStatusCodes) SetRatePerURL(v float32) { + o.RatePerURL = &v +} + +// MarshalJSON implements the json.Marshaler interface. +// Marshaler is the interface implemented by types that can marshal themselves into valid JSON. +func (o ValuesStatusCodes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]any{} + if o.URL != nil { + toSerialize["url"] = o.URL + } + if o.RatePerStatus != nil { + toSerialize["rate_per_status"] = o.RatePerStatus + } + if o.RatePerURL != nil { + toSerialize["rate_per_url"] = o.RatePerURL + } + + 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 *ValuesStatusCodes) UnmarshalJSON(bytes []byte) (err error) { + varValuesStatusCodes := _ValuesStatusCodes{} + + if err = json.Unmarshal(bytes, &varValuesStatusCodes); err == nil { + *o = ValuesStatusCodes(varValuesStatusCodes) + } + + additionalProperties := make(map[string]any) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "url") + delete(additionalProperties, "rate_per_status") + delete(additionalProperties, "rate_per_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +// NullableValuesStatusCodes is a helper abstraction for handling nullable valuesstatuscodes types. +type NullableValuesStatusCodes struct { + value *ValuesStatusCodes + isSet bool +} + +// Get returns the value. +func (v NullableValuesStatusCodes) Get() *ValuesStatusCodes { + return v.value +} + +// Set modifies the value. +func (v *NullableValuesStatusCodes) Set(val *ValuesStatusCodes) { + v.value = val + v.isSet = true +} + +// IsSet indicates if the value was set. +func (v NullableValuesStatusCodes) IsSet() bool { + return v.isSet +} + +// Unset removes the value. +func (v *NullableValuesStatusCodes) Unset() { + v.value = nil + v.isSet = false +} + +// NewNullableValuesStatusCodes returns a pointer to a new instance of NullableValuesStatusCodes. +func NewNullableValuesStatusCodes(val *ValuesStatusCodes) *NullableValuesStatusCodes { + return &NullableValuesStatusCodes{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 NullableValuesStatusCodes) 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 *NullableValuesStatusCodes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sig.json b/sig.json index 12052e1..4729e57 100644 --- a/sig.json +++ b/sig.json @@ -1 +1 @@ -{"G": "dbe8e713", "D": "4061d4ec"} +{"G": "8147d17d", "D": "c00fd741"}