diff --git a/services/cdn/api_default.go b/services/cdn/api_default.go index a67df7451..9fe281a1a 100644 --- a/services/cdn/api_default.go +++ b/services/cdn/api_default.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -24,6 +25,7 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApi interface { /* CreateDistribution Create new distribution @@ -32,6 +34,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @return ApiCreateDistributionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest /* @@ -41,6 +45,7 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @return CreateDistributionResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateDistributionExecute(ctx context.Context, projectId string) (*CreateDistributionResponse, error) /* @@ -53,6 +58,8 @@ type DefaultApi interface { @param distributionId @param domain @return ApiDeleteCustomDomainRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest /* @@ -64,6 +71,7 @@ type DefaultApi interface { @param domain @return DeleteCustomDomainResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*DeleteCustomDomainResponse, error) /* @@ -75,6 +83,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @param distributionId @return ApiDeleteDistributionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest /* @@ -85,6 +95,7 @@ type DefaultApi interface { @param distributionId @return DeleteDistributionResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteDistributionExecute(ctx context.Context, projectId string, distributionId string) (*DeleteDistributionResponse, error) /* @@ -109,6 +120,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @param distributionId @return ApiFindCachePathsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest /* @@ -119,6 +132,7 @@ type DefaultApi interface { @param distributionId @return FindCachePathsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ FindCachePathsExecute(ctx context.Context, projectId string, distributionId string) (*FindCachePathsResponse, error) /* @@ -133,6 +147,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @param distributionId @return ApiGetCacheInfoRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest /* @@ -143,6 +159,7 @@ type DefaultApi interface { @param distributionId @return GetCacheInfoResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetCacheInfoExecute(ctx context.Context, projectId string, distributionId string) (*GetCacheInfoResponse, error) /* @@ -155,6 +172,8 @@ type DefaultApi interface { @param distributionId @param domain @return ApiGetCustomDomainRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest /* @@ -166,6 +185,7 @@ type DefaultApi interface { @param domain @return GetCustomDomainResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*GetCustomDomainResponse, error) /* @@ -176,6 +196,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @param distributionId @return ApiGetDistributionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest /* @@ -186,6 +208,7 @@ type DefaultApi interface { @param distributionId @return GetDistributionResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetDistributionExecute(ctx context.Context, projectId string, distributionId string) (*GetDistributionResponse, error) /* @@ -195,6 +218,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @param distributionId Your CDN distribution Id @return ApiGetLogsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest /* @@ -205,6 +230,7 @@ type DefaultApi interface { @param distributionId Your CDN distribution Id @return GetLogsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetLogsExecute(ctx context.Context, projectId string, distributionId string) (*GetLogsResponse, error) /* @@ -214,6 +240,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project ID. @param distributionId Your CDN distribution ID. @return ApiGetLogsSearchFiltersRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest /* @@ -224,6 +252,7 @@ type DefaultApi interface { @param distributionId Your CDN distribution ID. @return GetLogsSearchFiltersResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetLogsSearchFiltersExecute(ctx context.Context, projectId string, distributionId string) (*GetLogsSearchFiltersResponse, error) /* @@ -245,6 +274,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @param distributionId @return ApiGetStatisticsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest /* @@ -255,6 +286,7 @@ type DefaultApi interface { @param distributionId @return GetStatisticsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetStatisticsExecute(ctx context.Context, projectId string, distributionId string) (*GetStatisticsResponse, error) /* @@ -266,6 +298,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @return ApiListDistributionsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest /* @@ -275,6 +309,7 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @return ListDistributionsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListDistributionsExecute(ctx context.Context, projectId string) (*ListDistributionsResponse, error) /* @@ -284,6 +319,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @return ApiListWafCollectionsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest /* @@ -293,6 +330,7 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @return ListWafCollectionsResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListWafCollectionsExecute(ctx context.Context, projectId string) (*ListWafCollectionsResponse, error) /* @@ -303,6 +341,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @param distributionId @return ApiPatchDistributionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest /* @@ -313,6 +353,7 @@ type DefaultApi interface { @param distributionId @return PatchDistributionResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PatchDistributionExecute(ctx context.Context, projectId string, distributionId string) (*PatchDistributionResponse, error) /* @@ -325,6 +366,8 @@ type DefaultApi interface { @param projectId Your STACKIT Project Id @param distributionId @return ApiPurgeCacheRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest /* @@ -335,6 +378,7 @@ type DefaultApi interface { @param distributionId @return map[string]interface{} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PurgeCacheExecute(ctx context.Context, projectId string, distributionId string) (map[string]interface{}, error) /* @@ -347,6 +391,8 @@ type DefaultApi interface { @param distributionId @param domain @return ApiPutCustomDomainRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest /* @@ -358,123 +404,185 @@ type DefaultApi interface { @param domain @return PutCustomDomainResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PutCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*PutCustomDomainResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateDistributionRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*CreateDistributionResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteCustomDomainRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead IntentId(intentId string) ApiDeleteCustomDomainRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*DeleteCustomDomainResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteDistributionRequest interface { // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead IntentId(intentId string) ApiDeleteDistributionRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*DeleteDistributionResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiFindCachePathsRequest interface { // A substring of the search query. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Path(path string) ApiFindCachePathsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*FindCachePathsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetCacheInfoRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PurgePath(purgePath string) ApiGetCacheInfoRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetCacheInfoResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetCustomDomainRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetCustomDomainResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetDistributionRequest interface { // If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WithWafStatus(withWafStatus bool) ApiGetDistributionRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetDistributionResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetLogsRequest interface { // the start of the time range for which logs should be returned + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead From(from time.Time) ApiGetLogsRequest // the end of the time range for which logs should be returned. If not specified, \"now\" is used. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead To(to time.Time) ApiGetLogsRequest // Quantifies how many log entries should be returned on this page. Must be a natural number between 1 and 1000 (inclusive) + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PageSize(pageSize int32) ApiGetLogsRequest // Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PageIdentifier(pageIdentifier string) ApiGetLogsRequest // Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SortBy(sortBy string) ApiGetLogsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SortOrder(sortOrder string) ApiGetLogsRequest // If this is set then only log entries with the chosen WAF rule action/outcome are returned. Specifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where a WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged but the request not blocked + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WafAction(wafAction WAFRuleAction) ApiGetLogsRequest // Filters by the CDN data center region that served the request. Can be combined with other filters + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead DataCenterRegion(dataCenterRegion string) ApiGetLogsRequest // Filters by the originating country of the user request. Can be combined with other filters + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead RequestCountryCode(requestCountryCode string) ApiGetLogsRequest // Filters by the HTTP status code returned to the client. Can be combined with other filters + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead StatusCode(statusCode int32) ApiGetLogsRequest // Filters based on whether the request was served from the CDN cache. Can be combined with other filters + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CacheHit(cacheHit bool) ApiGetLogsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetLogsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetLogsSearchFiltersRequest interface { // Optional search string. Will search the **values** for the text input. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Filter(filter string) ApiGetLogsSearchFiltersRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetLogsSearchFiltersResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetStatisticsRequest interface { // the start of the time range for which statistics should be returned + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead From(from time.Time) ApiGetStatisticsRequest // the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead To(to time.Time) ApiGetStatisticsRequest // Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Interval(interval string) ApiGetStatisticsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetStatisticsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListDistributionsRequest interface { // Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PageSize(pageSize int32) ApiListDistributionsRequest // If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WithWafStatus(withWafStatus bool) ApiListDistributionsRequest // Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PageIdentifier(pageIdentifier string) ApiListDistributionsRequest // The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SortBy(sortBy string) ApiListDistributionsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SortOrder(sortOrder string) ApiListDistributionsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListDistributionsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListWafCollectionsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListWafCollectionsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPatchDistributionRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PatchDistributionPayload(patchDistributionPayload PatchDistributionPayload) ApiPatchDistributionRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PatchDistributionResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPurgeCacheRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PurgeCachePayload(purgeCachePayload PurgeCachePayload) ApiPurgeCacheRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (map[string]interface{}, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPutCustomDomainRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PutCustomDomainPayload(putCustomDomainPayload PutCustomDomainPayload) ApiPutCustomDomainRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PutCustomDomainResponse, error) } // DefaultApiService DefaultApi service +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApiService service +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionRequest struct { ctx context.Context apiService *DefaultApiService @@ -482,11 +590,13 @@ type CreateDistributionRequest struct { createDistributionPayload *CreateDistributionPayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateDistributionRequest) CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest { r.createDistributionPayload = &createDistributionPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateDistributionRequest) Execute() (*CreateDistributionResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -636,7 +746,7 @@ func (r CreateDistributionRequest) Execute() (*CreateDistributionResponse, error /* CreateDistribution: Create new distribution -CreateDistribution will create a new CDN distribution +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -650,6 +760,7 @@ func (a *APIClient) CreateDistribution(ctx context.Context, projectId string) Ap } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateDistributionExecute(ctx context.Context, projectId string) (*CreateDistributionResponse, error) { r := CreateDistributionRequest{ apiService: a.defaultApi, @@ -659,6 +770,7 @@ func (a *APIClient) CreateDistributionExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteCustomDomainRequest struct { ctx context.Context apiService *DefaultApiService @@ -668,11 +780,13 @@ type DeleteCustomDomainRequest struct { intentId *string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteCustomDomainRequest) IntentId(intentId string) ApiDeleteCustomDomainRequest { r.intentId = &intentId return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteCustomDomainRequest) Execute() (*DeleteCustomDomainResponse, error) { var ( localVarHTTPMethod = http.MethodDelete @@ -814,7 +928,7 @@ func (r DeleteCustomDomainRequest) Execute() (*DeleteCustomDomainResponse, error /* DeleteCustomDomain: Delete a custom domain -# Removes a custom domain +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -832,6 +946,7 @@ func (a *APIClient) DeleteCustomDomain(ctx context.Context, projectId string, di } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*DeleteCustomDomainResponse, error) { r := DeleteCustomDomainRequest{ apiService: a.defaultApi, @@ -843,6 +958,7 @@ func (a *APIClient) DeleteCustomDomainExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteDistributionRequest struct { ctx context.Context apiService *DefaultApiService @@ -852,12 +968,13 @@ type DeleteDistributionRequest struct { } // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteDistributionRequest) IntentId(intentId string) ApiDeleteDistributionRequest { r.intentId = &intentId return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteDistributionRequest) Execute() (*DeleteDistributionResponse, error) { var ( localVarHTTPMethod = http.MethodDelete @@ -995,7 +1112,7 @@ func (r DeleteDistributionRequest) Execute() (*DeleteDistributionResponse, error /* DeleteDistribution: Delete distribution -DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -1011,6 +1128,7 @@ func (a *APIClient) DeleteDistribution(ctx context.Context, projectId string, di } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteDistributionExecute(ctx context.Context, projectId string, distributionId string) (*DeleteDistributionResponse, error) { r := DeleteDistributionRequest{ apiService: a.defaultApi, @@ -1021,6 +1139,7 @@ func (a *APIClient) DeleteDistributionExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsRequest struct { ctx context.Context apiService *DefaultApiService @@ -1030,12 +1149,13 @@ type FindCachePathsRequest struct { } // A substring of the search query. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r FindCachePathsRequest) Path(path string) ApiFindCachePathsRequest { r.path = &path return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r FindCachePathsRequest) Execute() (*FindCachePathsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1174,20 +1294,7 @@ func (r FindCachePathsRequest) Execute() (*FindCachePathsResponse, error) { /* FindCachePaths: Return Paths that were purged -This returns paths that are present in the cache purging history. -Only substrings of the provided input are returned. -The response is sorted in descending order by the most recent purge. - -So, assuming you have have the following purged for a distribution -- `/test/1` at `2025-01-01` -- `/test/2` at `2025-01-02` -- `/someOtherPath/1` at `2025-01-03` -- `/test/1` at `2025-01-04` -- `/test/3` at `2025-01-05`, -this would return the following paths, in the following order, assuming `/te` was the search parameter: -- `/test/3` -- `/test/1` -- `/test/2` +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -1203,6 +1310,7 @@ func (a *APIClient) FindCachePaths(ctx context.Context, projectId string, distri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) FindCachePathsExecute(ctx context.Context, projectId string, distributionId string) (*FindCachePathsResponse, error) { r := FindCachePathsRequest{ apiService: a.defaultApi, @@ -1213,6 +1321,7 @@ func (a *APIClient) FindCachePathsExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoRequest struct { ctx context.Context apiService *DefaultApiService @@ -1221,11 +1330,13 @@ type GetCacheInfoRequest struct { purgePath *string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetCacheInfoRequest) PurgePath(purgePath string) ApiGetCacheInfoRequest { r.purgePath = &purgePath return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetCacheInfoRequest) Execute() (*GetCacheInfoResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1363,10 +1474,7 @@ func (r GetCacheInfoRequest) Execute() (*GetCacheInfoResponse, error) { /* GetCacheInfo: Get Infos about the Caching State -Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. - -If (and only if) you provide the path query parameter, the history will also contain granular cache purges. -The request will not fail if no data about a path is found. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -1382,6 +1490,7 @@ func (a *APIClient) GetCacheInfo(ctx context.Context, projectId string, distribu } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetCacheInfoExecute(ctx context.Context, projectId string, distributionId string) (*GetCacheInfoResponse, error) { r := GetCacheInfoRequest{ apiService: a.defaultApi, @@ -1392,6 +1501,7 @@ func (a *APIClient) GetCacheInfoExecute(ctx context.Context, projectId string, d return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainRequest struct { ctx context.Context apiService *DefaultApiService @@ -1400,6 +1510,7 @@ type GetCustomDomainRequest struct { domain string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetCustomDomainRequest) Execute() (*GetCustomDomainResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1549,7 +1660,7 @@ func (r GetCustomDomainRequest) Execute() (*GetCustomDomainResponse, error) { /* GetCustomDomain: Retrieve a specific custom domain -# Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -1567,6 +1678,7 @@ func (a *APIClient) GetCustomDomain(ctx context.Context, projectId string, distr } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*GetCustomDomainResponse, error) { r := GetCustomDomainRequest{ apiService: a.defaultApi, @@ -1578,6 +1690,7 @@ func (a *APIClient) GetCustomDomainExecute(ctx context.Context, projectId string return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDistributionRequest struct { ctx context.Context apiService *DefaultApiService @@ -1587,12 +1700,13 @@ type GetDistributionRequest struct { } // If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetDistributionRequest) WithWafStatus(withWafStatus bool) ApiGetDistributionRequest { r.withWafStatus = &withWafStatus return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetDistributionRequest) Execute() (*GetDistributionResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1741,7 +1855,7 @@ func (r GetDistributionRequest) Execute() (*GetDistributionResponse, error) { /* GetDistribution: Get distribution by Id -This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -1757,6 +1871,7 @@ func (a *APIClient) GetDistribution(ctx context.Context, projectId string, distr } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetDistributionExecute(ctx context.Context, projectId string, distributionId string) (*GetDistributionResponse, error) { r := GetDistributionRequest{ apiService: a.defaultApi, @@ -1767,6 +1882,7 @@ func (a *APIClient) GetDistributionExecute(ctx context.Context, projectId string return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsRequest struct { ctx context.Context apiService *DefaultApiService @@ -1786,80 +1902,82 @@ type GetLogsRequest struct { } // the start of the time range for which logs should be returned - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) From(from time.Time) ApiGetLogsRequest { r.from = &from return r } // the end of the time range for which logs should be returned. If not specified, \"now\" is used. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) To(to time.Time) ApiGetLogsRequest { r.to = &to return r } // Quantifies how many log entries should be returned on this page. Must be a natural number between 1 and 1000 (inclusive) - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) PageSize(pageSize int32) ApiGetLogsRequest { r.pageSize = &pageSize return r } // Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsRequest { r.pageIdentifier = &pageIdentifier return r } // Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) SortBy(sortBy string) ApiGetLogsRequest { r.sortBy = &sortBy return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) SortOrder(sortOrder string) ApiGetLogsRequest { r.sortOrder = &sortOrder return r } // If this is set then only log entries with the chosen WAF rule action/outcome are returned. Specifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where a WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged but the request not blocked - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) WafAction(wafAction WAFRuleAction) ApiGetLogsRequest { r.wafAction = &wafAction return r } // Filters by the CDN data center region that served the request. Can be combined with other filters - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) DataCenterRegion(dataCenterRegion string) ApiGetLogsRequest { r.dataCenterRegion = &dataCenterRegion return r } // Filters by the originating country of the user request. Can be combined with other filters - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) RequestCountryCode(requestCountryCode string) ApiGetLogsRequest { r.requestCountryCode = &requestCountryCode return r } // Filters by the HTTP status code returned to the client. Can be combined with other filters - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) StatusCode(statusCode int32) ApiGetLogsRequest { r.statusCode = &statusCode return r } // Filters based on whether the request was served from the CDN cache. Can be combined with other filters - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) CacheHit(cacheHit bool) ApiGetLogsRequest { r.cacheHit = &cacheHit return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsRequest) Execute() (*GetLogsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2026,6 +2144,7 @@ func (r GetLogsRequest) Execute() (*GetLogsResponse, error) { /* GetLogs: Retrieve distribution logs +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -2041,6 +2160,7 @@ func (a *APIClient) GetLogs(ctx context.Context, projectId string, distributionI } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetLogsExecute(ctx context.Context, projectId string, distributionId string) (*GetLogsResponse, error) { r := GetLogsRequest{ apiService: a.defaultApi, @@ -2051,6 +2171,7 @@ func (a *APIClient) GetLogsExecute(ctx context.Context, projectId string, distri return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersRequest struct { ctx context.Context apiService *DefaultApiService @@ -2060,12 +2181,13 @@ type GetLogsSearchFiltersRequest struct { } // Optional search string. Will search the **values** for the text input. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsSearchFiltersRequest) Filter(filter string) ApiGetLogsSearchFiltersRequest { r.filter = &filter return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetLogsSearchFiltersRequest) Execute() (*GetLogsSearchFiltersResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2213,6 +2335,7 @@ func (r GetLogsSearchFiltersRequest) Execute() (*GetLogsSearchFiltersResponse, e /* GetLogsSearchFilters: Get relevant search filters for this distribution based on user input. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project ID. @@ -2228,6 +2351,7 @@ func (a *APIClient) GetLogsSearchFilters(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetLogsSearchFiltersExecute(ctx context.Context, projectId string, distributionId string) (*GetLogsSearchFiltersResponse, error) { r := GetLogsSearchFiltersRequest{ apiService: a.defaultApi, @@ -2238,6 +2362,7 @@ func (a *APIClient) GetLogsSearchFiltersExecute(ctx context.Context, projectId s return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetStatisticsRequest struct { ctx context.Context apiService *DefaultApiService @@ -2249,26 +2374,27 @@ type GetStatisticsRequest struct { } // the start of the time range for which statistics should be returned - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetStatisticsRequest) From(from time.Time) ApiGetStatisticsRequest { r.from = &from return r } // the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { r.to = &to return r } // Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetStatisticsRequest) Interval(interval string) ApiGetStatisticsRequest { r.interval = &interval return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetStatisticsRequest) Execute() (*GetStatisticsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2413,17 +2539,7 @@ func (r GetStatisticsRequest) Execute() (*GetStatisticsResponse, error) { /* GetStatistics: Retrieve the statistics of a distribution -Returns the statistics of the distribution in the given -time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. -In case no statistics for a time interval exist, no record is returned. -The time range for which statistics should be returned can be configured using query parameters. - -Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. - -**Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. - -The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. -Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -2439,6 +2555,7 @@ func (a *APIClient) GetStatistics(ctx context.Context, projectId string, distrib } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetStatisticsExecute(ctx context.Context, projectId string, distributionId string) (*GetStatisticsResponse, error) { r := GetStatisticsRequest{ apiService: a.defaultApi, @@ -2449,6 +2566,7 @@ func (a *APIClient) GetStatisticsExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDistributionsRequest struct { ctx context.Context apiService *DefaultApiService @@ -2461,38 +2579,40 @@ type ListDistributionsRequest struct { } // Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDistributionsRequest) PageSize(pageSize int32) ApiListDistributionsRequest { r.pageSize = &pageSize return r } // If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDistributionsRequest) WithWafStatus(withWafStatus bool) ApiListDistributionsRequest { r.withWafStatus = &withWafStatus return r } // Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiListDistributionsRequest { r.pageIdentifier = &pageIdentifier return r } // The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { r.sortBy = &sortBy return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDistributionsRequest) SortOrder(sortOrder string) ApiListDistributionsRequest { r.sortOrder = &sortOrder return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListDistributionsRequest) Execute() (*ListDistributionsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2641,8 +2761,7 @@ func (r ListDistributionsRequest) Execute() (*ListDistributionsResponse, error) /* ListDistributions: List all distributions belonging to a specific project -ListDistributions returns a list of all CDN distributions associated with -a given project, ordered by their distribution Id. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -2656,6 +2775,7 @@ func (a *APIClient) ListDistributions(ctx context.Context, projectId string) Api } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListDistributionsExecute(ctx context.Context, projectId string) (*ListDistributionsResponse, error) { r := ListDistributionsRequest{ apiService: a.defaultApi, @@ -2665,12 +2785,14 @@ func (a *APIClient) ListDistributionsExecute(ctx context.Context, projectId stri return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListWafCollectionsRequest struct { ctx context.Context apiService *DefaultApiService projectId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListWafCollectionsRequest) Execute() (*ListWafCollectionsResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2804,7 +2926,7 @@ func (r ListWafCollectionsRequest) Execute() (*ListWafCollectionsResponse, error /* ListWafCollections: List all WAF rule collections of the project -Returns all WAF rule collections available to the project +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -2818,6 +2940,7 @@ func (a *APIClient) ListWafCollections(ctx context.Context, projectId string) Ap } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListWafCollectionsExecute(ctx context.Context, projectId string) (*ListWafCollectionsResponse, error) { r := ListWafCollectionsRequest{ apiService: a.defaultApi, @@ -2827,6 +2950,7 @@ func (a *APIClient) ListWafCollectionsExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionRequest struct { ctx context.Context apiService *DefaultApiService @@ -2835,11 +2959,13 @@ type PatchDistributionRequest struct { patchDistributionPayload *PatchDistributionPayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PatchDistributionRequest) PatchDistributionPayload(patchDistributionPayload PatchDistributionPayload) ApiPatchDistributionRequest { r.patchDistributionPayload = &patchDistributionPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PatchDistributionRequest) Execute() (*PatchDistributionResponse, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -2976,7 +3102,7 @@ func (r PatchDistributionRequest) Execute() (*PatchDistributionResponse, error) /* PatchDistribution: Update existing distribution -Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -2992,6 +3118,7 @@ func (a *APIClient) PatchDistribution(ctx context.Context, projectId string, dis } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) PatchDistributionExecute(ctx context.Context, projectId string, distributionId string) (*PatchDistributionResponse, error) { r := PatchDistributionRequest{ apiService: a.defaultApi, @@ -3002,6 +3129,7 @@ func (a *APIClient) PatchDistributionExecute(ctx context.Context, projectId stri return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PurgeCacheRequest struct { ctx context.Context apiService *DefaultApiService @@ -3010,11 +3138,13 @@ type PurgeCacheRequest struct { purgeCachePayload *PurgeCachePayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PurgeCacheRequest) PurgeCachePayload(purgeCachePayload PurgeCachePayload) ApiPurgeCacheRequest { r.purgeCachePayload = &purgeCachePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PurgeCacheRequest) Execute() (map[string]interface{}, error) { var ( localVarHTTPMethod = http.MethodPost @@ -3151,8 +3281,7 @@ func (r PurgeCacheRequest) Execute() (map[string]interface{}, error) { /* PurgeCache: Clear distribution cache -Clear the cache for this distribution. -All content, regardless of its staleness, will get refetched from the host. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -3168,6 +3297,7 @@ func (a *APIClient) PurgeCache(ctx context.Context, projectId string, distributi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) PurgeCacheExecute(ctx context.Context, projectId string, distributionId string) (map[string]interface{}, error) { r := PurgeCacheRequest{ apiService: a.defaultApi, @@ -3178,6 +3308,7 @@ func (a *APIClient) PurgeCacheExecute(ctx context.Context, projectId string, dis return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainRequest struct { ctx context.Context apiService *DefaultApiService @@ -3187,11 +3318,13 @@ type PutCustomDomainRequest struct { putCustomDomainPayload *PutCustomDomainPayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PutCustomDomainRequest) PutCustomDomainPayload(putCustomDomainPayload PutCustomDomainPayload) ApiPutCustomDomainRequest { r.putCustomDomainPayload = &putCustomDomainPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PutCustomDomainRequest) Execute() (*PutCustomDomainResponse, error) { var ( localVarHTTPMethod = http.MethodPut @@ -3332,7 +3465,7 @@ func (r PutCustomDomainRequest) Execute() (*PutCustomDomainResponse, error) { /* PutCustomDomain: Create or update a custom domain -Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Your STACKIT Project Id @@ -3350,6 +3483,7 @@ func (a *APIClient) PutCustomDomain(ctx context.Context, projectId string, distr } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) PutCustomDomainExecute(ctx context.Context, projectId string, distributionId string, domain string) (*PutCustomDomainResponse, error) { r := PutCustomDomainRequest{ apiService: a.defaultApi, diff --git a/services/cdn/client.go b/services/cdn/client.go index e55ca5c74..d8ff32a85 100644 --- a/services/cdn/client.go +++ b/services/cdn/client.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -44,18 +45,21 @@ var ( // APIClient manages communication with the CDN API API v1.0.0 // In most cases there should be only one, shared, APIClient. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { cfg *config.Configuration common service // Reuse a single struct instead of allocating one for each service on the heap. defaultApi *DefaultApiService } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type service struct { client DefaultApi } // NewAPIClient creates a new API client. // Optionally receives configuration options +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { cfg := NewConfiguration() @@ -144,6 +148,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func ParameterValueToString(obj interface{}, key string) string { if reflect.TypeOf(obj).Kind() != reflect.Ptr { return fmt.Sprintf("%v", obj) @@ -282,6 +287,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (c *APIClient) GetConfig() *config.Configuration { return c.cfg } @@ -592,6 +598,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time diff --git a/services/cdn/configuration.go b/services/cdn/configuration.go index ae590d5e1..3d9b31c6a 100644 --- a/services/cdn/configuration.go +++ b/services/cdn/configuration.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -15,6 +16,7 @@ import ( ) // NewConfiguration returns a new Configuration object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfiguration() *config.Configuration { cfg := &config.Configuration{ DefaultHeader: make(map[string]string), diff --git a/services/cdn/go.mod b/services/cdn/go.mod index 0f589c75d..efa810edf 100644 --- a/services/cdn/go.mod +++ b/services/cdn/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( github.com/google/go-cmp v0.7.0 - github.com/stackitcloud/stackit-sdk-go/core v0.21.1 + github.com/stackitcloud/stackit-sdk-go/core v0.22.0 ) require ( diff --git a/services/cdn/go.sum b/services/cdn/go.sum index ca103c909..195011dd5 100644 --- a/services/cdn/go.sum +++ b/services/cdn/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= diff --git a/services/cdn/model_bucket_backend.go b/services/cdn/model_bucket_backend.go index 2eb8ee844..b15194260 100644 --- a/services/cdn/model_bucket_backend.go +++ b/services/cdn/model_bucket_backend.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BucketBackend{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetBucketUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendGetBucketUrlAttributeTypeOk(arg BucketBackendGetBucketUrlAttributeType) (ret BucketBackendGetBucketUrlRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBucketBackendGetBucketUrlAttributeTypeOk(arg BucketBackendGetBucketUrlAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendGetBucketUrlAttributeType(arg *BucketBackendGetBucketUrlAttributeType, val BucketBackendGetBucketUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetBucketUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetBucketUrlRetType = string /* @@ -43,8 +50,10 @@ type BucketBackendGetBucketUrlRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetRegionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendGetRegionAttributeTypeOk(arg BucketBackendGetRegionAttributeType) (ret BucketBackendGetRegionRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getBucketBackendGetRegionAttributeTypeOk(arg BucketBackendGetRegionAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendGetRegionAttributeType(arg *BucketBackendGetRegionAttributeType, val BucketBackendGetRegionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetRegionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetRegionRetType = string /* @@ -64,8 +77,10 @@ type BucketBackendGetRegionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendGetTypeAttributeTypeOk(arg BucketBackendGetTypeAttributeType) (ret BucketBackendGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -73,14 +88,19 @@ func getBucketBackendGetTypeAttributeTypeOk(arg BucketBackendGetTypeAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendGetTypeAttributeType(arg *BucketBackendGetTypeAttributeType, val BucketBackendGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendGetTypeRetType = string // BucketBackend struct for BucketBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackend struct { // REQUIRED BucketUrl BucketBackendGetBucketUrlAttributeType `json:"bucketUrl" required:"true"` @@ -90,12 +110,14 @@ type BucketBackend struct { Type BucketBackendGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _BucketBackend BucketBackend // NewBucketBackend instantiates a new BucketBackend 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBucketBackend(bucketUrl BucketBackendGetBucketUrlArgType, region BucketBackendGetRegionArgType, types BucketBackendGetTypeArgType) *BucketBackend { this := BucketBackend{} setBucketBackendGetBucketUrlAttributeType(&this.BucketUrl, bucketUrl) @@ -107,12 +129,14 @@ func NewBucketBackend(bucketUrl BucketBackendGetBucketUrlArgType, region BucketB // NewBucketBackendWithDefaults instantiates a new BucketBackend 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBucketBackendWithDefaults() *BucketBackend { this := BucketBackend{} return &this } // GetBucketUrl returns the BucketUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) GetBucketUrl() (ret BucketBackendGetBucketUrlRetType) { ret, _ = o.GetBucketUrlOk() return ret @@ -120,16 +144,19 @@ func (o *BucketBackend) GetBucketUrl() (ret BucketBackendGetBucketUrlRetType) { // GetBucketUrlOk returns a tuple with the BucketUrl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) GetBucketUrlOk() (ret BucketBackendGetBucketUrlRetType, ok bool) { return getBucketBackendGetBucketUrlAttributeTypeOk(o.BucketUrl) } // SetBucketUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) SetBucketUrl(v BucketBackendGetBucketUrlRetType) { setBucketBackendGetBucketUrlAttributeType(&o.BucketUrl, v) } // GetRegion returns the Region field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) GetRegion() (ret BucketBackendGetRegionRetType) { ret, _ = o.GetRegionOk() return ret @@ -137,16 +164,19 @@ func (o *BucketBackend) GetRegion() (ret BucketBackendGetRegionRetType) { // GetRegionOk returns a tuple with the Region field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) GetRegionOk() (ret BucketBackendGetRegionRetType, ok bool) { return getBucketBackendGetRegionAttributeTypeOk(o.Region) } // SetRegion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) SetRegion(v BucketBackendGetRegionRetType) { setBucketBackendGetRegionAttributeType(&o.Region, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) GetType() (ret BucketBackendGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -154,15 +184,18 @@ func (o *BucketBackend) GetType() (ret BucketBackendGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) GetTypeOk() (ret BucketBackendGetTypeRetType, ok bool) { return getBucketBackendGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackend) SetType(v BucketBackendGetTypeRetType) { setBucketBackendGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BucketBackend) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBucketBackendGetBucketUrlAttributeTypeOk(o.BucketUrl); ok { @@ -177,37 +210,45 @@ func (o BucketBackend) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBucketBackend struct { value *BucketBackend isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackend) Get() *BucketBackend { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackend) Set(val *BucketBackend) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackend) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackend) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBucketBackend(val *BucketBackend) *NullableBucketBackend { return &NullableBucketBackend{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackend) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackend) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_bucket_backend_create.go b/services/cdn/model_bucket_backend_create.go index 6b431523d..d27e07fbd 100644 --- a/services/cdn/model_bucket_backend_create.go +++ b/services/cdn/model_bucket_backend_create.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BucketBackendCreate{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetBucketUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendCreateGetBucketUrlAttributeTypeOk(arg BucketBackendCreateGetBucketUrlAttributeType) (ret BucketBackendCreateGetBucketUrlRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBucketBackendCreateGetBucketUrlAttributeTypeOk(arg BucketBackendCreateGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendCreateGetBucketUrlAttributeType(arg *BucketBackendCreateGetBucketUrlAttributeType, val BucketBackendCreateGetBucketUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetBucketUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetBucketUrlRetType = string /* @@ -43,10 +50,16 @@ type BucketBackendCreateGetBucketUrlRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetCredentialsAttributeType = *BucketCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetCredentialsArgType = BucketCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetCredentialsRetType = BucketCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendCreateGetCredentialsAttributeTypeOk(arg BucketBackendCreateGetCredentialsAttributeType) (ret BucketBackendCreateGetCredentialsRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getBucketBackendCreateGetCredentialsAttributeTypeOk(arg BucketBackendCreate return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendCreateGetCredentialsAttributeType(arg *BucketBackendCreateGetCredentialsAttributeType, val BucketBackendCreateGetCredentialsRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setBucketBackendCreateGetCredentialsAttributeType(arg *BucketBackendCreateG */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetRegionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendCreateGetRegionAttributeTypeOk(arg BucketBackendCreateGetRegionAttributeType) (ret BucketBackendCreateGetRegionRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getBucketBackendCreateGetRegionAttributeTypeOk(arg BucketBackendCreateGetRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendCreateGetRegionAttributeType(arg *BucketBackendCreateGetRegionAttributeType, val BucketBackendCreateGetRegionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetRegionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetRegionRetType = string /* @@ -84,8 +104,10 @@ type BucketBackendCreateGetRegionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendCreateGetTypeAttributeTypeOk(arg BucketBackendCreateGetTypeAttributeType) (ret BucketBackendCreateGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -93,14 +115,19 @@ func getBucketBackendCreateGetTypeAttributeTypeOk(arg BucketBackendCreateGetType return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendCreateGetTypeAttributeType(arg *BucketBackendCreateGetTypeAttributeType, val BucketBackendCreateGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreateGetTypeRetType = string // BucketBackendCreate struct for BucketBackendCreate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendCreate struct { // REQUIRED BucketUrl BucketBackendCreateGetBucketUrlAttributeType `json:"bucketUrl" required:"true"` @@ -112,12 +139,14 @@ type BucketBackendCreate struct { Type BucketBackendCreateGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _BucketBackendCreate BucketBackendCreate // NewBucketBackendCreate instantiates a new BucketBackendCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBucketBackendCreate(bucketUrl BucketBackendCreateGetBucketUrlArgType, credentials BucketBackendCreateGetCredentialsArgType, region BucketBackendCreateGetRegionArgType, types BucketBackendCreateGetTypeArgType) *BucketBackendCreate { this := BucketBackendCreate{} setBucketBackendCreateGetBucketUrlAttributeType(&this.BucketUrl, bucketUrl) @@ -130,12 +159,14 @@ func NewBucketBackendCreate(bucketUrl BucketBackendCreateGetBucketUrlArgType, cr // NewBucketBackendCreateWithDefaults instantiates a new BucketBackendCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBucketBackendCreateWithDefaults() *BucketBackendCreate { this := BucketBackendCreate{} return &this } // GetBucketUrl returns the BucketUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) GetBucketUrl() (ret BucketBackendCreateGetBucketUrlRetType) { ret, _ = o.GetBucketUrlOk() return ret @@ -143,16 +174,19 @@ func (o *BucketBackendCreate) GetBucketUrl() (ret BucketBackendCreateGetBucketUr // GetBucketUrlOk returns a tuple with the BucketUrl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) GetBucketUrlOk() (ret BucketBackendCreateGetBucketUrlRetType, ok bool) { return getBucketBackendCreateGetBucketUrlAttributeTypeOk(o.BucketUrl) } // SetBucketUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) SetBucketUrl(v BucketBackendCreateGetBucketUrlRetType) { setBucketBackendCreateGetBucketUrlAttributeType(&o.BucketUrl, v) } // GetCredentials returns the Credentials field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) GetCredentials() (ret BucketBackendCreateGetCredentialsRetType) { ret, _ = o.GetCredentialsOk() return ret @@ -160,16 +194,19 @@ func (o *BucketBackendCreate) GetCredentials() (ret BucketBackendCreateGetCreden // GetCredentialsOk returns a tuple with the Credentials field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) GetCredentialsOk() (ret BucketBackendCreateGetCredentialsRetType, ok bool) { return getBucketBackendCreateGetCredentialsAttributeTypeOk(o.Credentials) } // SetCredentials sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) SetCredentials(v BucketBackendCreateGetCredentialsRetType) { setBucketBackendCreateGetCredentialsAttributeType(&o.Credentials, v) } // GetRegion returns the Region field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) GetRegion() (ret BucketBackendCreateGetRegionRetType) { ret, _ = o.GetRegionOk() return ret @@ -177,16 +214,19 @@ func (o *BucketBackendCreate) GetRegion() (ret BucketBackendCreateGetRegionRetTy // GetRegionOk returns a tuple with the Region field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) GetRegionOk() (ret BucketBackendCreateGetRegionRetType, ok bool) { return getBucketBackendCreateGetRegionAttributeTypeOk(o.Region) } // SetRegion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) SetRegion(v BucketBackendCreateGetRegionRetType) { setBucketBackendCreateGetRegionAttributeType(&o.Region, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) GetType() (ret BucketBackendCreateGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -194,15 +234,18 @@ func (o *BucketBackendCreate) GetType() (ret BucketBackendCreateGetTypeRetType) // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) GetTypeOk() (ret BucketBackendCreateGetTypeRetType, ok bool) { return getBucketBackendCreateGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendCreate) SetType(v BucketBackendCreateGetTypeRetType) { setBucketBackendCreateGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BucketBackendCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBucketBackendCreateGetBucketUrlAttributeTypeOk(o.BucketUrl); ok { @@ -220,37 +263,45 @@ func (o BucketBackendCreate) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBucketBackendCreate struct { value *BucketBackendCreate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackendCreate) Get() *BucketBackendCreate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackendCreate) Set(val *BucketBackendCreate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackendCreate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackendCreate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBucketBackendCreate(val *BucketBackendCreate) *NullableBucketBackendCreate { return &NullableBucketBackendCreate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackendCreate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackendCreate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_bucket_backend_patch.go b/services/cdn/model_bucket_backend_patch.go index bc6a2c405..826af4196 100644 --- a/services/cdn/model_bucket_backend_patch.go +++ b/services/cdn/model_bucket_backend_patch.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BucketBackendPatch{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetBucketUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendPatchGetBucketUrlAttributeTypeOk(arg BucketBackendPatchGetBucketUrlAttributeType) (ret BucketBackendPatchGetBucketUrlRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBucketBackendPatchGetBucketUrlAttributeTypeOk(arg BucketBackendPatchGetB return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendPatchGetBucketUrlAttributeType(arg *BucketBackendPatchGetBucketUrlAttributeType, val BucketBackendPatchGetBucketUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetBucketUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetBucketUrlRetType = string /* @@ -43,10 +50,16 @@ type BucketBackendPatchGetBucketUrlRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetCredentialsAttributeType = *BucketCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetCredentialsArgType = BucketCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetCredentialsRetType = BucketCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendPatchGetCredentialsAttributeTypeOk(arg BucketBackendPatchGetCredentialsAttributeType) (ret BucketBackendPatchGetCredentialsRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getBucketBackendPatchGetCredentialsAttributeTypeOk(arg BucketBackendPatchGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendPatchGetCredentialsAttributeType(arg *BucketBackendPatchGetCredentialsAttributeType, val BucketBackendPatchGetCredentialsRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setBucketBackendPatchGetCredentialsAttributeType(arg *BucketBackendPatchGet */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetRegionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendPatchGetRegionAttributeTypeOk(arg BucketBackendPatchGetRegionAttributeType) (ret BucketBackendPatchGetRegionRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getBucketBackendPatchGetRegionAttributeTypeOk(arg BucketBackendPatchGetRegi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendPatchGetRegionAttributeType(arg *BucketBackendPatchGetRegionAttributeType, val BucketBackendPatchGetRegionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetRegionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetRegionRetType = string /* @@ -84,8 +104,10 @@ type BucketBackendPatchGetRegionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketBackendPatchGetTypeAttributeTypeOk(arg BucketBackendPatchGetTypeAttributeType) (ret BucketBackendPatchGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -93,14 +115,19 @@ func getBucketBackendPatchGetTypeAttributeTypeOk(arg BucketBackendPatchGetTypeAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketBackendPatchGetTypeAttributeType(arg *BucketBackendPatchGetTypeAttributeType, val BucketBackendPatchGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatchGetTypeRetType = string // BucketBackendPatch struct for BucketBackendPatch +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketBackendPatch struct { BucketUrl BucketBackendPatchGetBucketUrlAttributeType `json:"bucketUrl,omitempty"` Credentials BucketBackendPatchGetCredentialsAttributeType `json:"credentials,omitempty"` @@ -109,12 +136,14 @@ type BucketBackendPatch struct { Type BucketBackendPatchGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _BucketBackendPatch BucketBackendPatch // NewBucketBackendPatch instantiates a new BucketBackendPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBucketBackendPatch(types BucketBackendPatchGetTypeArgType) *BucketBackendPatch { this := BucketBackendPatch{} setBucketBackendPatchGetTypeAttributeType(&this.Type, types) @@ -124,12 +153,14 @@ func NewBucketBackendPatch(types BucketBackendPatchGetTypeArgType) *BucketBacken // NewBucketBackendPatchWithDefaults instantiates a new BucketBackendPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBucketBackendPatchWithDefaults() *BucketBackendPatch { this := BucketBackendPatch{} return &this } // GetBucketUrl returns the BucketUrl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) GetBucketUrl() (res BucketBackendPatchGetBucketUrlRetType) { res, _ = o.GetBucketUrlOk() return @@ -137,22 +168,26 @@ func (o *BucketBackendPatch) GetBucketUrl() (res BucketBackendPatchGetBucketUrlR // GetBucketUrlOk returns a tuple with the BucketUrl field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) GetBucketUrlOk() (ret BucketBackendPatchGetBucketUrlRetType, ok bool) { return getBucketBackendPatchGetBucketUrlAttributeTypeOk(o.BucketUrl) } // HasBucketUrl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) HasBucketUrl() bool { _, ok := o.GetBucketUrlOk() return ok } // SetBucketUrl gets a reference to the given string and assigns it to the BucketUrl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) SetBucketUrl(v BucketBackendPatchGetBucketUrlRetType) { setBucketBackendPatchGetBucketUrlAttributeType(&o.BucketUrl, v) } // GetCredentials returns the Credentials field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) GetCredentials() (res BucketBackendPatchGetCredentialsRetType) { res, _ = o.GetCredentialsOk() return @@ -160,22 +195,26 @@ func (o *BucketBackendPatch) GetCredentials() (res BucketBackendPatchGetCredenti // GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) GetCredentialsOk() (ret BucketBackendPatchGetCredentialsRetType, ok bool) { return getBucketBackendPatchGetCredentialsAttributeTypeOk(o.Credentials) } // HasCredentials returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) HasCredentials() bool { _, ok := o.GetCredentialsOk() return ok } // SetCredentials gets a reference to the given BucketCredentials and assigns it to the Credentials field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) SetCredentials(v BucketBackendPatchGetCredentialsRetType) { setBucketBackendPatchGetCredentialsAttributeType(&o.Credentials, v) } // GetRegion returns the Region field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) GetRegion() (res BucketBackendPatchGetRegionRetType) { res, _ = o.GetRegionOk() return @@ -183,22 +222,26 @@ func (o *BucketBackendPatch) GetRegion() (res BucketBackendPatchGetRegionRetType // GetRegionOk returns a tuple with the Region field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) GetRegionOk() (ret BucketBackendPatchGetRegionRetType, ok bool) { return getBucketBackendPatchGetRegionAttributeTypeOk(o.Region) } // HasRegion returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) HasRegion() bool { _, ok := o.GetRegionOk() return ok } // SetRegion gets a reference to the given string and assigns it to the Region field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) SetRegion(v BucketBackendPatchGetRegionRetType) { setBucketBackendPatchGetRegionAttributeType(&o.Region, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) GetType() (ret BucketBackendPatchGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -206,15 +249,18 @@ func (o *BucketBackendPatch) GetType() (ret BucketBackendPatchGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) GetTypeOk() (ret BucketBackendPatchGetTypeRetType, ok bool) { return getBucketBackendPatchGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketBackendPatch) SetType(v BucketBackendPatchGetTypeRetType) { setBucketBackendPatchGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BucketBackendPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBucketBackendPatchGetBucketUrlAttributeTypeOk(o.BucketUrl); ok { @@ -232,37 +278,45 @@ func (o BucketBackendPatch) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBucketBackendPatch struct { value *BucketBackendPatch isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackendPatch) Get() *BucketBackendPatch { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackendPatch) Set(val *BucketBackendPatch) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackendPatch) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackendPatch) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBucketBackendPatch(val *BucketBackendPatch) *NullableBucketBackendPatch { return &NullableBucketBackendPatch{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketBackendPatch) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketBackendPatch) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_bucket_credentials.go b/services/cdn/model_bucket_credentials.go index 9b6d31120..70484e4de 100644 --- a/services/cdn/model_bucket_credentials.go +++ b/services/cdn/model_bucket_credentials.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BucketCredentials{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketCredentialsGetAccessKeyIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketCredentialsGetAccessKeyIdAttributeTypeOk(arg BucketCredentialsGetAccessKeyIdAttributeType) (ret BucketCredentialsGetAccessKeyIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBucketCredentialsGetAccessKeyIdAttributeTypeOk(arg BucketCredentialsGetA return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketCredentialsGetAccessKeyIdAttributeType(arg *BucketCredentialsGetAccessKeyIdAttributeType, val BucketCredentialsGetAccessKeyIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketCredentialsGetAccessKeyIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketCredentialsGetAccessKeyIdRetType = string /* @@ -43,8 +50,10 @@ type BucketCredentialsGetAccessKeyIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketCredentialsGetSecretAccessKeyAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBucketCredentialsGetSecretAccessKeyAttributeTypeOk(arg BucketCredentialsGetSecretAccessKeyAttributeType) (ret BucketCredentialsGetSecretAccessKeyRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getBucketCredentialsGetSecretAccessKeyAttributeTypeOk(arg BucketCredentials return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBucketCredentialsGetSecretAccessKeyAttributeType(arg *BucketCredentialsGetSecretAccessKeyAttributeType, val BucketCredentialsGetSecretAccessKeyRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketCredentialsGetSecretAccessKeyArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketCredentialsGetSecretAccessKeyRetType = string // BucketCredentials struct for BucketCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BucketCredentials struct { // REQUIRED AccessKeyId BucketCredentialsGetAccessKeyIdAttributeType `json:"accessKeyId" required:"true"` @@ -67,12 +81,14 @@ type BucketCredentials struct { SecretAccessKey BucketCredentialsGetSecretAccessKeyAttributeType `json:"secretAccessKey" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _BucketCredentials BucketCredentials // NewBucketCredentials instantiates a new BucketCredentials 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBucketCredentials(accessKeyId BucketCredentialsGetAccessKeyIdArgType, secretAccessKey BucketCredentialsGetSecretAccessKeyArgType) *BucketCredentials { this := BucketCredentials{} setBucketCredentialsGetAccessKeyIdAttributeType(&this.AccessKeyId, accessKeyId) @@ -83,12 +99,14 @@ func NewBucketCredentials(accessKeyId BucketCredentialsGetAccessKeyIdArgType, se // NewBucketCredentialsWithDefaults instantiates a new BucketCredentials 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBucketCredentialsWithDefaults() *BucketCredentials { this := BucketCredentials{} return &this } // GetAccessKeyId returns the AccessKeyId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketCredentials) GetAccessKeyId() (ret BucketCredentialsGetAccessKeyIdRetType) { ret, _ = o.GetAccessKeyIdOk() return ret @@ -96,16 +114,19 @@ func (o *BucketCredentials) GetAccessKeyId() (ret BucketCredentialsGetAccessKeyI // GetAccessKeyIdOk returns a tuple with the AccessKeyId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketCredentials) GetAccessKeyIdOk() (ret BucketCredentialsGetAccessKeyIdRetType, ok bool) { return getBucketCredentialsGetAccessKeyIdAttributeTypeOk(o.AccessKeyId) } // SetAccessKeyId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketCredentials) SetAccessKeyId(v BucketCredentialsGetAccessKeyIdRetType) { setBucketCredentialsGetAccessKeyIdAttributeType(&o.AccessKeyId, v) } // GetSecretAccessKey returns the SecretAccessKey field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketCredentials) GetSecretAccessKey() (ret BucketCredentialsGetSecretAccessKeyRetType) { ret, _ = o.GetSecretAccessKeyOk() return ret @@ -113,15 +134,18 @@ func (o *BucketCredentials) GetSecretAccessKey() (ret BucketCredentialsGetSecret // GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketCredentials) GetSecretAccessKeyOk() (ret BucketCredentialsGetSecretAccessKeyRetType, ok bool) { return getBucketCredentialsGetSecretAccessKeyAttributeTypeOk(o.SecretAccessKey) } // SetSecretAccessKey sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BucketCredentials) SetSecretAccessKey(v BucketCredentialsGetSecretAccessKeyRetType) { setBucketCredentialsGetSecretAccessKeyAttributeType(&o.SecretAccessKey, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BucketCredentials) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBucketCredentialsGetAccessKeyIdAttributeTypeOk(o.AccessKeyId); ok { @@ -133,37 +157,45 @@ func (o BucketCredentials) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBucketCredentials struct { value *BucketCredentials isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketCredentials) Get() *BucketCredentials { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketCredentials) Set(val *BucketCredentials) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketCredentials) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketCredentials) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBucketCredentials(val *BucketCredentials) *NullableBucketCredentials { return &NullableBucketCredentials{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBucketCredentials) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBucketCredentials) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_config.go b/services/cdn/model_config.go index d820c2dc5..30da85a73 100644 --- a/services/cdn/model_config.go +++ b/services/cdn/model_config.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Config{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBackendAttributeType = *ConfigBackend + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBackendArgType = ConfigBackend + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBackendRetType = ConfigBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetBackendAttributeTypeOk(arg ConfigGetBackendAttributeType) (ret ConfigGetBackendRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getConfigGetBackendAttributeTypeOk(arg ConfigGetBackendAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetBackendAttributeType(arg *ConfigGetBackendAttributeType, val ConfigGetBackendRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setConfigGetBackendAttributeType(arg *ConfigGetBackendAttributeType, val Co */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBlockedCountriesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBlockedCountriesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBlockedCountriesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetBlockedCountriesAttributeTypeOk(arg ConfigGetBlockedCountriesAttributeType) (ret ConfigGetBlockedCountriesRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getConfigGetBlockedCountriesAttributeTypeOk(arg ConfigGetBlockedCountriesAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetBlockedCountriesAttributeType(arg *ConfigGetBlockedCountriesAttributeType, val ConfigGetBlockedCountriesRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setConfigGetBlockedCountriesAttributeType(arg *ConfigGetBlockedCountriesAtt */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBlockedIpsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBlockedIpsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetBlockedIpsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetBlockedIpsAttributeTypeOk(arg ConfigGetBlockedIpsAttributeType) (ret ConfigGetBlockedIpsRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getConfigGetBlockedIpsAttributeTypeOk(arg ConfigGetBlockedIpsAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetBlockedIpsAttributeType(arg *ConfigGetBlockedIpsAttributeType, val ConfigGetBlockedIpsRetType) { *arg = &val } @@ -82,8 +104,10 @@ func setConfigGetBlockedIpsAttributeType(arg *ConfigGetBlockedIpsAttributeType, */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetDefaultCacheDurationAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetDefaultCacheDurationAttributeTypeOk(arg ConfigGetDefaultCacheDurationAttributeType) (ret ConfigGetDefaultCacheDurationRetType, ok bool) { if arg == nil { return nil, false @@ -91,6 +115,7 @@ func getConfigGetDefaultCacheDurationAttributeTypeOk(arg ConfigGetDefaultCacheDu return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetDefaultCacheDurationAttributeType(arg *ConfigGetDefaultCacheDurationAttributeType, val ConfigGetDefaultCacheDurationRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -99,7 +124,10 @@ func setConfigGetDefaultCacheDurationAttributeType(arg *ConfigGetDefaultCacheDur } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetDefaultCacheDurationArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetDefaultCacheDurationRetType = *string /* @@ -107,10 +135,16 @@ type ConfigGetDefaultCacheDurationRetType = *string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetLogSinkAttributeType = *ConfigLogSink + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetLogSinkArgType = ConfigLogSink + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetLogSinkRetType = ConfigLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetLogSinkAttributeTypeOk(arg ConfigGetLogSinkAttributeType) (ret ConfigGetLogSinkRetType, ok bool) { if arg == nil { return ret, false @@ -118,6 +152,7 @@ func getConfigGetLogSinkAttributeTypeOk(arg ConfigGetLogSinkAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetLogSinkAttributeType(arg *ConfigGetLogSinkAttributeType, val ConfigGetLogSinkRetType) { *arg = &val } @@ -127,10 +162,16 @@ func setConfigGetLogSinkAttributeType(arg *ConfigGetLogSinkAttributeType, val Co */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetMonthlyLimitBytesAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetMonthlyLimitBytesArgType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetMonthlyLimitBytesRetType = *int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetMonthlyLimitBytesAttributeTypeOk(arg ConfigGetMonthlyLimitBytesAttributeType) (ret ConfigGetMonthlyLimitBytesRetType, ok bool) { if arg == nil { return nil, false @@ -138,6 +179,7 @@ func getConfigGetMonthlyLimitBytesAttributeTypeOk(arg ConfigGetMonthlyLimitBytes return arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetMonthlyLimitBytesAttributeType(arg *ConfigGetMonthlyLimitBytesAttributeType, val ConfigGetMonthlyLimitBytesRetType) { *arg = val } @@ -147,10 +189,16 @@ func setConfigGetMonthlyLimitBytesAttributeType(arg *ConfigGetMonthlyLimitBytesA */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetOptimizerAttributeType = *Optimizer + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetOptimizerArgType = Optimizer + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetOptimizerRetType = Optimizer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetOptimizerAttributeTypeOk(arg ConfigGetOptimizerAttributeType) (ret ConfigGetOptimizerRetType, ok bool) { if arg == nil { return ret, false @@ -158,6 +206,7 @@ func getConfigGetOptimizerAttributeTypeOk(arg ConfigGetOptimizerAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetOptimizerAttributeType(arg *ConfigGetOptimizerAttributeType, val ConfigGetOptimizerRetType) { *arg = &val } @@ -167,10 +216,16 @@ func setConfigGetOptimizerAttributeType(arg *ConfigGetOptimizerAttributeType, va */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetRedirectsAttributeType = *RedirectConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetRedirectsArgType = RedirectConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetRedirectsRetType = RedirectConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetRedirectsAttributeTypeOk(arg ConfigGetRedirectsAttributeType) (ret ConfigGetRedirectsRetType, ok bool) { if arg == nil { return ret, false @@ -178,6 +233,7 @@ func getConfigGetRedirectsAttributeTypeOk(arg ConfigGetRedirectsAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetRedirectsAttributeType(arg *ConfigGetRedirectsAttributeType, val ConfigGetRedirectsRetType) { *arg = &val } @@ -187,10 +243,16 @@ func setConfigGetRedirectsAttributeType(arg *ConfigGetRedirectsAttributeType, va */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetRegionsAttributeType = *[]Region + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetRegionsArgType = []Region + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetRegionsRetType = []Region +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetRegionsAttributeTypeOk(arg ConfigGetRegionsAttributeType) (ret ConfigGetRegionsRetType, ok bool) { if arg == nil { return ret, false @@ -198,6 +260,7 @@ func getConfigGetRegionsAttributeTypeOk(arg ConfigGetRegionsAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetRegionsAttributeType(arg *ConfigGetRegionsAttributeType, val ConfigGetRegionsRetType) { *arg = &val } @@ -207,10 +270,16 @@ func setConfigGetRegionsAttributeType(arg *ConfigGetRegionsAttributeType, val Co */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetWafAttributeType = *WafConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetWafArgType = WafConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigGetWafRetType = WafConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigGetWafAttributeTypeOk(arg ConfigGetWafAttributeType) (ret ConfigGetWafRetType, ok bool) { if arg == nil { return ret, false @@ -218,11 +287,13 @@ func getConfigGetWafAttributeTypeOk(arg ConfigGetWafAttributeType) (ret ConfigGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigGetWafAttributeType(arg *ConfigGetWafAttributeType, val ConfigGetWafRetType) { *arg = &val } // Config struct for Config +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Config struct { // REQUIRED Backend ConfigGetBackendAttributeType `json:"backend" required:"true"` @@ -245,12 +316,14 @@ type Config struct { Waf ConfigGetWafAttributeType `json:"waf" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Config Config // NewConfig instantiates a new Config 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfig(backend ConfigGetBackendArgType, blockedCountries ConfigGetBlockedCountriesArgType, blockedIps ConfigGetBlockedIpsArgType, regions ConfigGetRegionsArgType, waf ConfigGetWafArgType) *Config { this := Config{} setConfigGetBackendAttributeType(&this.Backend, backend) @@ -264,12 +337,14 @@ func NewConfig(backend ConfigGetBackendArgType, blockedCountries ConfigGetBlocke // NewConfigWithDefaults instantiates a new Config 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfigWithDefaults() *Config { this := Config{} return &this } // GetBackend returns the Backend field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetBackend() (ret ConfigGetBackendRetType) { ret, _ = o.GetBackendOk() return ret @@ -277,16 +352,19 @@ func (o *Config) GetBackend() (ret ConfigGetBackendRetType) { // GetBackendOk returns a tuple with the Backend field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetBackendOk() (ret ConfigGetBackendRetType, ok bool) { return getConfigGetBackendAttributeTypeOk(o.Backend) } // SetBackend sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetBackend(v ConfigGetBackendRetType) { setConfigGetBackendAttributeType(&o.Backend, v) } // GetBlockedCountries returns the BlockedCountries field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetBlockedCountries() (ret ConfigGetBlockedCountriesRetType) { ret, _ = o.GetBlockedCountriesOk() return ret @@ -294,16 +372,19 @@ func (o *Config) GetBlockedCountries() (ret ConfigGetBlockedCountriesRetType) { // GetBlockedCountriesOk returns a tuple with the BlockedCountries field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetBlockedCountriesOk() (ret ConfigGetBlockedCountriesRetType, ok bool) { return getConfigGetBlockedCountriesAttributeTypeOk(o.BlockedCountries) } // SetBlockedCountries sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetBlockedCountries(v ConfigGetBlockedCountriesRetType) { setConfigGetBlockedCountriesAttributeType(&o.BlockedCountries, v) } // GetBlockedIps returns the BlockedIps field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetBlockedIps() (ret ConfigGetBlockedIpsRetType) { ret, _ = o.GetBlockedIpsOk() return ret @@ -311,16 +392,19 @@ func (o *Config) GetBlockedIps() (ret ConfigGetBlockedIpsRetType) { // GetBlockedIpsOk returns a tuple with the BlockedIps field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetBlockedIpsOk() (ret ConfigGetBlockedIpsRetType, ok bool) { return getConfigGetBlockedIpsAttributeTypeOk(o.BlockedIps) } // SetBlockedIps sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetBlockedIps(v ConfigGetBlockedIpsRetType) { setConfigGetBlockedIpsAttributeType(&o.BlockedIps, v) } // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetDefaultCacheDuration() (res ConfigGetDefaultCacheDurationRetType) { res, _ = o.GetDefaultCacheDurationOk() return @@ -329,32 +413,38 @@ func (o *Config) GetDefaultCacheDuration() (res ConfigGetDefaultCacheDurationRet // GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetDefaultCacheDurationOk() (ret ConfigGetDefaultCacheDurationRetType, ok bool) { return getConfigGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration) } // HasDefaultCacheDuration returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) HasDefaultCacheDuration() bool { _, ok := o.GetDefaultCacheDurationOk() return ok } // SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetDefaultCacheDuration(v ConfigGetDefaultCacheDurationRetType) { setConfigGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v) } // SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetDefaultCacheDurationNil() { o.DefaultCacheDuration = nil } // UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) UnsetDefaultCacheDuration() { o.DefaultCacheDuration = nil } // GetLogSink returns the LogSink field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetLogSink() (res ConfigGetLogSinkRetType) { res, _ = o.GetLogSinkOk() return @@ -362,22 +452,26 @@ func (o *Config) GetLogSink() (res ConfigGetLogSinkRetType) { // GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetLogSinkOk() (ret ConfigGetLogSinkRetType, ok bool) { return getConfigGetLogSinkAttributeTypeOk(o.LogSink) } // HasLogSink returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) HasLogSink() bool { _, ok := o.GetLogSinkOk() return ok } // SetLogSink gets a reference to the given ConfigLogSink and assigns it to the LogSink field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetLogSink(v ConfigGetLogSinkRetType) { setConfigGetLogSinkAttributeType(&o.LogSink, v) } // GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetMonthlyLimitBytes() (res ConfigGetMonthlyLimitBytesRetType) { res, _ = o.GetMonthlyLimitBytesOk() return @@ -386,32 +480,38 @@ func (o *Config) GetMonthlyLimitBytes() (res ConfigGetMonthlyLimitBytesRetType) // GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetMonthlyLimitBytesOk() (ret ConfigGetMonthlyLimitBytesRetType, ok bool) { return getConfigGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes) } // HasMonthlyLimitBytes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) HasMonthlyLimitBytes() bool { _, ok := o.GetMonthlyLimitBytesOk() return ok } // SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetMonthlyLimitBytes(v ConfigGetMonthlyLimitBytesRetType) { setConfigGetMonthlyLimitBytesAttributeType(&o.MonthlyLimitBytes, v) } // SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetMonthlyLimitBytesNil() { o.MonthlyLimitBytes = nil } // UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) UnsetMonthlyLimitBytes() { o.MonthlyLimitBytes = nil } // GetOptimizer returns the Optimizer field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetOptimizer() (res ConfigGetOptimizerRetType) { res, _ = o.GetOptimizerOk() return @@ -419,22 +519,26 @@ func (o *Config) GetOptimizer() (res ConfigGetOptimizerRetType) { // GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetOptimizerOk() (ret ConfigGetOptimizerRetType, ok bool) { return getConfigGetOptimizerAttributeTypeOk(o.Optimizer) } // HasOptimizer returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) HasOptimizer() bool { _, ok := o.GetOptimizerOk() return ok } // SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetOptimizer(v ConfigGetOptimizerRetType) { setConfigGetOptimizerAttributeType(&o.Optimizer, v) } // GetRedirects returns the Redirects field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetRedirects() (res ConfigGetRedirectsRetType) { res, _ = o.GetRedirectsOk() return @@ -442,22 +546,26 @@ func (o *Config) GetRedirects() (res ConfigGetRedirectsRetType) { // GetRedirectsOk returns a tuple with the Redirects field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetRedirectsOk() (ret ConfigGetRedirectsRetType, ok bool) { return getConfigGetRedirectsAttributeTypeOk(o.Redirects) } // HasRedirects returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) HasRedirects() bool { _, ok := o.GetRedirectsOk() return ok } // SetRedirects gets a reference to the given RedirectConfig and assigns it to the Redirects field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetRedirects(v ConfigGetRedirectsRetType) { setConfigGetRedirectsAttributeType(&o.Redirects, v) } // GetRegions returns the Regions field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetRegions() (ret ConfigGetRegionsRetType) { ret, _ = o.GetRegionsOk() return ret @@ -465,16 +573,19 @@ func (o *Config) GetRegions() (ret ConfigGetRegionsRetType) { // GetRegionsOk returns a tuple with the Regions field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetRegionsOk() (ret ConfigGetRegionsRetType, ok bool) { return getConfigGetRegionsAttributeTypeOk(o.Regions) } // SetRegions sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetRegions(v ConfigGetRegionsRetType) { setConfigGetRegionsAttributeType(&o.Regions, v) } // GetWaf returns the Waf field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetWaf() (ret ConfigGetWafRetType) { ret, _ = o.GetWafOk() return ret @@ -482,15 +593,18 @@ func (o *Config) GetWaf() (ret ConfigGetWafRetType) { // GetWafOk returns a tuple with the Waf field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) GetWafOk() (ret ConfigGetWafRetType, ok bool) { return getConfigGetWafAttributeTypeOk(o.Waf) } // SetWaf sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Config) SetWaf(v ConfigGetWafRetType) { setConfigGetWafAttributeType(&o.Waf, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Config) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getConfigGetBackendAttributeTypeOk(o.Backend); ok { @@ -526,37 +640,45 @@ func (o Config) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableConfig struct { value *Config isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfig) Get() *Config { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfig) Set(val *Config) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfig) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfig) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableConfig(val *Config) *NullableConfig { return &NullableConfig{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfig) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfig) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_config_backend.go b/services/cdn/model_config_backend.go index 47ac98402..ad297927c 100644 --- a/services/cdn/model_config_backend.go +++ b/services/cdn/model_config_backend.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,12 +17,14 @@ import ( ) // ConfigBackend - struct for ConfigBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigBackend struct { BucketBackend *BucketBackend HttpBackend *HttpBackend } // BucketBackendAsConfigBackend is a convenience function that returns BucketBackend wrapped in ConfigBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func BucketBackendAsConfigBackend(v *BucketBackend) ConfigBackend { return ConfigBackend{ BucketBackend: v, @@ -29,6 +32,7 @@ func BucketBackendAsConfigBackend(v *BucketBackend) ConfigBackend { } // HttpBackendAsConfigBackend is a convenience function that returns HttpBackend wrapped in ConfigBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func HttpBackendAsConfigBackend(v *HttpBackend) ConfigBackend { return ConfigBackend{ HttpBackend: v, @@ -36,6 +40,7 @@ func HttpBackendAsConfigBackend(v *HttpBackend) ConfigBackend { } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *ConfigBackend) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -98,6 +103,7 @@ func (dst *ConfigBackend) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src ConfigBackend) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.BucketBackend != nil { return json.Marshal(&src.BucketBackend) } @@ -110,6 +116,7 @@ func (src ConfigBackend) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *ConfigBackend) GetActualInstance() interface{} { if obj == nil { return nil @@ -126,37 +133,45 @@ func (obj *ConfigBackend) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableConfigBackend struct { value *ConfigBackend isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigBackend) Get() *ConfigBackend { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigBackend) Set(val *ConfigBackend) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigBackend) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigBackend) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableConfigBackend(val *ConfigBackend) *NullableConfigBackend { return &NullableConfigBackend{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigBackend) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigBackend) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_config_log_sink.go b/services/cdn/model_config_log_sink.go index 4f97b7cff..c46a9caa0 100644 --- a/services/cdn/model_config_log_sink.go +++ b/services/cdn/model_config_log_sink.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,11 +17,13 @@ import ( ) // ConfigLogSink - struct for ConfigLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigLogSink struct { LokiLogSink *LokiLogSink } // LokiLogSinkAsConfigLogSink is a convenience function that returns LokiLogSink wrapped in ConfigLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func LokiLogSinkAsConfigLogSink(v *LokiLogSink) ConfigLogSink { return ConfigLogSink{ LokiLogSink: v, @@ -28,6 +31,7 @@ func LokiLogSinkAsConfigLogSink(v *LokiLogSink) ConfigLogSink { } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -66,6 +70,7 @@ func (dst *ConfigLogSink) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src ConfigLogSink) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.LokiLogSink != nil { return json.Marshal(&src.LokiLogSink) } @@ -74,6 +79,7 @@ func (src ConfigLogSink) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *ConfigLogSink) GetActualInstance() interface{} { if obj == nil { return nil @@ -86,37 +92,45 @@ func (obj *ConfigLogSink) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableConfigLogSink struct { value *ConfigLogSink isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigLogSink) Get() *ConfigLogSink { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigLogSink) Set(val *ConfigLogSink) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigLogSink) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigLogSink) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableConfigLogSink(val *ConfigLogSink) *NullableConfigLogSink { return &NullableConfigLogSink{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigLogSink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_config_patch.go b/services/cdn/model_config_patch.go index 70a601f81..6d856bb5f 100644 --- a/services/cdn/model_config_patch.go +++ b/services/cdn/model_config_patch.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ConfigPatch{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBackendAttributeType = *ConfigPatchBackend + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBackendArgType = ConfigPatchBackend + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBackendRetType = ConfigPatchBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetBackendAttributeTypeOk(arg ConfigPatchGetBackendAttributeType) (ret ConfigPatchGetBackendRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getConfigPatchGetBackendAttributeTypeOk(arg ConfigPatchGetBackendAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetBackendAttributeType(arg *ConfigPatchGetBackendAttributeType, val ConfigPatchGetBackendRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setConfigPatchGetBackendAttributeType(arg *ConfigPatchGetBackendAttributeTy */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBlockedCountriesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBlockedCountriesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBlockedCountriesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetBlockedCountriesAttributeTypeOk(arg ConfigPatchGetBlockedCountriesAttributeType) (ret ConfigPatchGetBlockedCountriesRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getConfigPatchGetBlockedCountriesAttributeTypeOk(arg ConfigPatchGetBlockedC return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetBlockedCountriesAttributeType(arg *ConfigPatchGetBlockedCountriesAttributeType, val ConfigPatchGetBlockedCountriesRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setConfigPatchGetBlockedCountriesAttributeType(arg *ConfigPatchGetBlockedCo */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBlockedIpsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBlockedIpsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetBlockedIpsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetBlockedIpsAttributeTypeOk(arg ConfigPatchGetBlockedIpsAttributeType) (ret ConfigPatchGetBlockedIpsRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getConfigPatchGetBlockedIpsAttributeTypeOk(arg ConfigPatchGetBlockedIpsAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetBlockedIpsAttributeType(arg *ConfigPatchGetBlockedIpsAttributeType, val ConfigPatchGetBlockedIpsRetType) { *arg = &val } @@ -82,8 +104,10 @@ func setConfigPatchGetBlockedIpsAttributeType(arg *ConfigPatchGetBlockedIpsAttri */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetDefaultCacheDurationAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetDefaultCacheDurationAttributeTypeOk(arg ConfigPatchGetDefaultCacheDurationAttributeType) (ret ConfigPatchGetDefaultCacheDurationRetType, ok bool) { if arg == nil { return nil, false @@ -91,6 +115,7 @@ func getConfigPatchGetDefaultCacheDurationAttributeTypeOk(arg ConfigPatchGetDefa return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetDefaultCacheDurationAttributeType(arg *ConfigPatchGetDefaultCacheDurationAttributeType, val ConfigPatchGetDefaultCacheDurationRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -99,7 +124,10 @@ func setConfigPatchGetDefaultCacheDurationAttributeType(arg *ConfigPatchGetDefau } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetDefaultCacheDurationArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetDefaultCacheDurationRetType = *string /* @@ -107,10 +135,16 @@ type ConfigPatchGetDefaultCacheDurationRetType = *string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetLogSinkAttributeType = *NullableConfigPatchLogSink + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetLogSinkArgType = *NullableConfigPatchLogSink + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetLogSinkRetType = *NullableConfigPatchLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetLogSinkAttributeTypeOk(arg ConfigPatchGetLogSinkAttributeType) (ret ConfigPatchGetLogSinkRetType, ok bool) { if arg == nil { return nil, false @@ -118,6 +152,7 @@ func getConfigPatchGetLogSinkAttributeTypeOk(arg ConfigPatchGetLogSinkAttributeT return arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetLogSinkAttributeType(arg *ConfigPatchGetLogSinkAttributeType, val ConfigPatchGetLogSinkRetType) { *arg = val } @@ -127,10 +162,16 @@ func setConfigPatchGetLogSinkAttributeType(arg *ConfigPatchGetLogSinkAttributeTy */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetMonthlyLimitBytesAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetMonthlyLimitBytesArgType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetMonthlyLimitBytesRetType = *int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetMonthlyLimitBytesAttributeTypeOk(arg ConfigPatchGetMonthlyLimitBytesAttributeType) (ret ConfigPatchGetMonthlyLimitBytesRetType, ok bool) { if arg == nil { return nil, false @@ -138,6 +179,7 @@ func getConfigPatchGetMonthlyLimitBytesAttributeTypeOk(arg ConfigPatchGetMonthly return arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetMonthlyLimitBytesAttributeType(arg *ConfigPatchGetMonthlyLimitBytesAttributeType, val ConfigPatchGetMonthlyLimitBytesRetType) { *arg = val } @@ -147,10 +189,16 @@ func setConfigPatchGetMonthlyLimitBytesAttributeType(arg *ConfigPatchGetMonthlyL */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetOptimizerAttributeType = *OptimizerPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetOptimizerArgType = OptimizerPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetOptimizerRetType = OptimizerPatch +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetOptimizerAttributeTypeOk(arg ConfigPatchGetOptimizerAttributeType) (ret ConfigPatchGetOptimizerRetType, ok bool) { if arg == nil { return ret, false @@ -158,6 +206,7 @@ func getConfigPatchGetOptimizerAttributeTypeOk(arg ConfigPatchGetOptimizerAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetOptimizerAttributeType(arg *ConfigPatchGetOptimizerAttributeType, val ConfigPatchGetOptimizerRetType) { *arg = &val } @@ -167,10 +216,16 @@ func setConfigPatchGetOptimizerAttributeType(arg *ConfigPatchGetOptimizerAttribu */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetRedirectsAttributeType = *RedirectConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetRedirectsArgType = RedirectConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetRedirectsRetType = RedirectConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetRedirectsAttributeTypeOk(arg ConfigPatchGetRedirectsAttributeType) (ret ConfigPatchGetRedirectsRetType, ok bool) { if arg == nil { return ret, false @@ -178,6 +233,7 @@ func getConfigPatchGetRedirectsAttributeTypeOk(arg ConfigPatchGetRedirectsAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetRedirectsAttributeType(arg *ConfigPatchGetRedirectsAttributeType, val ConfigPatchGetRedirectsRetType) { *arg = &val } @@ -187,10 +243,16 @@ func setConfigPatchGetRedirectsAttributeType(arg *ConfigPatchGetRedirectsAttribu */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetRegionsAttributeType = *[]Region + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetRegionsArgType = []Region + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetRegionsRetType = []Region +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetRegionsAttributeTypeOk(arg ConfigPatchGetRegionsAttributeType) (ret ConfigPatchGetRegionsRetType, ok bool) { if arg == nil { return ret, false @@ -198,6 +260,7 @@ func getConfigPatchGetRegionsAttributeTypeOk(arg ConfigPatchGetRegionsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetRegionsAttributeType(arg *ConfigPatchGetRegionsAttributeType, val ConfigPatchGetRegionsRetType) { *arg = &val } @@ -207,10 +270,16 @@ func setConfigPatchGetRegionsAttributeType(arg *ConfigPatchGetRegionsAttributeTy */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetWafAttributeType = *WafConfigPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetWafArgType = WafConfigPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchGetWafRetType = WafConfigPatch +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getConfigPatchGetWafAttributeTypeOk(arg ConfigPatchGetWafAttributeType) (ret ConfigPatchGetWafRetType, ok bool) { if arg == nil { return ret, false @@ -218,11 +287,13 @@ func getConfigPatchGetWafAttributeTypeOk(arg ConfigPatchGetWafAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setConfigPatchGetWafAttributeType(arg *ConfigPatchGetWafAttributeType, val ConfigPatchGetWafRetType) { *arg = &val } // ConfigPatch struct for ConfigPatch +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatch struct { Backend ConfigPatchGetBackendAttributeType `json:"backend,omitempty"` // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. @@ -244,6 +315,7 @@ type ConfigPatch struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfigPatch() *ConfigPatch { this := ConfigPatch{} return &this @@ -252,12 +324,14 @@ func NewConfigPatch() *ConfigPatch { // NewConfigPatchWithDefaults instantiates a new ConfigPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfigPatchWithDefaults() *ConfigPatch { this := ConfigPatch{} return &this } // GetBackend returns the Backend field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetBackend() (res ConfigPatchGetBackendRetType) { res, _ = o.GetBackendOk() return @@ -265,22 +339,26 @@ func (o *ConfigPatch) GetBackend() (res ConfigPatchGetBackendRetType) { // GetBackendOk returns a tuple with the Backend field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetBackendOk() (ret ConfigPatchGetBackendRetType, ok bool) { return getConfigPatchGetBackendAttributeTypeOk(o.Backend) } // HasBackend returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasBackend() bool { _, ok := o.GetBackendOk() return ok } // SetBackend gets a reference to the given ConfigPatchBackend and assigns it to the Backend field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetBackend(v ConfigPatchGetBackendRetType) { setConfigPatchGetBackendAttributeType(&o.Backend, v) } // GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetBlockedCountries() (res ConfigPatchGetBlockedCountriesRetType) { res, _ = o.GetBlockedCountriesOk() return @@ -288,22 +366,26 @@ func (o *ConfigPatch) GetBlockedCountries() (res ConfigPatchGetBlockedCountriesR // GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetBlockedCountriesOk() (ret ConfigPatchGetBlockedCountriesRetType, ok bool) { return getConfigPatchGetBlockedCountriesAttributeTypeOk(o.BlockedCountries) } // HasBlockedCountries returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasBlockedCountries() bool { _, ok := o.GetBlockedCountriesOk() return ok } // SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetBlockedCountries(v ConfigPatchGetBlockedCountriesRetType) { setConfigPatchGetBlockedCountriesAttributeType(&o.BlockedCountries, v) } // GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetBlockedIps() (res ConfigPatchGetBlockedIpsRetType) { res, _ = o.GetBlockedIpsOk() return @@ -311,22 +393,26 @@ func (o *ConfigPatch) GetBlockedIps() (res ConfigPatchGetBlockedIpsRetType) { // GetBlockedIpsOk returns a tuple with the BlockedIps field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetBlockedIpsOk() (ret ConfigPatchGetBlockedIpsRetType, ok bool) { return getConfigPatchGetBlockedIpsAttributeTypeOk(o.BlockedIps) } // HasBlockedIps returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasBlockedIps() bool { _, ok := o.GetBlockedIpsOk() return ok } // SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetBlockedIps(v ConfigPatchGetBlockedIpsRetType) { setConfigPatchGetBlockedIpsAttributeType(&o.BlockedIps, v) } // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetDefaultCacheDuration() (res ConfigPatchGetDefaultCacheDurationRetType) { res, _ = o.GetDefaultCacheDurationOk() return @@ -335,32 +421,38 @@ func (o *ConfigPatch) GetDefaultCacheDuration() (res ConfigPatchGetDefaultCacheD // GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetDefaultCacheDurationOk() (ret ConfigPatchGetDefaultCacheDurationRetType, ok bool) { return getConfigPatchGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration) } // HasDefaultCacheDuration returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasDefaultCacheDuration() bool { _, ok := o.GetDefaultCacheDurationOk() return ok } // SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetDefaultCacheDuration(v ConfigPatchGetDefaultCacheDurationRetType) { setConfigPatchGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v) } // SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetDefaultCacheDurationNil() { o.DefaultCacheDuration = nil } // UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) UnsetDefaultCacheDuration() { o.DefaultCacheDuration = nil } // GetLogSink returns the LogSink field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetLogSink() (res ConfigPatchGetLogSinkRetType) { res, _ = o.GetLogSinkOk() return @@ -369,32 +461,38 @@ func (o *ConfigPatch) GetLogSink() (res ConfigPatchGetLogSinkRetType) { // GetLogSinkOk returns a tuple with the LogSink 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetLogSinkOk() (ret ConfigPatchGetLogSinkRetType, ok bool) { return getConfigPatchGetLogSinkAttributeTypeOk(o.LogSink) } // HasLogSink returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasLogSink() bool { _, ok := o.GetLogSinkOk() return ok } // SetLogSink gets a reference to the given ConfigPatchLogSink and assigns it to the LogSink field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetLogSink(v ConfigPatchGetLogSinkRetType) { setConfigPatchGetLogSinkAttributeType(&o.LogSink, v) } // SetLogSinkNil sets the value for LogSink to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetLogSinkNil() { o.LogSink = nil } // UnsetLogSink ensures that no value is present for LogSink, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) UnsetLogSink() { o.LogSink = nil } // GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetMonthlyLimitBytes() (res ConfigPatchGetMonthlyLimitBytesRetType) { res, _ = o.GetMonthlyLimitBytesOk() return @@ -403,32 +501,38 @@ func (o *ConfigPatch) GetMonthlyLimitBytes() (res ConfigPatchGetMonthlyLimitByte // GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetMonthlyLimitBytesOk() (ret ConfigPatchGetMonthlyLimitBytesRetType, ok bool) { return getConfigPatchGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes) } // HasMonthlyLimitBytes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasMonthlyLimitBytes() bool { _, ok := o.GetMonthlyLimitBytesOk() return ok } // SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetMonthlyLimitBytes(v ConfigPatchGetMonthlyLimitBytesRetType) { setConfigPatchGetMonthlyLimitBytesAttributeType(&o.MonthlyLimitBytes, v) } // SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetMonthlyLimitBytesNil() { o.MonthlyLimitBytes = nil } // UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) UnsetMonthlyLimitBytes() { o.MonthlyLimitBytes = nil } // GetOptimizer returns the Optimizer field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetOptimizer() (res ConfigPatchGetOptimizerRetType) { res, _ = o.GetOptimizerOk() return @@ -436,22 +540,26 @@ func (o *ConfigPatch) GetOptimizer() (res ConfigPatchGetOptimizerRetType) { // GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetOptimizerOk() (ret ConfigPatchGetOptimizerRetType, ok bool) { return getConfigPatchGetOptimizerAttributeTypeOk(o.Optimizer) } // HasOptimizer returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasOptimizer() bool { _, ok := o.GetOptimizerOk() return ok } // SetOptimizer gets a reference to the given OptimizerPatch and assigns it to the Optimizer field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetOptimizer(v ConfigPatchGetOptimizerRetType) { setConfigPatchGetOptimizerAttributeType(&o.Optimizer, v) } // GetRedirects returns the Redirects field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetRedirects() (res ConfigPatchGetRedirectsRetType) { res, _ = o.GetRedirectsOk() return @@ -459,22 +567,26 @@ func (o *ConfigPatch) GetRedirects() (res ConfigPatchGetRedirectsRetType) { // GetRedirectsOk returns a tuple with the Redirects field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetRedirectsOk() (ret ConfigPatchGetRedirectsRetType, ok bool) { return getConfigPatchGetRedirectsAttributeTypeOk(o.Redirects) } // HasRedirects returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasRedirects() bool { _, ok := o.GetRedirectsOk() return ok } // SetRedirects gets a reference to the given RedirectConfig and assigns it to the Redirects field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetRedirects(v ConfigPatchGetRedirectsRetType) { setConfigPatchGetRedirectsAttributeType(&o.Redirects, v) } // GetRegions returns the Regions field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetRegions() (res ConfigPatchGetRegionsRetType) { res, _ = o.GetRegionsOk() return @@ -482,22 +594,26 @@ func (o *ConfigPatch) GetRegions() (res ConfigPatchGetRegionsRetType) { // GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetRegionsOk() (ret ConfigPatchGetRegionsRetType, ok bool) { return getConfigPatchGetRegionsAttributeTypeOk(o.Regions) } // HasRegions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasRegions() bool { _, ok := o.GetRegionsOk() return ok } // SetRegions gets a reference to the given []Region and assigns it to the Regions field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetRegions(v ConfigPatchGetRegionsRetType) { setConfigPatchGetRegionsAttributeType(&o.Regions, v) } // GetWaf returns the Waf field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetWaf() (res ConfigPatchGetWafRetType) { res, _ = o.GetWafOk() return @@ -505,21 +621,25 @@ func (o *ConfigPatch) GetWaf() (res ConfigPatchGetWafRetType) { // GetWafOk returns a tuple with the Waf field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) GetWafOk() (ret ConfigPatchGetWafRetType, ok bool) { return getConfigPatchGetWafAttributeTypeOk(o.Waf) } // HasWaf returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) HasWaf() bool { _, ok := o.GetWafOk() return ok } // SetWaf gets a reference to the given WafConfigPatch and assigns it to the Waf field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ConfigPatch) SetWaf(v ConfigPatchGetWafRetType) { setConfigPatchGetWafAttributeType(&o.Waf, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ConfigPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getConfigPatchGetBackendAttributeTypeOk(o.Backend); ok { @@ -555,37 +675,45 @@ func (o ConfigPatch) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableConfigPatch struct { value *ConfigPatch isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatch) Get() *ConfigPatch { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatch) Set(val *ConfigPatch) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatch) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatch) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableConfigPatch(val *ConfigPatch) *NullableConfigPatch { return &NullableConfigPatch{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatch) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatch) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_config_patch_backend.go b/services/cdn/model_config_patch_backend.go index 7fe10974d..b40e76426 100644 --- a/services/cdn/model_config_patch_backend.go +++ b/services/cdn/model_config_patch_backend.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,12 +17,14 @@ import ( ) // ConfigPatchBackend - struct for ConfigPatchBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchBackend struct { BucketBackendPatch *BucketBackendPatch HttpBackendPatch *HttpBackendPatch } // BucketBackendPatchAsConfigPatchBackend is a convenience function that returns BucketBackendPatch wrapped in ConfigPatchBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func BucketBackendPatchAsConfigPatchBackend(v *BucketBackendPatch) ConfigPatchBackend { return ConfigPatchBackend{ BucketBackendPatch: v, @@ -29,6 +32,7 @@ func BucketBackendPatchAsConfigPatchBackend(v *BucketBackendPatch) ConfigPatchBa } // HttpBackendPatchAsConfigPatchBackend is a convenience function that returns HttpBackendPatch wrapped in ConfigPatchBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func HttpBackendPatchAsConfigPatchBackend(v *HttpBackendPatch) ConfigPatchBackend { return ConfigPatchBackend{ HttpBackendPatch: v, @@ -36,6 +40,7 @@ func HttpBackendPatchAsConfigPatchBackend(v *HttpBackendPatch) ConfigPatchBacken } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *ConfigPatchBackend) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -98,6 +103,7 @@ func (dst *ConfigPatchBackend) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src ConfigPatchBackend) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.BucketBackendPatch != nil { return json.Marshal(&src.BucketBackendPatch) } @@ -110,6 +116,7 @@ func (src ConfigPatchBackend) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *ConfigPatchBackend) GetActualInstance() interface{} { if obj == nil { return nil @@ -126,37 +133,45 @@ func (obj *ConfigPatchBackend) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableConfigPatchBackend struct { value *ConfigPatchBackend isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatchBackend) Get() *ConfigPatchBackend { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatchBackend) Set(val *ConfigPatchBackend) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatchBackend) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatchBackend) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableConfigPatchBackend(val *ConfigPatchBackend) *NullableConfigPatchBackend { return &NullableConfigPatchBackend{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatchBackend) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatchBackend) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_config_patch_log_sink.go b/services/cdn/model_config_patch_log_sink.go index c5f6bd0db..5186f8b7e 100644 --- a/services/cdn/model_config_patch_log_sink.go +++ b/services/cdn/model_config_patch_log_sink.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,11 +17,13 @@ import ( ) // ConfigPatchLogSink - struct for ConfigPatchLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ConfigPatchLogSink struct { LokiLogSinkPatch *LokiLogSinkPatch } // LokiLogSinkPatchAsConfigPatchLogSink is a convenience function that returns LokiLogSinkPatch wrapped in ConfigPatchLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func LokiLogSinkPatchAsConfigPatchLogSink(v *LokiLogSinkPatch) ConfigPatchLogSink { return ConfigPatchLogSink{ LokiLogSinkPatch: v, @@ -28,6 +31,7 @@ func LokiLogSinkPatchAsConfigPatchLogSink(v *LokiLogSinkPatch) ConfigPatchLogSin } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { var err error // this object is nullable so check if the payload is null or empty string @@ -71,6 +75,7 @@ func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src ConfigPatchLogSink) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.LokiLogSinkPatch != nil { return json.Marshal(&src.LokiLogSinkPatch) } @@ -79,6 +84,7 @@ func (src ConfigPatchLogSink) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *ConfigPatchLogSink) GetActualInstance() interface{} { if obj == nil { return nil @@ -91,37 +97,45 @@ func (obj *ConfigPatchLogSink) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableConfigPatchLogSink struct { value *ConfigPatchLogSink isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatchLogSink) Get() *ConfigPatchLogSink { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatchLogSink) Set(val *ConfigPatchLogSink) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatchLogSink) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatchLogSink) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableConfigPatchLogSink(val *ConfigPatchLogSink) *NullableConfigPatchLogSink { return &NullableConfigPatchLogSink{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableConfigPatchLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableConfigPatchLogSink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_create_distribution_payload.go b/services/cdn/model_create_distribution_payload.go index 377173465..e9bf22a50 100644 --- a/services/cdn/model_create_distribution_payload.go +++ b/services/cdn/model_create_distribution_payload.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateDistributionPayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBackendAttributeType = *CreateDistributionPayloadBackend + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBackendArgType = CreateDistributionPayloadBackend + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBackendRetType = CreateDistributionPayloadBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetBackendAttributeTypeOk(arg CreateDistributionPayloadGetBackendAttributeType) (ret CreateDistributionPayloadGetBackendRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateDistributionPayloadGetBackendAttributeTypeOk(arg CreateDistributio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetBackendAttributeType(arg *CreateDistributionPayloadGetBackendAttributeType, val CreateDistributionPayloadGetBackendRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setCreateDistributionPayloadGetBackendAttributeType(arg *CreateDistribution */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBlockedCountriesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBlockedCountriesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBlockedCountriesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(arg CreateDistributionPayloadGetBlockedCountriesAttributeType) (ret CreateDistributionPayloadGetBlockedCountriesRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(arg CreateDi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetBlockedCountriesAttributeType(arg *CreateDistributionPayloadGetBlockedCountriesAttributeType, val CreateDistributionPayloadGetBlockedCountriesRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setCreateDistributionPayloadGetBlockedCountriesAttributeType(arg *CreateDis */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBlockedIpsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBlockedIpsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetBlockedIpsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetBlockedIpsAttributeTypeOk(arg CreateDistributionPayloadGetBlockedIpsAttributeType) (ret CreateDistributionPayloadGetBlockedIpsRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getCreateDistributionPayloadGetBlockedIpsAttributeTypeOk(arg CreateDistribu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetBlockedIpsAttributeType(arg *CreateDistributionPayloadGetBlockedIpsAttributeType, val CreateDistributionPayloadGetBlockedIpsRetType) { *arg = &val } @@ -82,8 +104,10 @@ func setCreateDistributionPayloadGetBlockedIpsAttributeType(arg *CreateDistribut */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetDefaultCacheDurationAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(arg CreateDistributionPayloadGetDefaultCacheDurationAttributeType) (ret CreateDistributionPayloadGetDefaultCacheDurationRetType, ok bool) { if arg == nil { return ret, false @@ -91,11 +115,15 @@ func getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(arg Crea return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetDefaultCacheDurationAttributeType(arg *CreateDistributionPayloadGetDefaultCacheDurationAttributeType, val CreateDistributionPayloadGetDefaultCacheDurationRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetDefaultCacheDurationArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetDefaultCacheDurationRetType = string /* @@ -103,8 +131,10 @@ type CreateDistributionPayloadGetDefaultCacheDurationRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetIntentIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetIntentIdAttributeTypeOk(arg CreateDistributionPayloadGetIntentIdAttributeType) (ret CreateDistributionPayloadGetIntentIdRetType, ok bool) { if arg == nil { return ret, false @@ -112,11 +142,15 @@ func getCreateDistributionPayloadGetIntentIdAttributeTypeOk(arg CreateDistributi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetIntentIdAttributeType(arg *CreateDistributionPayloadGetIntentIdAttributeType, val CreateDistributionPayloadGetIntentIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetIntentIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetIntentIdRetType = string /* @@ -124,10 +158,16 @@ type CreateDistributionPayloadGetIntentIdRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetLogSinkAttributeType = *CreateDistributionPayloadLogSink + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetLogSinkArgType = CreateDistributionPayloadLogSink + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetLogSinkRetType = CreateDistributionPayloadLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetLogSinkAttributeTypeOk(arg CreateDistributionPayloadGetLogSinkAttributeType) (ret CreateDistributionPayloadGetLogSinkRetType, ok bool) { if arg == nil { return ret, false @@ -135,6 +175,7 @@ func getCreateDistributionPayloadGetLogSinkAttributeTypeOk(arg CreateDistributio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetLogSinkAttributeType(arg *CreateDistributionPayloadGetLogSinkAttributeType, val CreateDistributionPayloadGetLogSinkRetType) { *arg = &val } @@ -144,10 +185,16 @@ func setCreateDistributionPayloadGetLogSinkAttributeType(arg *CreateDistribution */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetMonthlyLimitBytesAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetMonthlyLimitBytesArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetMonthlyLimitBytesRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(arg CreateDistributionPayloadGetMonthlyLimitBytesAttributeType) (ret CreateDistributionPayloadGetMonthlyLimitBytesRetType, ok bool) { if arg == nil { return ret, false @@ -155,6 +202,7 @@ func getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(arg CreateD return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetMonthlyLimitBytesAttributeType(arg *CreateDistributionPayloadGetMonthlyLimitBytesAttributeType, val CreateDistributionPayloadGetMonthlyLimitBytesRetType) { *arg = &val } @@ -164,10 +212,16 @@ func setCreateDistributionPayloadGetMonthlyLimitBytesAttributeType(arg *CreateDi */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetOptimizerAttributeType = *Optimizer + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetOptimizerArgType = Optimizer + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetOptimizerRetType = Optimizer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetOptimizerAttributeTypeOk(arg CreateDistributionPayloadGetOptimizerAttributeType) (ret CreateDistributionPayloadGetOptimizerRetType, ok bool) { if arg == nil { return ret, false @@ -175,6 +229,7 @@ func getCreateDistributionPayloadGetOptimizerAttributeTypeOk(arg CreateDistribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetOptimizerAttributeType(arg *CreateDistributionPayloadGetOptimizerAttributeType, val CreateDistributionPayloadGetOptimizerRetType) { *arg = &val } @@ -184,10 +239,16 @@ func setCreateDistributionPayloadGetOptimizerAttributeType(arg *CreateDistributi */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetRedirectsAttributeType = *RedirectConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetRedirectsArgType = RedirectConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetRedirectsRetType = RedirectConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetRedirectsAttributeTypeOk(arg CreateDistributionPayloadGetRedirectsAttributeType) (ret CreateDistributionPayloadGetRedirectsRetType, ok bool) { if arg == nil { return ret, false @@ -195,6 +256,7 @@ func getCreateDistributionPayloadGetRedirectsAttributeTypeOk(arg CreateDistribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetRedirectsAttributeType(arg *CreateDistributionPayloadGetRedirectsAttributeType, val CreateDistributionPayloadGetRedirectsRetType) { *arg = &val } @@ -204,10 +266,16 @@ func setCreateDistributionPayloadGetRedirectsAttributeType(arg *CreateDistributi */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetRegionsAttributeType = *[]Region + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetRegionsArgType = []Region + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetRegionsRetType = []Region +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetRegionsAttributeTypeOk(arg CreateDistributionPayloadGetRegionsAttributeType) (ret CreateDistributionPayloadGetRegionsRetType, ok bool) { if arg == nil { return ret, false @@ -215,6 +283,7 @@ func getCreateDistributionPayloadGetRegionsAttributeTypeOk(arg CreateDistributio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetRegionsAttributeType(arg *CreateDistributionPayloadGetRegionsAttributeType, val CreateDistributionPayloadGetRegionsRetType) { *arg = &val } @@ -224,10 +293,16 @@ func setCreateDistributionPayloadGetRegionsAttributeType(arg *CreateDistribution */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetWafAttributeType = *WafConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetWafArgType = WafConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadGetWafRetType = WafConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionPayloadGetWafAttributeTypeOk(arg CreateDistributionPayloadGetWafAttributeType) (ret CreateDistributionPayloadGetWafRetType, ok bool) { if arg == nil { return ret, false @@ -235,11 +310,13 @@ func getCreateDistributionPayloadGetWafAttributeTypeOk(arg CreateDistributionPay return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionPayloadGetWafAttributeType(arg *CreateDistributionPayloadGetWafAttributeType, val CreateDistributionPayloadGetWafRetType) { *arg = &val } // CreateDistributionPayload struct for CreateDistributionPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayload struct { // REQUIRED Backend CreateDistributionPayloadGetBackendAttributeType `json:"backend" required:"true"` @@ -262,12 +339,14 @@ type CreateDistributionPayload struct { Waf CreateDistributionPayloadGetWafAttributeType `json:"waf,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateDistributionPayload CreateDistributionPayload // NewCreateDistributionPayload instantiates a new CreateDistributionPayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateDistributionPayload(backend CreateDistributionPayloadGetBackendArgType, regions CreateDistributionPayloadGetRegionsArgType) *CreateDistributionPayload { this := CreateDistributionPayload{} setCreateDistributionPayloadGetBackendAttributeType(&this.Backend, backend) @@ -278,12 +357,14 @@ func NewCreateDistributionPayload(backend CreateDistributionPayloadGetBackendArg // NewCreateDistributionPayloadWithDefaults instantiates a new CreateDistributionPayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateDistributionPayloadWithDefaults() *CreateDistributionPayload { this := CreateDistributionPayload{} return &this } // GetBackend returns the Backend field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetBackend() (ret CreateDistributionPayloadGetBackendRetType) { ret, _ = o.GetBackendOk() return ret @@ -291,16 +372,19 @@ func (o *CreateDistributionPayload) GetBackend() (ret CreateDistributionPayloadG // GetBackendOk returns a tuple with the Backend field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetBackendOk() (ret CreateDistributionPayloadGetBackendRetType, ok bool) { return getCreateDistributionPayloadGetBackendAttributeTypeOk(o.Backend) } // SetBackend sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetBackend(v CreateDistributionPayloadGetBackendRetType) { setCreateDistributionPayloadGetBackendAttributeType(&o.Backend, v) } // GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetBlockedCountries() (res CreateDistributionPayloadGetBlockedCountriesRetType) { res, _ = o.GetBlockedCountriesOk() return @@ -308,22 +392,26 @@ func (o *CreateDistributionPayload) GetBlockedCountries() (res CreateDistributio // GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetBlockedCountriesOk() (ret CreateDistributionPayloadGetBlockedCountriesRetType, ok bool) { return getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(o.BlockedCountries) } // HasBlockedCountries returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasBlockedCountries() bool { _, ok := o.GetBlockedCountriesOk() return ok } // SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetBlockedCountries(v CreateDistributionPayloadGetBlockedCountriesRetType) { setCreateDistributionPayloadGetBlockedCountriesAttributeType(&o.BlockedCountries, v) } // GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetBlockedIps() (res CreateDistributionPayloadGetBlockedIpsRetType) { res, _ = o.GetBlockedIpsOk() return @@ -331,22 +419,26 @@ func (o *CreateDistributionPayload) GetBlockedIps() (res CreateDistributionPaylo // GetBlockedIpsOk returns a tuple with the BlockedIps field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetBlockedIpsOk() (ret CreateDistributionPayloadGetBlockedIpsRetType, ok bool) { return getCreateDistributionPayloadGetBlockedIpsAttributeTypeOk(o.BlockedIps) } // HasBlockedIps returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasBlockedIps() bool { _, ok := o.GetBlockedIpsOk() return ok } // SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetBlockedIps(v CreateDistributionPayloadGetBlockedIpsRetType) { setCreateDistributionPayloadGetBlockedIpsAttributeType(&o.BlockedIps, v) } // GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetDefaultCacheDuration() (res CreateDistributionPayloadGetDefaultCacheDurationRetType) { res, _ = o.GetDefaultCacheDurationOk() return @@ -354,22 +446,26 @@ func (o *CreateDistributionPayload) GetDefaultCacheDuration() (res CreateDistrib // GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetDefaultCacheDurationOk() (ret CreateDistributionPayloadGetDefaultCacheDurationRetType, ok bool) { return getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration) } // HasDefaultCacheDuration returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasDefaultCacheDuration() bool { _, ok := o.GetDefaultCacheDurationOk() return ok } // SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetDefaultCacheDuration(v CreateDistributionPayloadGetDefaultCacheDurationRetType) { setCreateDistributionPayloadGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v) } // GetIntentId returns the IntentId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetIntentId() (res CreateDistributionPayloadGetIntentIdRetType) { res, _ = o.GetIntentIdOk() return @@ -377,22 +473,26 @@ func (o *CreateDistributionPayload) GetIntentId() (res CreateDistributionPayload // GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetIntentIdOk() (ret CreateDistributionPayloadGetIntentIdRetType, ok bool) { return getCreateDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId) } // HasIntentId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasIntentId() bool { _, ok := o.GetIntentIdOk() return ok } // SetIntentId gets a reference to the given string and assigns it to the IntentId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetIntentId(v CreateDistributionPayloadGetIntentIdRetType) { setCreateDistributionPayloadGetIntentIdAttributeType(&o.IntentId, v) } // GetLogSink returns the LogSink field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetLogSink() (res CreateDistributionPayloadGetLogSinkRetType) { res, _ = o.GetLogSinkOk() return @@ -400,22 +500,26 @@ func (o *CreateDistributionPayload) GetLogSink() (res CreateDistributionPayloadG // GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetLogSinkOk() (ret CreateDistributionPayloadGetLogSinkRetType, ok bool) { return getCreateDistributionPayloadGetLogSinkAttributeTypeOk(o.LogSink) } // HasLogSink returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasLogSink() bool { _, ok := o.GetLogSinkOk() return ok } // SetLogSink gets a reference to the given CreateDistributionPayloadLogSink and assigns it to the LogSink field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetLogSink(v CreateDistributionPayloadGetLogSinkRetType) { setCreateDistributionPayloadGetLogSinkAttributeType(&o.LogSink, v) } // GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetMonthlyLimitBytes() (res CreateDistributionPayloadGetMonthlyLimitBytesRetType) { res, _ = o.GetMonthlyLimitBytesOk() return @@ -423,22 +527,26 @@ func (o *CreateDistributionPayload) GetMonthlyLimitBytes() (res CreateDistributi // GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetMonthlyLimitBytesOk() (ret CreateDistributionPayloadGetMonthlyLimitBytesRetType, ok bool) { return getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes) } // HasMonthlyLimitBytes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasMonthlyLimitBytes() bool { _, ok := o.GetMonthlyLimitBytesOk() return ok } // SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetMonthlyLimitBytes(v CreateDistributionPayloadGetMonthlyLimitBytesRetType) { setCreateDistributionPayloadGetMonthlyLimitBytesAttributeType(&o.MonthlyLimitBytes, v) } // GetOptimizer returns the Optimizer field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetOptimizer() (res CreateDistributionPayloadGetOptimizerRetType) { res, _ = o.GetOptimizerOk() return @@ -446,22 +554,26 @@ func (o *CreateDistributionPayload) GetOptimizer() (res CreateDistributionPayloa // GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetOptimizerOk() (ret CreateDistributionPayloadGetOptimizerRetType, ok bool) { return getCreateDistributionPayloadGetOptimizerAttributeTypeOk(o.Optimizer) } // HasOptimizer returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasOptimizer() bool { _, ok := o.GetOptimizerOk() return ok } // SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetOptimizer(v CreateDistributionPayloadGetOptimizerRetType) { setCreateDistributionPayloadGetOptimizerAttributeType(&o.Optimizer, v) } // GetRedirects returns the Redirects field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetRedirects() (res CreateDistributionPayloadGetRedirectsRetType) { res, _ = o.GetRedirectsOk() return @@ -469,22 +581,26 @@ func (o *CreateDistributionPayload) GetRedirects() (res CreateDistributionPayloa // GetRedirectsOk returns a tuple with the Redirects field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetRedirectsOk() (ret CreateDistributionPayloadGetRedirectsRetType, ok bool) { return getCreateDistributionPayloadGetRedirectsAttributeTypeOk(o.Redirects) } // HasRedirects returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasRedirects() bool { _, ok := o.GetRedirectsOk() return ok } // SetRedirects gets a reference to the given RedirectConfig and assigns it to the Redirects field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetRedirects(v CreateDistributionPayloadGetRedirectsRetType) { setCreateDistributionPayloadGetRedirectsAttributeType(&o.Redirects, v) } // GetRegions returns the Regions field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetRegions() (ret CreateDistributionPayloadGetRegionsRetType) { ret, _ = o.GetRegionsOk() return ret @@ -492,16 +608,19 @@ func (o *CreateDistributionPayload) GetRegions() (ret CreateDistributionPayloadG // GetRegionsOk returns a tuple with the Regions field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetRegionsOk() (ret CreateDistributionPayloadGetRegionsRetType, ok bool) { return getCreateDistributionPayloadGetRegionsAttributeTypeOk(o.Regions) } // SetRegions sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetRegions(v CreateDistributionPayloadGetRegionsRetType) { setCreateDistributionPayloadGetRegionsAttributeType(&o.Regions, v) } // GetWaf returns the Waf field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetWaf() (res CreateDistributionPayloadGetWafRetType) { res, _ = o.GetWafOk() return @@ -509,21 +628,25 @@ func (o *CreateDistributionPayload) GetWaf() (res CreateDistributionPayloadGetWa // GetWafOk returns a tuple with the Waf field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) GetWafOk() (ret CreateDistributionPayloadGetWafRetType, ok bool) { return getCreateDistributionPayloadGetWafAttributeTypeOk(o.Waf) } // HasWaf returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) HasWaf() bool { _, ok := o.GetWafOk() return ok } // SetWaf gets a reference to the given WafConfig and assigns it to the Waf field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionPayload) SetWaf(v CreateDistributionPayloadGetWafRetType) { setCreateDistributionPayloadGetWafAttributeType(&o.Waf, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateDistributionPayloadGetBackendAttributeTypeOk(o.Backend); ok { @@ -562,37 +685,45 @@ func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateDistributionPayload struct { value *CreateDistributionPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayload) Get() *CreateDistributionPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayload) Set(val *CreateDistributionPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateDistributionPayload(val *CreateDistributionPayload) *NullableCreateDistributionPayload { return &NullableCreateDistributionPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_create_distribution_payload_backend.go b/services/cdn/model_create_distribution_payload_backend.go index bc9e1b4b3..bccb5cb2d 100644 --- a/services/cdn/model_create_distribution_payload_backend.go +++ b/services/cdn/model_create_distribution_payload_backend.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,12 +17,14 @@ import ( ) // CreateDistributionPayloadBackend - Configuration for the content origin backend. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadBackend struct { BucketBackendCreate *BucketBackendCreate HttpBackendCreate *HttpBackendCreate } // BucketBackendCreateAsCreateDistributionPayloadBackend is a convenience function that returns BucketBackendCreate wrapped in CreateDistributionPayloadBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func BucketBackendCreateAsCreateDistributionPayloadBackend(v *BucketBackendCreate) CreateDistributionPayloadBackend { return CreateDistributionPayloadBackend{ BucketBackendCreate: v, @@ -29,6 +32,7 @@ func BucketBackendCreateAsCreateDistributionPayloadBackend(v *BucketBackendCreat } // HttpBackendCreateAsCreateDistributionPayloadBackend is a convenience function that returns HttpBackendCreate wrapped in CreateDistributionPayloadBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func HttpBackendCreateAsCreateDistributionPayloadBackend(v *HttpBackendCreate) CreateDistributionPayloadBackend { return CreateDistributionPayloadBackend{ HttpBackendCreate: v, @@ -36,6 +40,7 @@ func HttpBackendCreateAsCreateDistributionPayloadBackend(v *HttpBackendCreate) C } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *CreateDistributionPayloadBackend) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -98,6 +103,7 @@ func (dst *CreateDistributionPayloadBackend) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src CreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.BucketBackendCreate != nil { return json.Marshal(&src.BucketBackendCreate) } @@ -110,6 +116,7 @@ func (src CreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *CreateDistributionPayloadBackend) GetActualInstance() interface{} { if obj == nil { return nil @@ -126,37 +133,45 @@ func (obj *CreateDistributionPayloadBackend) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateDistributionPayloadBackend struct { value *CreateDistributionPayloadBackend isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayloadBackend) Get() *CreateDistributionPayloadBackend { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayloadBackend) Set(val *CreateDistributionPayloadBackend) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayloadBackend) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayloadBackend) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateDistributionPayloadBackend(val *CreateDistributionPayloadBackend) *NullableCreateDistributionPayloadBackend { return &NullableCreateDistributionPayloadBackend{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayloadBackend) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_create_distribution_payload_log_sink.go b/services/cdn/model_create_distribution_payload_log_sink.go index 351442cf7..34100f763 100644 --- a/services/cdn/model_create_distribution_payload_log_sink.go +++ b/services/cdn/model_create_distribution_payload_log_sink.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,11 +17,13 @@ import ( ) // CreateDistributionPayloadLogSink - struct for CreateDistributionPayloadLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionPayloadLogSink struct { LokiLogSinkCreate *LokiLogSinkCreate } // LokiLogSinkCreateAsCreateDistributionPayloadLogSink is a convenience function that returns LokiLogSinkCreate wrapped in CreateDistributionPayloadLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func LokiLogSinkCreateAsCreateDistributionPayloadLogSink(v *LokiLogSinkCreate) CreateDistributionPayloadLogSink { return CreateDistributionPayloadLogSink{ LokiLogSinkCreate: v, @@ -28,6 +31,7 @@ func LokiLogSinkCreateAsCreateDistributionPayloadLogSink(v *LokiLogSinkCreate) C } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -66,6 +70,7 @@ func (dst *CreateDistributionPayloadLogSink) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src CreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.LokiLogSinkCreate != nil { return json.Marshal(&src.LokiLogSinkCreate) } @@ -74,6 +79,7 @@ func (src CreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *CreateDistributionPayloadLogSink) GetActualInstance() interface{} { if obj == nil { return nil @@ -86,37 +92,45 @@ func (obj *CreateDistributionPayloadLogSink) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateDistributionPayloadLogSink struct { value *CreateDistributionPayloadLogSink isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayloadLogSink) Get() *CreateDistributionPayloadLogSink { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayloadLogSink) Set(val *CreateDistributionPayloadLogSink) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayloadLogSink) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayloadLogSink) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateDistributionPayloadLogSink(val *CreateDistributionPayloadLogSink) *NullableCreateDistributionPayloadLogSink { return &NullableCreateDistributionPayloadLogSink{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionPayloadLogSink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_create_distribution_response.go b/services/cdn/model_create_distribution_response.go index 92ee24f99..a8f4e4f79 100644 --- a/services/cdn/model_create_distribution_response.go +++ b/services/cdn/model_create_distribution_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateDistributionResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionResponseGetDistributionAttributeType = *Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionResponseGetDistributionArgType = Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionResponseGetDistributionRetType = Distribution +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateDistributionResponseGetDistributionAttributeTypeOk(arg CreateDistributionResponseGetDistributionAttributeType) (ret CreateDistributionResponseGetDistributionRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getCreateDistributionResponseGetDistributionAttributeTypeOk(arg CreateDistr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateDistributionResponseGetDistributionAttributeType(arg *CreateDistributionResponseGetDistributionAttributeType, val CreateDistributionResponseGetDistributionRetType) { *arg = &val } // CreateDistributionResponse struct for CreateDistributionResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateDistributionResponse struct { // REQUIRED Distribution CreateDistributionResponseGetDistributionAttributeType `json:"distribution" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateDistributionResponse CreateDistributionResponse // NewCreateDistributionResponse instantiates a new CreateDistributionResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateDistributionResponse(distribution CreateDistributionResponseGetDistributionArgType) *CreateDistributionResponse { this := CreateDistributionResponse{} setCreateDistributionResponseGetDistributionAttributeType(&this.Distribution, distribution) @@ -58,12 +69,14 @@ func NewCreateDistributionResponse(distribution CreateDistributionResponseGetDis // NewCreateDistributionResponseWithDefaults instantiates a new CreateDistributionResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateDistributionResponseWithDefaults() *CreateDistributionResponse { this := CreateDistributionResponse{} return &this } // GetDistribution returns the Distribution field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionResponse) GetDistribution() (ret CreateDistributionResponseGetDistributionRetType) { ret, _ = o.GetDistributionOk() return ret @@ -71,15 +84,18 @@ func (o *CreateDistributionResponse) GetDistribution() (ret CreateDistributionRe // GetDistributionOk returns a tuple with the Distribution field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionResponse) GetDistributionOk() (ret CreateDistributionResponseGetDistributionRetType, ok bool) { return getCreateDistributionResponseGetDistributionAttributeTypeOk(o.Distribution) } // SetDistribution sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateDistributionResponse) SetDistribution(v CreateDistributionResponseGetDistributionRetType) { setCreateDistributionResponseGetDistributionAttributeType(&o.Distribution, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateDistributionResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateDistributionResponseGetDistributionAttributeTypeOk(o.Distribution); ok { @@ -88,37 +104,45 @@ func (o CreateDistributionResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateDistributionResponse struct { value *CreateDistributionResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionResponse) Get() *CreateDistributionResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionResponse) Set(val *CreateDistributionResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateDistributionResponse(val *CreateDistributionResponse) *NullableCreateDistributionResponse { return &NullableCreateDistributionResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateDistributionResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateDistributionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_custom_domain.go b/services/cdn/model_custom_domain.go index 9352a0759..85dae7b64 100644 --- a/services/cdn/model_custom_domain.go +++ b/services/cdn/model_custom_domain.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CustomDomain{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetErrorsAttributeType = *[]StatusError + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetErrorsArgType = []StatusError + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetErrorsRetType = []StatusError +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCustomDomainGetErrorsAttributeTypeOk(arg CustomDomainGetErrorsAttributeType) (ret CustomDomainGetErrorsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCustomDomainGetErrorsAttributeTypeOk(arg CustomDomainGetErrorsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCustomDomainGetErrorsAttributeType(arg *CustomDomainGetErrorsAttributeType, val CustomDomainGetErrorsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setCustomDomainGetErrorsAttributeType(arg *CustomDomainGetErrorsAttributeTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCustomDomainGetNameAttributeTypeOk(arg CustomDomainGetNameAttributeType) (ret CustomDomainGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getCustomDomainGetNameAttributeTypeOk(arg CustomDomainGetNameAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCustomDomainGetNameAttributeType(arg *CustomDomainGetNameAttributeType, val CustomDomainGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetNameRetType = string /* @@ -63,10 +77,16 @@ type CustomDomainGetNameRetType = string */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetStatusAttributeType = *DomainStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetStatusArgType = DomainStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomainGetStatusRetType = DomainStatus +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCustomDomainGetStatusAttributeTypeOk(arg CustomDomainGetStatusAttributeType) (ret CustomDomainGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +94,13 @@ func getCustomDomainGetStatusAttributeTypeOk(arg CustomDomainGetStatusAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCustomDomainGetStatusAttributeType(arg *CustomDomainGetStatusAttributeType, val CustomDomainGetStatusRetType) { *arg = &val } // CustomDomain Definition of a custom domain +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CustomDomain struct { // This object is present if the custom domain has errors. Errors CustomDomainGetErrorsAttributeType `json:"errors,omitempty"` @@ -89,12 +111,14 @@ type CustomDomain struct { Status CustomDomainGetStatusAttributeType `json:"status" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CustomDomain CustomDomain // NewCustomDomain instantiates a new CustomDomain 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCustomDomain(name CustomDomainGetNameArgType, status CustomDomainGetStatusArgType) *CustomDomain { this := CustomDomain{} setCustomDomainGetNameAttributeType(&this.Name, name) @@ -105,12 +129,14 @@ func NewCustomDomain(name CustomDomainGetNameArgType, status CustomDomainGetStat // NewCustomDomainWithDefaults instantiates a new CustomDomain 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCustomDomainWithDefaults() *CustomDomain { this := CustomDomain{} return &this } // GetErrors returns the Errors field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) GetErrors() (res CustomDomainGetErrorsRetType) { res, _ = o.GetErrorsOk() return @@ -118,22 +144,26 @@ func (o *CustomDomain) GetErrors() (res CustomDomainGetErrorsRetType) { // GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) GetErrorsOk() (ret CustomDomainGetErrorsRetType, ok bool) { return getCustomDomainGetErrorsAttributeTypeOk(o.Errors) } // HasErrors returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) HasErrors() bool { _, ok := o.GetErrorsOk() return ok } // SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) SetErrors(v CustomDomainGetErrorsRetType) { setCustomDomainGetErrorsAttributeType(&o.Errors, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) GetName() (ret CustomDomainGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -141,16 +171,19 @@ func (o *CustomDomain) GetName() (ret CustomDomainGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) GetNameOk() (ret CustomDomainGetNameRetType, ok bool) { return getCustomDomainGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) SetName(v CustomDomainGetNameRetType) { setCustomDomainGetNameAttributeType(&o.Name, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) GetStatus() (ret CustomDomainGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -158,15 +191,18 @@ func (o *CustomDomain) GetStatus() (ret CustomDomainGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) GetStatusOk() (ret CustomDomainGetStatusRetType, ok bool) { return getCustomDomainGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CustomDomain) SetStatus(v CustomDomainGetStatusRetType) { setCustomDomainGetStatusAttributeType(&o.Status, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CustomDomain) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCustomDomainGetErrorsAttributeTypeOk(o.Errors); ok { @@ -181,37 +217,45 @@ func (o CustomDomain) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCustomDomain struct { value *CustomDomain isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCustomDomain) Get() *CustomDomain { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCustomDomain) Set(val *CustomDomain) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCustomDomain) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCustomDomain) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCustomDomain(val *CustomDomain) *NullableCustomDomain { return &NullableCustomDomain{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCustomDomain) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCustomDomain) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_delete_custom_domain_response.go b/services/cdn/model_delete_custom_domain_response.go index 3071d582a..705ac2b6b 100644 --- a/services/cdn/model_delete_custom_domain_response.go +++ b/services/cdn/model_delete_custom_domain_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &DeleteCustomDomainResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteCustomDomainResponseGetCustomDomainAttributeType = *CustomDomain + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteCustomDomainResponseGetCustomDomainArgType = CustomDomain + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteCustomDomainResponseGetCustomDomainRetType = CustomDomain +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDeleteCustomDomainResponseGetCustomDomainAttributeTypeOk(arg DeleteCustomDomainResponseGetCustomDomainAttributeType) (ret DeleteCustomDomainResponseGetCustomDomainRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getDeleteCustomDomainResponseGetCustomDomainAttributeTypeOk(arg DeleteCusto return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDeleteCustomDomainResponseGetCustomDomainAttributeType(arg *DeleteCustomDomainResponseGetCustomDomainAttributeType, val DeleteCustomDomainResponseGetCustomDomainRetType) { *arg = &val } // DeleteCustomDomainResponse Returns the custom domain that was deleted while the deletion has not completed yet. After the deletion was successful the response will be empty. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteCustomDomainResponse struct { CustomDomain DeleteCustomDomainResponseGetCustomDomainAttributeType `json:"customDomain,omitempty"` } @@ -46,6 +55,7 @@ type DeleteCustomDomainResponse struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDeleteCustomDomainResponse() *DeleteCustomDomainResponse { this := DeleteCustomDomainResponse{} return &this @@ -54,12 +64,14 @@ func NewDeleteCustomDomainResponse() *DeleteCustomDomainResponse { // NewDeleteCustomDomainResponseWithDefaults instantiates a new DeleteCustomDomainResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDeleteCustomDomainResponseWithDefaults() *DeleteCustomDomainResponse { this := DeleteCustomDomainResponse{} return &this } // GetCustomDomain returns the CustomDomain field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DeleteCustomDomainResponse) GetCustomDomain() (res DeleteCustomDomainResponseGetCustomDomainRetType) { res, _ = o.GetCustomDomainOk() return @@ -67,21 +79,25 @@ func (o *DeleteCustomDomainResponse) GetCustomDomain() (res DeleteCustomDomainRe // GetCustomDomainOk returns a tuple with the CustomDomain field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DeleteCustomDomainResponse) GetCustomDomainOk() (ret DeleteCustomDomainResponseGetCustomDomainRetType, ok bool) { return getDeleteCustomDomainResponseGetCustomDomainAttributeTypeOk(o.CustomDomain) } // HasCustomDomain returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DeleteCustomDomainResponse) HasCustomDomain() bool { _, ok := o.GetCustomDomainOk() return ok } // SetCustomDomain gets a reference to the given CustomDomain and assigns it to the CustomDomain field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DeleteCustomDomainResponse) SetCustomDomain(v DeleteCustomDomainResponseGetCustomDomainRetType) { setDeleteCustomDomainResponseGetCustomDomainAttributeType(&o.CustomDomain, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DeleteCustomDomainResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDeleteCustomDomainResponseGetCustomDomainAttributeTypeOk(o.CustomDomain); ok { @@ -90,37 +106,45 @@ func (o DeleteCustomDomainResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDeleteCustomDomainResponse struct { value *DeleteCustomDomainResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDeleteCustomDomainResponse) Get() *DeleteCustomDomainResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDeleteCustomDomainResponse) Set(val *DeleteCustomDomainResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDeleteCustomDomainResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDeleteCustomDomainResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDeleteCustomDomainResponse(val *DeleteCustomDomainResponse) *NullableDeleteCustomDomainResponse { return &NullableDeleteCustomDomainResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDeleteCustomDomainResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_delete_distribution_response.go b/services/cdn/model_delete_distribution_response.go index eccd3d613..e94bd540d 100644 --- a/services/cdn/model_delete_distribution_response.go +++ b/services/cdn/model_delete_distribution_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &DeleteDistributionResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteDistributionResponseGetDistributionAttributeType = *Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteDistributionResponseGetDistributionArgType = Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteDistributionResponseGetDistributionRetType = Distribution +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDeleteDistributionResponseGetDistributionAttributeTypeOk(arg DeleteDistributionResponseGetDistributionAttributeType) (ret DeleteDistributionResponseGetDistributionRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getDeleteDistributionResponseGetDistributionAttributeTypeOk(arg DeleteDistr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDeleteDistributionResponseGetDistributionAttributeType(arg *DeleteDistributionResponseGetDistributionAttributeType, val DeleteDistributionResponseGetDistributionRetType) { *arg = &val } // DeleteDistributionResponse struct for DeleteDistributionResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteDistributionResponse struct { Distribution DeleteDistributionResponseGetDistributionAttributeType `json:"distribution,omitempty"` } @@ -46,6 +55,7 @@ type DeleteDistributionResponse struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDeleteDistributionResponse() *DeleteDistributionResponse { this := DeleteDistributionResponse{} return &this @@ -54,12 +64,14 @@ func NewDeleteDistributionResponse() *DeleteDistributionResponse { // NewDeleteDistributionResponseWithDefaults instantiates a new DeleteDistributionResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDeleteDistributionResponseWithDefaults() *DeleteDistributionResponse { this := DeleteDistributionResponse{} return &this } // GetDistribution returns the Distribution field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DeleteDistributionResponse) GetDistribution() (res DeleteDistributionResponseGetDistributionRetType) { res, _ = o.GetDistributionOk() return @@ -67,21 +79,25 @@ func (o *DeleteDistributionResponse) GetDistribution() (res DeleteDistributionRe // GetDistributionOk returns a tuple with the Distribution field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DeleteDistributionResponse) GetDistributionOk() (ret DeleteDistributionResponseGetDistributionRetType, ok bool) { return getDeleteDistributionResponseGetDistributionAttributeTypeOk(o.Distribution) } // HasDistribution returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DeleteDistributionResponse) HasDistribution() bool { _, ok := o.GetDistributionOk() return ok } // SetDistribution gets a reference to the given Distribution and assigns it to the Distribution field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DeleteDistributionResponse) SetDistribution(v DeleteDistributionResponseGetDistributionRetType) { setDeleteDistributionResponseGetDistributionAttributeType(&o.Distribution, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DeleteDistributionResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDeleteDistributionResponseGetDistributionAttributeTypeOk(o.Distribution); ok { @@ -90,37 +106,45 @@ func (o DeleteDistributionResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDeleteDistributionResponse struct { value *DeleteDistributionResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDeleteDistributionResponse) Get() *DeleteDistributionResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDeleteDistributionResponse) Set(val *DeleteDistributionResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDeleteDistributionResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDeleteDistributionResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDeleteDistributionResponse(val *DeleteDistributionResponse) *NullableDeleteDistributionResponse { return &NullableDeleteDistributionResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDeleteDistributionResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDeleteDistributionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_distribution.go b/services/cdn/model_distribution.go index 76c4f930a..a80392164 100644 --- a/services/cdn/model_distribution.go +++ b/services/cdn/model_distribution.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -24,10 +25,16 @@ var _ MappedNullable = &Distribution{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetConfigAttributeType = *Config + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetConfigArgType = Config + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetConfigRetType = Config +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetConfigAttributeTypeOk(arg DistributionGetConfigAttributeType) (ret DistributionGetConfigRetType, ok bool) { if arg == nil { return ret, false @@ -35,6 +42,7 @@ func getDistributionGetConfigAttributeTypeOk(arg DistributionGetConfigAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetConfigAttributeType(arg *DistributionGetConfigAttributeType, val DistributionGetConfigRetType) { *arg = &val } @@ -44,10 +52,16 @@ func setDistributionGetConfigAttributeType(arg *DistributionGetConfigAttributeTy */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetCreatedAtAttributeTypeOk(arg DistributionGetCreatedAtAttributeType) (ret DistributionGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +69,7 @@ func getDistributionGetCreatedAtAttributeTypeOk(arg DistributionGetCreatedAtAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetCreatedAtAttributeType(arg *DistributionGetCreatedAtAttributeType, val DistributionGetCreatedAtRetType) { *arg = &val } @@ -64,10 +79,16 @@ func setDistributionGetCreatedAtAttributeType(arg *DistributionGetCreatedAtAttri */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetDomainsAttributeType = *[]Domain + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetDomainsArgType = []Domain + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetDomainsRetType = []Domain +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetDomainsAttributeTypeOk(arg DistributionGetDomainsAttributeType) (ret DistributionGetDomainsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +96,7 @@ func getDistributionGetDomainsAttributeTypeOk(arg DistributionGetDomainsAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetDomainsAttributeType(arg *DistributionGetDomainsAttributeType, val DistributionGetDomainsRetType) { *arg = &val } @@ -84,10 +106,16 @@ func setDistributionGetDomainsAttributeType(arg *DistributionGetDomainsAttribute */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetErrorsAttributeType = *[]StatusError + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetErrorsArgType = []StatusError + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetErrorsRetType = []StatusError +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetErrorsAttributeTypeOk(arg DistributionGetErrorsAttributeType) (ret DistributionGetErrorsRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +123,7 @@ func getDistributionGetErrorsAttributeTypeOk(arg DistributionGetErrorsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetErrorsAttributeType(arg *DistributionGetErrorsAttributeType, val DistributionGetErrorsRetType) { *arg = &val } @@ -104,8 +133,10 @@ func setDistributionGetErrorsAttributeType(arg *DistributionGetErrorsAttributeTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetIdAttributeTypeOk(arg DistributionGetIdAttributeType) (ret DistributionGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +144,15 @@ func getDistributionGetIdAttributeTypeOk(arg DistributionGetIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetIdAttributeType(arg *DistributionGetIdAttributeType, val DistributionGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetIdRetType = string /* @@ -125,8 +160,10 @@ type DistributionGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetProjectIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetProjectIdAttributeTypeOk(arg DistributionGetProjectIdAttributeType) (ret DistributionGetProjectIdRetType, ok bool) { if arg == nil { return ret, false @@ -134,11 +171,15 @@ func getDistributionGetProjectIdAttributeTypeOk(arg DistributionGetProjectIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetProjectIdAttributeType(arg *DistributionGetProjectIdAttributeType, val DistributionGetProjectIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetProjectIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetProjectIdRetType = string /* @@ -149,18 +190,25 @@ type DistributionGetProjectIdRetType = string // DistributionStatus - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatus string // List of Status const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead DISTRIBUTIONSTATUS_CREATING DistributionStatus = "CREATING" - DISTRIBUTIONSTATUS_ACTIVE DistributionStatus = "ACTIVE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DISTRIBUTIONSTATUS_ACTIVE DistributionStatus = "ACTIVE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead DISTRIBUTIONSTATUS_UPDATING DistributionStatus = "UPDATING" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead DISTRIBUTIONSTATUS_DELETING DistributionStatus = "DELETING" - DISTRIBUTIONSTATUS_ERROR DistributionStatus = "ERROR" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DISTRIBUTIONSTATUS_ERROR DistributionStatus = "ERROR" ) // All allowed values of Distribution enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedDistributionStatusEnumValues = []DistributionStatus{ "CREATING", "ACTIVE", @@ -169,6 +217,7 @@ var AllowedDistributionStatusEnumValues = []DistributionStatus{ "ERROR", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *DistributionStatus) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers @@ -196,6 +245,7 @@ func (v *DistributionStatus) UnmarshalJSON(src []byte) error { // NewDistributionStatusFromValue returns a pointer to a valid DistributionStatus // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatusFromValue(v DistributionStatus) (*DistributionStatus, error) { ev := DistributionStatus(v) if ev.IsValid() { @@ -206,6 +256,7 @@ func NewDistributionStatusFromValue(v DistributionStatus) (*DistributionStatus, } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v DistributionStatus) IsValid() bool { for _, existing := range AllowedDistributionStatusEnumValues { if existing == v { @@ -216,50 +267,65 @@ func (v DistributionStatus) IsValid() bool { } // Ptr returns reference to StatusStatus value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v DistributionStatus) Ptr() *DistributionStatus { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDistributionStatus struct { value *DistributionStatus isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatus) Get() *DistributionStatus { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatus) Set(val *DistributionStatus) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatus) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatus) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDistributionStatus(val *DistributionStatus) *NullableDistributionStatus { return &NullableDistributionStatus{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatus) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatus) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetStatusAttributeType = *DistributionStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetStatusArgType = DistributionStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetStatusRetType = DistributionStatus +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetStatusAttributeTypeOk(arg DistributionGetStatusAttributeType) (ret DistributionGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -267,6 +333,7 @@ func getDistributionGetStatusAttributeTypeOk(arg DistributionGetStatusAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetStatusAttributeType(arg *DistributionGetStatusAttributeType, val DistributionGetStatusRetType) { *arg = &val } @@ -276,10 +343,16 @@ func setDistributionGetStatusAttributeType(arg *DistributionGetStatusAttributeTy */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetUpdatedAtAttributeTypeOk(arg DistributionGetUpdatedAtAttributeType) (ret DistributionGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -287,6 +360,7 @@ func getDistributionGetUpdatedAtAttributeTypeOk(arg DistributionGetUpdatedAtAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetUpdatedAtAttributeType(arg *DistributionGetUpdatedAtAttributeType, val DistributionGetUpdatedAtRetType) { *arg = &val } @@ -296,10 +370,16 @@ func setDistributionGetUpdatedAtAttributeType(arg *DistributionGetUpdatedAtAttri */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetWafAttributeType = *DistributionWaf + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetWafArgType = DistributionWaf + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionGetWafRetType = DistributionWaf +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionGetWafAttributeTypeOk(arg DistributionGetWafAttributeType) (ret DistributionGetWafRetType, ok bool) { if arg == nil { return ret, false @@ -307,11 +387,13 @@ func getDistributionGetWafAttributeTypeOk(arg DistributionGetWafAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionGetWafAttributeType(arg *DistributionGetWafAttributeType, val DistributionGetWafRetType) { *arg = &val } // Distribution struct for Distribution +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Distribution struct { // REQUIRED Config DistributionGetConfigAttributeType `json:"config" required:"true"` @@ -335,12 +417,14 @@ type Distribution struct { Waf DistributionGetWafAttributeType `json:"waf,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Distribution Distribution // NewDistribution instantiates a new Distribution 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistribution(config DistributionGetConfigArgType, createdAt DistributionGetCreatedAtArgType, domains DistributionGetDomainsArgType, id DistributionGetIdArgType, projectId DistributionGetProjectIdArgType, status DistributionGetStatusArgType, updatedAt DistributionGetUpdatedAtArgType) *Distribution { this := Distribution{} setDistributionGetConfigAttributeType(&this.Config, config) @@ -356,12 +440,14 @@ func NewDistribution(config DistributionGetConfigArgType, createdAt Distribution // NewDistributionWithDefaults instantiates a new Distribution 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionWithDefaults() *Distribution { this := Distribution{} return &this } // GetConfig returns the Config field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetConfig() (ret DistributionGetConfigRetType) { ret, _ = o.GetConfigOk() return ret @@ -369,16 +455,19 @@ func (o *Distribution) GetConfig() (ret DistributionGetConfigRetType) { // GetConfigOk returns a tuple with the Config field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetConfigOk() (ret DistributionGetConfigRetType, ok bool) { return getDistributionGetConfigAttributeTypeOk(o.Config) } // SetConfig sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetConfig(v DistributionGetConfigRetType) { setDistributionGetConfigAttributeType(&o.Config, v) } // GetCreatedAt returns the CreatedAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetCreatedAt() (ret DistributionGetCreatedAtRetType) { ret, _ = o.GetCreatedAtOk() return ret @@ -386,16 +475,19 @@ func (o *Distribution) GetCreatedAt() (ret DistributionGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetCreatedAtOk() (ret DistributionGetCreatedAtRetType, ok bool) { return getDistributionGetCreatedAtAttributeTypeOk(o.CreatedAt) } // SetCreatedAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetCreatedAt(v DistributionGetCreatedAtRetType) { setDistributionGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDomains returns the Domains field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetDomains() (ret DistributionGetDomainsRetType) { ret, _ = o.GetDomainsOk() return ret @@ -403,16 +495,19 @@ func (o *Distribution) GetDomains() (ret DistributionGetDomainsRetType) { // GetDomainsOk returns a tuple with the Domains field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetDomainsOk() (ret DistributionGetDomainsRetType, ok bool) { return getDistributionGetDomainsAttributeTypeOk(o.Domains) } // SetDomains sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetDomains(v DistributionGetDomainsRetType) { setDistributionGetDomainsAttributeType(&o.Domains, v) } // GetErrors returns the Errors field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetErrors() (res DistributionGetErrorsRetType) { res, _ = o.GetErrorsOk() return @@ -420,22 +515,26 @@ func (o *Distribution) GetErrors() (res DistributionGetErrorsRetType) { // GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetErrorsOk() (ret DistributionGetErrorsRetType, ok bool) { return getDistributionGetErrorsAttributeTypeOk(o.Errors) } // HasErrors returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) HasErrors() bool { _, ok := o.GetErrorsOk() return ok } // SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetErrors(v DistributionGetErrorsRetType) { setDistributionGetErrorsAttributeType(&o.Errors, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetId() (ret DistributionGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -443,16 +542,19 @@ func (o *Distribution) GetId() (ret DistributionGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetIdOk() (ret DistributionGetIdRetType, ok bool) { return getDistributionGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetId(v DistributionGetIdRetType) { setDistributionGetIdAttributeType(&o.Id, v) } // GetProjectId returns the ProjectId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetProjectId() (ret DistributionGetProjectIdRetType) { ret, _ = o.GetProjectIdOk() return ret @@ -460,16 +562,19 @@ func (o *Distribution) GetProjectId() (ret DistributionGetProjectIdRetType) { // GetProjectIdOk returns a tuple with the ProjectId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetProjectIdOk() (ret DistributionGetProjectIdRetType, ok bool) { return getDistributionGetProjectIdAttributeTypeOk(o.ProjectId) } // SetProjectId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetProjectId(v DistributionGetProjectIdRetType) { setDistributionGetProjectIdAttributeType(&o.ProjectId, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetStatus() (ret DistributionGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -477,16 +582,19 @@ func (o *Distribution) GetStatus() (ret DistributionGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetStatusOk() (ret DistributionGetStatusRetType, ok bool) { return getDistributionGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetStatus(v DistributionGetStatusRetType) { setDistributionGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetUpdatedAt() (ret DistributionGetUpdatedAtRetType) { ret, _ = o.GetUpdatedAtOk() return ret @@ -494,16 +602,19 @@ func (o *Distribution) GetUpdatedAt() (ret DistributionGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetUpdatedAtOk() (ret DistributionGetUpdatedAtRetType, ok bool) { return getDistributionGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // SetUpdatedAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetUpdatedAt(v DistributionGetUpdatedAtRetType) { setDistributionGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetWaf returns the Waf field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetWaf() (res DistributionGetWafRetType) { res, _ = o.GetWafOk() return @@ -511,21 +622,25 @@ func (o *Distribution) GetWaf() (res DistributionGetWafRetType) { // GetWafOk returns a tuple with the Waf field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) GetWafOk() (ret DistributionGetWafRetType, ok bool) { return getDistributionGetWafAttributeTypeOk(o.Waf) } // HasWaf returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) HasWaf() bool { _, ok := o.GetWafOk() return ok } // SetWaf gets a reference to the given DistributionWaf and assigns it to the Waf field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Distribution) SetWaf(v DistributionGetWafRetType) { setDistributionGetWafAttributeType(&o.Waf, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Distribution) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDistributionGetConfigAttributeTypeOk(o.Config); ok { @@ -558,37 +673,45 @@ func (o Distribution) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDistribution struct { value *Distribution isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistribution) Get() *Distribution { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistribution) Set(val *Distribution) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistribution) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistribution) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDistribution(val *Distribution) *NullableDistribution { return &NullableDistribution{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistribution) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistribution) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_distribution_logs_record.go b/services/cdn/model_distribution_logs_record.go index 19380d462..c81c5fe69 100644 --- a/services/cdn/model_distribution_logs_record.go +++ b/services/cdn/model_distribution_logs_record.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &DistributionLogsRecord{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordgetCacheHitAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordgetCacheHitArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordgetCacheHitRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordgetCacheHitAttributeTypeOk(arg DistributionLogsRecordgetCacheHitAttributeType) (ret DistributionLogsRecordgetCacheHitRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getDistributionLogsRecordgetCacheHitAttributeTypeOk(arg DistributionLogsRec return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordgetCacheHitAttributeType(arg *DistributionLogsRecordgetCacheHitAttributeType, val DistributionLogsRecordgetCacheHitRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setDistributionLogsRecordgetCacheHitAttributeType(arg *DistributionLogsReco */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetDataCenterRegionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetDataCenterRegionAttributeTypeOk(arg DistributionLogsRecordGetDataCenterRegionAttributeType) (ret DistributionLogsRecordGetDataCenterRegionRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getDistributionLogsRecordGetDataCenterRegionAttributeTypeOk(arg Distributio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetDataCenterRegionAttributeType(arg *DistributionLogsRecordGetDataCenterRegionAttributeType, val DistributionLogsRecordGetDataCenterRegionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetDataCenterRegionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetDataCenterRegionRetType = string /* @@ -64,8 +78,10 @@ type DistributionLogsRecordGetDataCenterRegionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetDistributionIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetDistributionIdAttributeTypeOk(arg DistributionLogsRecordGetDistributionIdAttributeType) (ret DistributionLogsRecordGetDistributionIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getDistributionLogsRecordGetDistributionIdAttributeTypeOk(arg DistributionL return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetDistributionIdAttributeType(arg *DistributionLogsRecordGetDistributionIdAttributeType, val DistributionLogsRecordGetDistributionIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetDistributionIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetDistributionIdRetType = string /* @@ -85,8 +105,10 @@ type DistributionLogsRecordGetDistributionIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetHostAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetHostAttributeTypeOk(arg DistributionLogsRecordGetHostAttributeType) (ret DistributionLogsRecordGetHostRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +116,15 @@ func getDistributionLogsRecordGetHostAttributeTypeOk(arg DistributionLogsRecordG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetHostAttributeType(arg *DistributionLogsRecordGetHostAttributeType, val DistributionLogsRecordGetHostRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetHostArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetHostRetType = string /* @@ -106,8 +132,10 @@ type DistributionLogsRecordGetHostRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetPathAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetPathAttributeTypeOk(arg DistributionLogsRecordGetPathAttributeType) (ret DistributionLogsRecordGetPathRetType, ok bool) { if arg == nil { return ret, false @@ -115,11 +143,15 @@ func getDistributionLogsRecordGetPathAttributeTypeOk(arg DistributionLogsRecordG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetPathAttributeType(arg *DistributionLogsRecordGetPathAttributeType, val DistributionLogsRecordGetPathRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetPathArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetPathRetType = string /* @@ -127,8 +159,10 @@ type DistributionLogsRecordGetPathRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetRequestCountryCodeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetRequestCountryCodeAttributeTypeOk(arg DistributionLogsRecordGetRequestCountryCodeAttributeType) (ret DistributionLogsRecordGetRequestCountryCodeRetType, ok bool) { if arg == nil { return ret, false @@ -136,11 +170,15 @@ func getDistributionLogsRecordGetRequestCountryCodeAttributeTypeOk(arg Distribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetRequestCountryCodeAttributeType(arg *DistributionLogsRecordGetRequestCountryCodeAttributeType, val DistributionLogsRecordGetRequestCountryCodeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetRequestCountryCodeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetRequestCountryCodeRetType = string /* @@ -148,10 +186,16 @@ type DistributionLogsRecordGetRequestCountryCodeRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetSizeAttributeTypeOk(arg DistributionLogsRecordGetSizeAttributeType) (ret DistributionLogsRecordGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -159,6 +203,7 @@ func getDistributionLogsRecordGetSizeAttributeTypeOk(arg DistributionLogsRecordG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetSizeAttributeType(arg *DistributionLogsRecordGetSizeAttributeType, val DistributionLogsRecordGetSizeRetType) { *arg = &val } @@ -168,10 +213,16 @@ func setDistributionLogsRecordGetSizeAttributeType(arg *DistributionLogsRecordGe */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetStatusCodeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetStatusCodeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetStatusCodeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetStatusCodeAttributeTypeOk(arg DistributionLogsRecordGetStatusCodeAttributeType) (ret DistributionLogsRecordGetStatusCodeRetType, ok bool) { if arg == nil { return ret, false @@ -179,6 +230,7 @@ func getDistributionLogsRecordGetStatusCodeAttributeTypeOk(arg DistributionLogsR return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetStatusCodeAttributeType(arg *DistributionLogsRecordGetStatusCodeAttributeType, val DistributionLogsRecordGetStatusCodeRetType) { *arg = &val } @@ -188,10 +240,16 @@ func setDistributionLogsRecordGetStatusCodeAttributeType(arg *DistributionLogsRe */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetTimestampAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetTimestampArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetTimestampRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetTimestampAttributeTypeOk(arg DistributionLogsRecordGetTimestampAttributeType) (ret DistributionLogsRecordGetTimestampRetType, ok bool) { if arg == nil { return ret, false @@ -199,6 +257,7 @@ func getDistributionLogsRecordGetTimestampAttributeTypeOk(arg DistributionLogsRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetTimestampAttributeType(arg *DistributionLogsRecordGetTimestampAttributeType, val DistributionLogsRecordGetTimestampRetType) { *arg = &val } @@ -208,10 +267,16 @@ func setDistributionLogsRecordGetTimestampAttributeType(arg *DistributionLogsRec */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetWafViolationAttributeType = *WAFViolation + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetWafViolationArgType = WAFViolation + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecordGetWafViolationRetType = WAFViolation +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionLogsRecordGetWafViolationAttributeTypeOk(arg DistributionLogsRecordGetWafViolationAttributeType) (ret DistributionLogsRecordGetWafViolationRetType, ok bool) { if arg == nil { return ret, false @@ -219,11 +284,13 @@ func getDistributionLogsRecordGetWafViolationAttributeTypeOk(arg DistributionLog return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionLogsRecordGetWafViolationAttributeType(arg *DistributionLogsRecordGetWafViolationAttributeType, val DistributionLogsRecordGetWafViolationRetType) { *arg = &val } // DistributionLogsRecord struct for DistributionLogsRecord +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionLogsRecord struct { // REQUIRED CacheHit DistributionLogsRecordgetCacheHitAttributeType `json:"cacheHit" required:"true"` @@ -248,12 +315,14 @@ type DistributionLogsRecord struct { WafViolation DistributionLogsRecordGetWafViolationAttributeType `json:"wafViolation,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DistributionLogsRecord DistributionLogsRecord // NewDistributionLogsRecord instantiates a new DistributionLogsRecord 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionLogsRecord(cacheHit DistributionLogsRecordgetCacheHitArgType, dataCenterRegion DistributionLogsRecordGetDataCenterRegionArgType, distributionId DistributionLogsRecordGetDistributionIdArgType, host DistributionLogsRecordGetHostArgType, path DistributionLogsRecordGetPathArgType, requestCountryCode DistributionLogsRecordGetRequestCountryCodeArgType, size DistributionLogsRecordGetSizeArgType, statusCode DistributionLogsRecordGetStatusCodeArgType, timestamp DistributionLogsRecordGetTimestampArgType) *DistributionLogsRecord { this := DistributionLogsRecord{} setDistributionLogsRecordgetCacheHitAttributeType(&this.CacheHit, cacheHit) @@ -271,12 +340,14 @@ func NewDistributionLogsRecord(cacheHit DistributionLogsRecordgetCacheHitArgType // NewDistributionLogsRecordWithDefaults instantiates a new DistributionLogsRecord 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionLogsRecordWithDefaults() *DistributionLogsRecord { this := DistributionLogsRecord{} return &this } // GetCacheHit returns the CacheHit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetCacheHit() (ret DistributionLogsRecordgetCacheHitRetType) { ret, _ = o.GetCacheHitOk() return ret @@ -284,16 +355,19 @@ func (o *DistributionLogsRecord) GetCacheHit() (ret DistributionLogsRecordgetCac // GetCacheHitOk returns a tuple with the CacheHit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetCacheHitOk() (ret DistributionLogsRecordgetCacheHitRetType, ok bool) { return getDistributionLogsRecordgetCacheHitAttributeTypeOk(o.CacheHit) } // SetCacheHit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetCacheHit(v DistributionLogsRecordgetCacheHitRetType) { setDistributionLogsRecordgetCacheHitAttributeType(&o.CacheHit, v) } // GetDataCenterRegion returns the DataCenterRegion field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetDataCenterRegion() (ret DistributionLogsRecordGetDataCenterRegionRetType) { ret, _ = o.GetDataCenterRegionOk() return ret @@ -301,16 +375,19 @@ func (o *DistributionLogsRecord) GetDataCenterRegion() (ret DistributionLogsReco // GetDataCenterRegionOk returns a tuple with the DataCenterRegion field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetDataCenterRegionOk() (ret DistributionLogsRecordGetDataCenterRegionRetType, ok bool) { return getDistributionLogsRecordGetDataCenterRegionAttributeTypeOk(o.DataCenterRegion) } // SetDataCenterRegion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetDataCenterRegion(v DistributionLogsRecordGetDataCenterRegionRetType) { setDistributionLogsRecordGetDataCenterRegionAttributeType(&o.DataCenterRegion, v) } // GetDistributionId returns the DistributionId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetDistributionId() (ret DistributionLogsRecordGetDistributionIdRetType) { ret, _ = o.GetDistributionIdOk() return ret @@ -318,16 +395,19 @@ func (o *DistributionLogsRecord) GetDistributionId() (ret DistributionLogsRecord // GetDistributionIdOk returns a tuple with the DistributionId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetDistributionIdOk() (ret DistributionLogsRecordGetDistributionIdRetType, ok bool) { return getDistributionLogsRecordGetDistributionIdAttributeTypeOk(o.DistributionId) } // SetDistributionId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetDistributionId(v DistributionLogsRecordGetDistributionIdRetType) { setDistributionLogsRecordGetDistributionIdAttributeType(&o.DistributionId, v) } // GetHost returns the Host field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetHost() (ret DistributionLogsRecordGetHostRetType) { ret, _ = o.GetHostOk() return ret @@ -335,16 +415,19 @@ func (o *DistributionLogsRecord) GetHost() (ret DistributionLogsRecordGetHostRet // GetHostOk returns a tuple with the Host field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetHostOk() (ret DistributionLogsRecordGetHostRetType, ok bool) { return getDistributionLogsRecordGetHostAttributeTypeOk(o.Host) } // SetHost sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetHost(v DistributionLogsRecordGetHostRetType) { setDistributionLogsRecordGetHostAttributeType(&o.Host, v) } // GetPath returns the Path field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetPath() (ret DistributionLogsRecordGetPathRetType) { ret, _ = o.GetPathOk() return ret @@ -352,16 +435,19 @@ func (o *DistributionLogsRecord) GetPath() (ret DistributionLogsRecordGetPathRet // GetPathOk returns a tuple with the Path field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetPathOk() (ret DistributionLogsRecordGetPathRetType, ok bool) { return getDistributionLogsRecordGetPathAttributeTypeOk(o.Path) } // SetPath sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetPath(v DistributionLogsRecordGetPathRetType) { setDistributionLogsRecordGetPathAttributeType(&o.Path, v) } // GetRequestCountryCode returns the RequestCountryCode field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetRequestCountryCode() (ret DistributionLogsRecordGetRequestCountryCodeRetType) { ret, _ = o.GetRequestCountryCodeOk() return ret @@ -369,16 +455,19 @@ func (o *DistributionLogsRecord) GetRequestCountryCode() (ret DistributionLogsRe // GetRequestCountryCodeOk returns a tuple with the RequestCountryCode field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetRequestCountryCodeOk() (ret DistributionLogsRecordGetRequestCountryCodeRetType, ok bool) { return getDistributionLogsRecordGetRequestCountryCodeAttributeTypeOk(o.RequestCountryCode) } // SetRequestCountryCode sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetRequestCountryCode(v DistributionLogsRecordGetRequestCountryCodeRetType) { setDistributionLogsRecordGetRequestCountryCodeAttributeType(&o.RequestCountryCode, v) } // GetSize returns the Size field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetSize() (ret DistributionLogsRecordGetSizeRetType) { ret, _ = o.GetSizeOk() return ret @@ -386,16 +475,19 @@ func (o *DistributionLogsRecord) GetSize() (ret DistributionLogsRecordGetSizeRet // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetSizeOk() (ret DistributionLogsRecordGetSizeRetType, ok bool) { return getDistributionLogsRecordGetSizeAttributeTypeOk(o.Size) } // SetSize sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetSize(v DistributionLogsRecordGetSizeRetType) { setDistributionLogsRecordGetSizeAttributeType(&o.Size, v) } // GetStatusCode returns the StatusCode field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetStatusCode() (ret DistributionLogsRecordGetStatusCodeRetType) { ret, _ = o.GetStatusCodeOk() return ret @@ -403,16 +495,19 @@ func (o *DistributionLogsRecord) GetStatusCode() (ret DistributionLogsRecordGetS // GetStatusCodeOk returns a tuple with the StatusCode field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetStatusCodeOk() (ret DistributionLogsRecordGetStatusCodeRetType, ok bool) { return getDistributionLogsRecordGetStatusCodeAttributeTypeOk(o.StatusCode) } // SetStatusCode sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetStatusCode(v DistributionLogsRecordGetStatusCodeRetType) { setDistributionLogsRecordGetStatusCodeAttributeType(&o.StatusCode, v) } // GetTimestamp returns the Timestamp field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetTimestamp() (ret DistributionLogsRecordGetTimestampRetType) { ret, _ = o.GetTimestampOk() return ret @@ -420,16 +515,19 @@ func (o *DistributionLogsRecord) GetTimestamp() (ret DistributionLogsRecordGetTi // GetTimestampOk returns a tuple with the Timestamp field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetTimestampOk() (ret DistributionLogsRecordGetTimestampRetType, ok bool) { return getDistributionLogsRecordGetTimestampAttributeTypeOk(o.Timestamp) } // SetTimestamp sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetTimestamp(v DistributionLogsRecordGetTimestampRetType) { setDistributionLogsRecordGetTimestampAttributeType(&o.Timestamp, v) } // GetWafViolation returns the WafViolation field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetWafViolation() (res DistributionLogsRecordGetWafViolationRetType) { res, _ = o.GetWafViolationOk() return @@ -437,21 +535,25 @@ func (o *DistributionLogsRecord) GetWafViolation() (res DistributionLogsRecordGe // GetWafViolationOk returns a tuple with the WafViolation field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) GetWafViolationOk() (ret DistributionLogsRecordGetWafViolationRetType, ok bool) { return getDistributionLogsRecordGetWafViolationAttributeTypeOk(o.WafViolation) } // HasWafViolation returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) HasWafViolation() bool { _, ok := o.GetWafViolationOk() return ok } // SetWafViolation gets a reference to the given WAFViolation and assigns it to the WafViolation field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionLogsRecord) SetWafViolation(v DistributionLogsRecordGetWafViolationRetType) { setDistributionLogsRecordGetWafViolationAttributeType(&o.WafViolation, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DistributionLogsRecord) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDistributionLogsRecordgetCacheHitAttributeTypeOk(o.CacheHit); ok { @@ -487,37 +589,45 @@ func (o DistributionLogsRecord) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDistributionLogsRecord struct { value *DistributionLogsRecord isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionLogsRecord) Get() *DistributionLogsRecord { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionLogsRecord) Set(val *DistributionLogsRecord) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionLogsRecord) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionLogsRecord) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDistributionLogsRecord(val *DistributionLogsRecord) *NullableDistributionLogsRecord { return &NullableDistributionLogsRecord{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionLogsRecord) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionLogsRecord) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_distribution_statistics_record.go b/services/cdn/model_distribution_statistics_record.go index 04f554f1b..8423259a6 100644 --- a/services/cdn/model_distribution_statistics_record.go +++ b/services/cdn/model_distribution_statistics_record.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &DistributionStatisticsRecord{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetCachedRequestsAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetCachedRequestsArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetCachedRequestsRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordGetCachedRequestsAttributeTypeOk(arg DistributionStatisticsRecordGetCachedRequestsAttributeType) (ret DistributionStatisticsRecordGetCachedRequestsRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getDistributionStatisticsRecordGetCachedRequestsAttributeTypeOk(arg Distrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordGetCachedRequestsAttributeType(arg *DistributionStatisticsRecordGetCachedRequestsAttributeType, val DistributionStatisticsRecordGetCachedRequestsRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setDistributionStatisticsRecordGetCachedRequestsAttributeType(arg *Distribu */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetTotalRequestsAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetTotalRequestsArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetTotalRequestsRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordGetTotalRequestsAttributeTypeOk(arg DistributionStatisticsRecordGetTotalRequestsAttributeType) (ret DistributionStatisticsRecordGetTotalRequestsRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getDistributionStatisticsRecordGetTotalRequestsAttributeTypeOk(arg Distribu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordGetTotalRequestsAttributeType(arg *DistributionStatisticsRecordGetTotalRequestsAttributeType, val DistributionStatisticsRecordGetTotalRequestsRetType) { *arg = &val } @@ -63,10 +78,16 @@ func setDistributionStatisticsRecordGetTotalRequestsAttributeType(arg *Distribut */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetTotalTrafficBytesAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetTotalTrafficBytesArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetTotalTrafficBytesRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordGetTotalTrafficBytesAttributeTypeOk(arg DistributionStatisticsRecordGetTotalTrafficBytesAttributeType) (ret DistributionStatisticsRecordGetTotalTrafficBytesRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +95,7 @@ func getDistributionStatisticsRecordGetTotalTrafficBytesAttributeTypeOk(arg Dist return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordGetTotalTrafficBytesAttributeType(arg *DistributionStatisticsRecordGetTotalTrafficBytesAttributeType, val DistributionStatisticsRecordGetTotalTrafficBytesRetType) { *arg = &val } @@ -83,10 +105,16 @@ func setDistributionStatisticsRecordGetTotalTrafficBytesAttributeType(arg *Distr */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetEndAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetEndArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetEndRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordGetEndAttributeTypeOk(arg DistributionStatisticsRecordGetEndAttributeType) (ret DistributionStatisticsRecordGetEndRetType, ok bool) { if arg == nil { return ret, false @@ -94,6 +122,7 @@ func getDistributionStatisticsRecordGetEndAttributeTypeOk(arg DistributionStatis return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordGetEndAttributeType(arg *DistributionStatisticsRecordGetEndAttributeType, val DistributionStatisticsRecordGetEndRetType) { *arg = &val } @@ -103,10 +132,16 @@ func setDistributionStatisticsRecordGetEndAttributeType(arg *DistributionStatist */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetRegionsAttributeType = *DistributionStatisticsRecordRegions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetRegionsArgType = DistributionStatisticsRecordRegions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetRegionsRetType = DistributionStatisticsRecordRegions +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordGetRegionsAttributeTypeOk(arg DistributionStatisticsRecordGetRegionsAttributeType) (ret DistributionStatisticsRecordGetRegionsRetType, ok bool) { if arg == nil { return ret, false @@ -114,6 +149,7 @@ func getDistributionStatisticsRecordGetRegionsAttributeTypeOk(arg DistributionSt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordGetRegionsAttributeType(arg *DistributionStatisticsRecordGetRegionsAttributeType, val DistributionStatisticsRecordGetRegionsRetType) { *arg = &val } @@ -123,10 +159,16 @@ func setDistributionStatisticsRecordGetRegionsAttributeType(arg *DistributionSta */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetStartAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetStartArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordGetStartRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordGetStartAttributeTypeOk(arg DistributionStatisticsRecordGetStartAttributeType) (ret DistributionStatisticsRecordGetStartRetType, ok bool) { if arg == nil { return ret, false @@ -134,11 +176,13 @@ func getDistributionStatisticsRecordGetStartAttributeTypeOk(arg DistributionStat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordGetStartAttributeType(arg *DistributionStatisticsRecordGetStartAttributeType, val DistributionStatisticsRecordGetStartRetType) { *arg = &val } // DistributionStatisticsRecord Aggregated statistics of a distribution during a time interval +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecord struct { // Number of cached requests that were served // REQUIRED @@ -159,12 +203,14 @@ type DistributionStatisticsRecord struct { Start DistributionStatisticsRecordGetStartAttributeType `json:"start" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DistributionStatisticsRecord DistributionStatisticsRecord // NewDistributionStatisticsRecord instantiates a new DistributionStatisticsRecord 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatisticsRecord(cachedRequests DistributionStatisticsRecordGetCachedRequestsArgType, totalRequests DistributionStatisticsRecordGetTotalRequestsArgType, totalTrafficBytes DistributionStatisticsRecordGetTotalTrafficBytesArgType, end DistributionStatisticsRecordGetEndArgType, regions DistributionStatisticsRecordGetRegionsArgType, start DistributionStatisticsRecordGetStartArgType) *DistributionStatisticsRecord { this := DistributionStatisticsRecord{} setDistributionStatisticsRecordGetCachedRequestsAttributeType(&this.CachedRequests, cachedRequests) @@ -179,12 +225,14 @@ func NewDistributionStatisticsRecord(cachedRequests DistributionStatisticsRecord // NewDistributionStatisticsRecordWithDefaults instantiates a new DistributionStatisticsRecord 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatisticsRecordWithDefaults() *DistributionStatisticsRecord { this := DistributionStatisticsRecord{} return &this } // GetCachedRequests returns the CachedRequests field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetCachedRequests() (ret DistributionStatisticsRecordGetCachedRequestsRetType) { ret, _ = o.GetCachedRequestsOk() return ret @@ -192,16 +240,19 @@ func (o *DistributionStatisticsRecord) GetCachedRequests() (ret DistributionStat // GetCachedRequestsOk returns a tuple with the CachedRequests field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetCachedRequestsOk() (ret DistributionStatisticsRecordGetCachedRequestsRetType, ok bool) { return getDistributionStatisticsRecordGetCachedRequestsAttributeTypeOk(o.CachedRequests) } // SetCachedRequests sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) SetCachedRequests(v DistributionStatisticsRecordGetCachedRequestsRetType) { setDistributionStatisticsRecordGetCachedRequestsAttributeType(&o.CachedRequests, v) } // GetTotalRequests returns the TotalRequests field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetTotalRequests() (ret DistributionStatisticsRecordGetTotalRequestsRetType) { ret, _ = o.GetTotalRequestsOk() return ret @@ -209,16 +260,19 @@ func (o *DistributionStatisticsRecord) GetTotalRequests() (ret DistributionStati // GetTotalRequestsOk returns a tuple with the TotalRequests field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetTotalRequestsOk() (ret DistributionStatisticsRecordGetTotalRequestsRetType, ok bool) { return getDistributionStatisticsRecordGetTotalRequestsAttributeTypeOk(o.TotalRequests) } // SetTotalRequests sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) SetTotalRequests(v DistributionStatisticsRecordGetTotalRequestsRetType) { setDistributionStatisticsRecordGetTotalRequestsAttributeType(&o.TotalRequests, v) } // GetTotalTrafficBytes returns the TotalTrafficBytes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetTotalTrafficBytes() (ret DistributionStatisticsRecordGetTotalTrafficBytesRetType) { ret, _ = o.GetTotalTrafficBytesOk() return ret @@ -226,16 +280,19 @@ func (o *DistributionStatisticsRecord) GetTotalTrafficBytes() (ret DistributionS // GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetTotalTrafficBytesOk() (ret DistributionStatisticsRecordGetTotalTrafficBytesRetType, ok bool) { return getDistributionStatisticsRecordGetTotalTrafficBytesAttributeTypeOk(o.TotalTrafficBytes) } // SetTotalTrafficBytes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) SetTotalTrafficBytes(v DistributionStatisticsRecordGetTotalTrafficBytesRetType) { setDistributionStatisticsRecordGetTotalTrafficBytesAttributeType(&o.TotalTrafficBytes, v) } // GetEnd returns the End field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetEnd() (ret DistributionStatisticsRecordGetEndRetType) { ret, _ = o.GetEndOk() return ret @@ -243,16 +300,19 @@ func (o *DistributionStatisticsRecord) GetEnd() (ret DistributionStatisticsRecor // GetEndOk returns a tuple with the End field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetEndOk() (ret DistributionStatisticsRecordGetEndRetType, ok bool) { return getDistributionStatisticsRecordGetEndAttributeTypeOk(o.End) } // SetEnd sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) SetEnd(v DistributionStatisticsRecordGetEndRetType) { setDistributionStatisticsRecordGetEndAttributeType(&o.End, v) } // GetRegions returns the Regions field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetRegions() (ret DistributionStatisticsRecordGetRegionsRetType) { ret, _ = o.GetRegionsOk() return ret @@ -260,16 +320,19 @@ func (o *DistributionStatisticsRecord) GetRegions() (ret DistributionStatisticsR // GetRegionsOk returns a tuple with the Regions field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetRegionsOk() (ret DistributionStatisticsRecordGetRegionsRetType, ok bool) { return getDistributionStatisticsRecordGetRegionsAttributeTypeOk(o.Regions) } // SetRegions sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) SetRegions(v DistributionStatisticsRecordGetRegionsRetType) { setDistributionStatisticsRecordGetRegionsAttributeType(&o.Regions, v) } // GetStart returns the Start field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetStart() (ret DistributionStatisticsRecordGetStartRetType) { ret, _ = o.GetStartOk() return ret @@ -277,15 +340,18 @@ func (o *DistributionStatisticsRecord) GetStart() (ret DistributionStatisticsRec // GetStartOk returns a tuple with the Start field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) GetStartOk() (ret DistributionStatisticsRecordGetStartRetType, ok bool) { return getDistributionStatisticsRecordGetStartAttributeTypeOk(o.Start) } // SetStart sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecord) SetStart(v DistributionStatisticsRecordGetStartRetType) { setDistributionStatisticsRecordGetStartAttributeType(&o.Start, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DistributionStatisticsRecord) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDistributionStatisticsRecordGetCachedRequestsAttributeTypeOk(o.CachedRequests); ok { @@ -309,37 +375,45 @@ func (o DistributionStatisticsRecord) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDistributionStatisticsRecord struct { value *DistributionStatisticsRecord isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecord) Get() *DistributionStatisticsRecord { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecord) Set(val *DistributionStatisticsRecord) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecord) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecord) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDistributionStatisticsRecord(val *DistributionStatisticsRecord) *NullableDistributionStatisticsRecord { return &NullableDistributionStatisticsRecord{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecord) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecord) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_distribution_statistics_record_all_of.go b/services/cdn/model_distribution_statistics_record_all_of.go index 30fd07621..f0dfc2302 100644 --- a/services/cdn/model_distribution_statistics_record_all_of.go +++ b/services/cdn/model_distribution_statistics_record_all_of.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &DistributionStatisticsRecordAllOf{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetEndAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetEndArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetEndRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordAllOfGetEndAttributeTypeOk(arg DistributionStatisticsRecordAllOfGetEndAttributeType) (ret DistributionStatisticsRecordAllOfGetEndRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getDistributionStatisticsRecordAllOfGetEndAttributeTypeOk(arg DistributionS return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordAllOfGetEndAttributeType(arg *DistributionStatisticsRecordAllOfGetEndAttributeType, val DistributionStatisticsRecordAllOfGetEndRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setDistributionStatisticsRecordAllOfGetEndAttributeType(arg *DistributionSt */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetRegionsAttributeType = *DistributionStatisticsRecordRegions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetRegionsArgType = DistributionStatisticsRecordRegions + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetRegionsRetType = DistributionStatisticsRecordRegions +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordAllOfGetRegionsAttributeTypeOk(arg DistributionStatisticsRecordAllOfGetRegionsAttributeType) (ret DistributionStatisticsRecordAllOfGetRegionsRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getDistributionStatisticsRecordAllOfGetRegionsAttributeTypeOk(arg Distribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordAllOfGetRegionsAttributeType(arg *DistributionStatisticsRecordAllOfGetRegionsAttributeType, val DistributionStatisticsRecordAllOfGetRegionsRetType) { *arg = &val } @@ -63,10 +78,16 @@ func setDistributionStatisticsRecordAllOfGetRegionsAttributeType(arg *Distributi */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetStartAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetStartArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOfGetStartRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordAllOfGetStartAttributeTypeOk(arg DistributionStatisticsRecordAllOfGetStartAttributeType) (ret DistributionStatisticsRecordAllOfGetStartRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +95,13 @@ func getDistributionStatisticsRecordAllOfGetStartAttributeTypeOk(arg Distributio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordAllOfGetStartAttributeType(arg *DistributionStatisticsRecordAllOfGetStartAttributeType, val DistributionStatisticsRecordAllOfGetStartRetType) { *arg = &val } // DistributionStatisticsRecordAllOf struct for DistributionStatisticsRecordAllOf +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordAllOf struct { // Exclusive end of the time interval the statistics refer to // REQUIRED @@ -90,12 +113,14 @@ type DistributionStatisticsRecordAllOf struct { Start DistributionStatisticsRecordAllOfGetStartAttributeType `json:"start" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DistributionStatisticsRecordAllOf DistributionStatisticsRecordAllOf // NewDistributionStatisticsRecordAllOf instantiates a new DistributionStatisticsRecordAllOf 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatisticsRecordAllOf(end DistributionStatisticsRecordAllOfGetEndArgType, regions DistributionStatisticsRecordAllOfGetRegionsArgType, start DistributionStatisticsRecordAllOfGetStartArgType) *DistributionStatisticsRecordAllOf { this := DistributionStatisticsRecordAllOf{} setDistributionStatisticsRecordAllOfGetEndAttributeType(&this.End, end) @@ -107,12 +132,14 @@ func NewDistributionStatisticsRecordAllOf(end DistributionStatisticsRecordAllOfG // NewDistributionStatisticsRecordAllOfWithDefaults instantiates a new DistributionStatisticsRecordAllOf 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatisticsRecordAllOfWithDefaults() *DistributionStatisticsRecordAllOf { this := DistributionStatisticsRecordAllOf{} return &this } // GetEnd returns the End field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) GetEnd() (ret DistributionStatisticsRecordAllOfGetEndRetType) { ret, _ = o.GetEndOk() return ret @@ -120,16 +147,19 @@ func (o *DistributionStatisticsRecordAllOf) GetEnd() (ret DistributionStatistics // GetEndOk returns a tuple with the End field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) GetEndOk() (ret DistributionStatisticsRecordAllOfGetEndRetType, ok bool) { return getDistributionStatisticsRecordAllOfGetEndAttributeTypeOk(o.End) } // SetEnd sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) SetEnd(v DistributionStatisticsRecordAllOfGetEndRetType) { setDistributionStatisticsRecordAllOfGetEndAttributeType(&o.End, v) } // GetRegions returns the Regions field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) GetRegions() (ret DistributionStatisticsRecordAllOfGetRegionsRetType) { ret, _ = o.GetRegionsOk() return ret @@ -137,16 +167,19 @@ func (o *DistributionStatisticsRecordAllOf) GetRegions() (ret DistributionStatis // GetRegionsOk returns a tuple with the Regions field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) GetRegionsOk() (ret DistributionStatisticsRecordAllOfGetRegionsRetType, ok bool) { return getDistributionStatisticsRecordAllOfGetRegionsAttributeTypeOk(o.Regions) } // SetRegions sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) SetRegions(v DistributionStatisticsRecordAllOfGetRegionsRetType) { setDistributionStatisticsRecordAllOfGetRegionsAttributeType(&o.Regions, v) } // GetStart returns the Start field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) GetStart() (ret DistributionStatisticsRecordAllOfGetStartRetType) { ret, _ = o.GetStartOk() return ret @@ -154,15 +187,18 @@ func (o *DistributionStatisticsRecordAllOf) GetStart() (ret DistributionStatisti // GetStartOk returns a tuple with the Start field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) GetStartOk() (ret DistributionStatisticsRecordAllOfGetStartRetType, ok bool) { return getDistributionStatisticsRecordAllOfGetStartAttributeTypeOk(o.Start) } // SetStart sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordAllOf) SetStart(v DistributionStatisticsRecordAllOfGetStartRetType) { setDistributionStatisticsRecordAllOfGetStartAttributeType(&o.Start, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DistributionStatisticsRecordAllOf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDistributionStatisticsRecordAllOfGetEndAttributeTypeOk(o.End); ok { @@ -177,37 +213,45 @@ func (o DistributionStatisticsRecordAllOf) ToMap() (map[string]interface{}, erro return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDistributionStatisticsRecordAllOf struct { value *DistributionStatisticsRecordAllOf isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordAllOf) Get() *DistributionStatisticsRecordAllOf { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordAllOf) Set(val *DistributionStatisticsRecordAllOf) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordAllOf) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordAllOf) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDistributionStatisticsRecordAllOf(val *DistributionStatisticsRecordAllOf) *NullableDistributionStatisticsRecordAllOf { return &NullableDistributionStatisticsRecordAllOf{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordAllOf) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordAllOf) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_distribution_statistics_record_entry.go b/services/cdn/model_distribution_statistics_record_entry.go index 051904a63..ccdca9e7d 100644 --- a/services/cdn/model_distribution_statistics_record_entry.go +++ b/services/cdn/model_distribution_statistics_record_entry.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &DistributionStatisticsRecordEntry{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetCachedRequestsAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetCachedRequestsArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetCachedRequestsRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordEntryGetCachedRequestsAttributeTypeOk(arg DistributionStatisticsRecordEntryGetCachedRequestsAttributeType) (ret DistributionStatisticsRecordEntryGetCachedRequestsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getDistributionStatisticsRecordEntryGetCachedRequestsAttributeTypeOk(arg Di return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordEntryGetCachedRequestsAttributeType(arg *DistributionStatisticsRecordEntryGetCachedRequestsAttributeType, val DistributionStatisticsRecordEntryGetCachedRequestsRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setDistributionStatisticsRecordEntryGetCachedRequestsAttributeType(arg *Dis */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetTotalRequestsAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetTotalRequestsArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetTotalRequestsRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordEntryGetTotalRequestsAttributeTypeOk(arg DistributionStatisticsRecordEntryGetTotalRequestsAttributeType) (ret DistributionStatisticsRecordEntryGetTotalRequestsRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getDistributionStatisticsRecordEntryGetTotalRequestsAttributeTypeOk(arg Dis return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordEntryGetTotalRequestsAttributeType(arg *DistributionStatisticsRecordEntryGetTotalRequestsAttributeType, val DistributionStatisticsRecordEntryGetTotalRequestsRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setDistributionStatisticsRecordEntryGetTotalRequestsAttributeType(arg *Dist */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetTotalTrafficBytesArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeTypeOk(arg DistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType) (ret DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +94,13 @@ func getDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeTypeOk(arg return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType(arg *DistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType, val DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType) { *arg = &val } // DistributionStatisticsRecordEntry struct for DistributionStatisticsRecordEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordEntry struct { // Number of cached requests that were served // REQUIRED @@ -90,12 +113,14 @@ type DistributionStatisticsRecordEntry struct { TotalTrafficBytes DistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType `json:"totalTrafficBytes" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DistributionStatisticsRecordEntry DistributionStatisticsRecordEntry // NewDistributionStatisticsRecordEntry instantiates a new DistributionStatisticsRecordEntry 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatisticsRecordEntry(cachedRequests DistributionStatisticsRecordEntryGetCachedRequestsArgType, totalRequests DistributionStatisticsRecordEntryGetTotalRequestsArgType, totalTrafficBytes DistributionStatisticsRecordEntryGetTotalTrafficBytesArgType) *DistributionStatisticsRecordEntry { this := DistributionStatisticsRecordEntry{} setDistributionStatisticsRecordEntryGetCachedRequestsAttributeType(&this.CachedRequests, cachedRequests) @@ -107,12 +132,14 @@ func NewDistributionStatisticsRecordEntry(cachedRequests DistributionStatisticsR // NewDistributionStatisticsRecordEntryWithDefaults instantiates a new DistributionStatisticsRecordEntry 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatisticsRecordEntryWithDefaults() *DistributionStatisticsRecordEntry { this := DistributionStatisticsRecordEntry{} return &this } // GetCachedRequests returns the CachedRequests field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) GetCachedRequests() (ret DistributionStatisticsRecordEntryGetCachedRequestsRetType) { ret, _ = o.GetCachedRequestsOk() return ret @@ -120,16 +147,19 @@ func (o *DistributionStatisticsRecordEntry) GetCachedRequests() (ret Distributio // GetCachedRequestsOk returns a tuple with the CachedRequests field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) GetCachedRequestsOk() (ret DistributionStatisticsRecordEntryGetCachedRequestsRetType, ok bool) { return getDistributionStatisticsRecordEntryGetCachedRequestsAttributeTypeOk(o.CachedRequests) } // SetCachedRequests sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) SetCachedRequests(v DistributionStatisticsRecordEntryGetCachedRequestsRetType) { setDistributionStatisticsRecordEntryGetCachedRequestsAttributeType(&o.CachedRequests, v) } // GetTotalRequests returns the TotalRequests field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) GetTotalRequests() (ret DistributionStatisticsRecordEntryGetTotalRequestsRetType) { ret, _ = o.GetTotalRequestsOk() return ret @@ -137,16 +167,19 @@ func (o *DistributionStatisticsRecordEntry) GetTotalRequests() (ret Distribution // GetTotalRequestsOk returns a tuple with the TotalRequests field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) GetTotalRequestsOk() (ret DistributionStatisticsRecordEntryGetTotalRequestsRetType, ok bool) { return getDistributionStatisticsRecordEntryGetTotalRequestsAttributeTypeOk(o.TotalRequests) } // SetTotalRequests sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) SetTotalRequests(v DistributionStatisticsRecordEntryGetTotalRequestsRetType) { setDistributionStatisticsRecordEntryGetTotalRequestsAttributeType(&o.TotalRequests, v) } // GetTotalTrafficBytes returns the TotalTrafficBytes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytes() (ret DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType) { ret, _ = o.GetTotalTrafficBytesOk() return ret @@ -154,15 +187,18 @@ func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytes() (ret Distribu // GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytesOk() (ret DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType, ok bool) { return getDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeTypeOk(o.TotalTrafficBytes) } // SetTotalTrafficBytes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordEntry) SetTotalTrafficBytes(v DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType) { setDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType(&o.TotalTrafficBytes, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DistributionStatisticsRecordEntry) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDistributionStatisticsRecordEntryGetCachedRequestsAttributeTypeOk(o.CachedRequests); ok { @@ -177,37 +213,45 @@ func (o DistributionStatisticsRecordEntry) ToMap() (map[string]interface{}, erro return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDistributionStatisticsRecordEntry struct { value *DistributionStatisticsRecordEntry isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordEntry) Get() *DistributionStatisticsRecordEntry { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordEntry) Set(val *DistributionStatisticsRecordEntry) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordEntry) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordEntry) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDistributionStatisticsRecordEntry(val *DistributionStatisticsRecordEntry) *NullableDistributionStatisticsRecordEntry { return &NullableDistributionStatisticsRecordEntry{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordEntry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_distribution_statistics_record_regions.go b/services/cdn/model_distribution_statistics_record_regions.go index 358944df0..c7260ba1a 100644 --- a/services/cdn/model_distribution_statistics_record_regions.go +++ b/services/cdn/model_distribution_statistics_record_regions.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &DistributionStatisticsRecordRegions{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetAFAttributeType = *DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetAFArgType = DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetAFRetType = DistributionStatisticsRecordEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordRegionsGetAFAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetAFAttributeType) (ret DistributionStatisticsRecordRegionsGetAFRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getDistributionStatisticsRecordRegionsGetAFAttributeTypeOk(arg Distribution return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordRegionsGetAFAttributeType(arg *DistributionStatisticsRecordRegionsGetAFAttributeType, val DistributionStatisticsRecordRegionsGetAFRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setDistributionStatisticsRecordRegionsGetAFAttributeType(arg *DistributionS */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetASIAAttributeType = *DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetASIAArgType = DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetASIARetType = DistributionStatisticsRecordEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordRegionsGetASIAAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetASIAAttributeType) (ret DistributionStatisticsRecordRegionsGetASIARetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getDistributionStatisticsRecordRegionsGetASIAAttributeTypeOk(arg Distributi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordRegionsGetASIAAttributeType(arg *DistributionStatisticsRecordRegionsGetASIAAttributeType, val DistributionStatisticsRecordRegionsGetASIARetType) { *arg = &val } @@ -62,10 +77,16 @@ func setDistributionStatisticsRecordRegionsGetASIAAttributeType(arg *Distributio */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetEUAttributeType = *DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetEUArgType = DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetEURetType = DistributionStatisticsRecordEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordRegionsGetEUAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetEUAttributeType) (ret DistributionStatisticsRecordRegionsGetEURetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getDistributionStatisticsRecordRegionsGetEUAttributeTypeOk(arg Distribution return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordRegionsGetEUAttributeType(arg *DistributionStatisticsRecordRegionsGetEUAttributeType, val DistributionStatisticsRecordRegionsGetEURetType) { *arg = &val } @@ -82,10 +104,16 @@ func setDistributionStatisticsRecordRegionsGetEUAttributeType(arg *DistributionS */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetSAAttributeType = *DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetSAArgType = DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetSARetType = DistributionStatisticsRecordEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordRegionsGetSAAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetSAAttributeType) (ret DistributionStatisticsRecordRegionsGetSARetType, ok bool) { if arg == nil { return ret, false @@ -93,6 +121,7 @@ func getDistributionStatisticsRecordRegionsGetSAAttributeTypeOk(arg Distribution return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordRegionsGetSAAttributeType(arg *DistributionStatisticsRecordRegionsGetSAAttributeType, val DistributionStatisticsRecordRegionsGetSARetType) { *arg = &val } @@ -102,10 +131,16 @@ func setDistributionStatisticsRecordRegionsGetSAAttributeType(arg *DistributionS */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetUSAttributeType = *DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetUSArgType = DistributionStatisticsRecordEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegionsGetUSRetType = DistributionStatisticsRecordEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionStatisticsRecordRegionsGetUSAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetUSAttributeType) (ret DistributionStatisticsRecordRegionsGetUSRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +148,13 @@ func getDistributionStatisticsRecordRegionsGetUSAttributeTypeOk(arg Distribution return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionStatisticsRecordRegionsGetUSAttributeType(arg *DistributionStatisticsRecordRegionsGetUSAttributeType, val DistributionStatisticsRecordRegionsGetUSRetType) { *arg = &val } // DistributionStatisticsRecordRegions Mapping of regions to the metrics for this region for the defined time interval All regions are always present. If no traffic was reported for a region, it will still contain 0-filled properties +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionStatisticsRecordRegions struct { // REQUIRED AF DistributionStatisticsRecordRegionsGetAFAttributeType `json:"AF" required:"true"` @@ -131,12 +168,14 @@ type DistributionStatisticsRecordRegions struct { US DistributionStatisticsRecordRegionsGetUSAttributeType `json:"US" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DistributionStatisticsRecordRegions DistributionStatisticsRecordRegions // NewDistributionStatisticsRecordRegions instantiates a new DistributionStatisticsRecordRegions 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatisticsRecordRegions(aF DistributionStatisticsRecordRegionsGetAFArgType, aSIA DistributionStatisticsRecordRegionsGetASIAArgType, eU DistributionStatisticsRecordRegionsGetEUArgType, sA DistributionStatisticsRecordRegionsGetSAArgType, uS DistributionStatisticsRecordRegionsGetUSArgType) *DistributionStatisticsRecordRegions { this := DistributionStatisticsRecordRegions{} setDistributionStatisticsRecordRegionsGetAFAttributeType(&this.AF, aF) @@ -150,12 +189,14 @@ func NewDistributionStatisticsRecordRegions(aF DistributionStatisticsRecordRegio // NewDistributionStatisticsRecordRegionsWithDefaults instantiates a new DistributionStatisticsRecordRegions 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionStatisticsRecordRegionsWithDefaults() *DistributionStatisticsRecordRegions { this := DistributionStatisticsRecordRegions{} return &this } // GetAF returns the AF field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetAF() (ret DistributionStatisticsRecordRegionsGetAFRetType) { ret, _ = o.GetAFOk() return ret @@ -163,16 +204,19 @@ func (o *DistributionStatisticsRecordRegions) GetAF() (ret DistributionStatistic // GetAFOk returns a tuple with the AF field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetAFOk() (ret DistributionStatisticsRecordRegionsGetAFRetType, ok bool) { return getDistributionStatisticsRecordRegionsGetAFAttributeTypeOk(o.AF) } // SetAF sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) SetAF(v DistributionStatisticsRecordRegionsGetAFRetType) { setDistributionStatisticsRecordRegionsGetAFAttributeType(&o.AF, v) } // GetASIA returns the ASIA field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetASIA() (ret DistributionStatisticsRecordRegionsGetASIARetType) { ret, _ = o.GetASIAOk() return ret @@ -180,16 +224,19 @@ func (o *DistributionStatisticsRecordRegions) GetASIA() (ret DistributionStatist // GetASIAOk returns a tuple with the ASIA field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetASIAOk() (ret DistributionStatisticsRecordRegionsGetASIARetType, ok bool) { return getDistributionStatisticsRecordRegionsGetASIAAttributeTypeOk(o.ASIA) } // SetASIA sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) SetASIA(v DistributionStatisticsRecordRegionsGetASIARetType) { setDistributionStatisticsRecordRegionsGetASIAAttributeType(&o.ASIA, v) } // GetEU returns the EU field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetEU() (ret DistributionStatisticsRecordRegionsGetEURetType) { ret, _ = o.GetEUOk() return ret @@ -197,16 +244,19 @@ func (o *DistributionStatisticsRecordRegions) GetEU() (ret DistributionStatistic // GetEUOk returns a tuple with the EU field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetEUOk() (ret DistributionStatisticsRecordRegionsGetEURetType, ok bool) { return getDistributionStatisticsRecordRegionsGetEUAttributeTypeOk(o.EU) } // SetEU sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) SetEU(v DistributionStatisticsRecordRegionsGetEURetType) { setDistributionStatisticsRecordRegionsGetEUAttributeType(&o.EU, v) } // GetSA returns the SA field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetSA() (ret DistributionStatisticsRecordRegionsGetSARetType) { ret, _ = o.GetSAOk() return ret @@ -214,16 +264,19 @@ func (o *DistributionStatisticsRecordRegions) GetSA() (ret DistributionStatistic // GetSAOk returns a tuple with the SA field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetSAOk() (ret DistributionStatisticsRecordRegionsGetSARetType, ok bool) { return getDistributionStatisticsRecordRegionsGetSAAttributeTypeOk(o.SA) } // SetSA sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) SetSA(v DistributionStatisticsRecordRegionsGetSARetType) { setDistributionStatisticsRecordRegionsGetSAAttributeType(&o.SA, v) } // GetUS returns the US field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetUS() (ret DistributionStatisticsRecordRegionsGetUSRetType) { ret, _ = o.GetUSOk() return ret @@ -231,15 +284,18 @@ func (o *DistributionStatisticsRecordRegions) GetUS() (ret DistributionStatistic // GetUSOk returns a tuple with the US field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) GetUSOk() (ret DistributionStatisticsRecordRegionsGetUSRetType, ok bool) { return getDistributionStatisticsRecordRegionsGetUSAttributeTypeOk(o.US) } // SetUS sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionStatisticsRecordRegions) SetUS(v DistributionStatisticsRecordRegionsGetUSRetType) { setDistributionStatisticsRecordRegionsGetUSAttributeType(&o.US, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DistributionStatisticsRecordRegions) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDistributionStatisticsRecordRegionsGetAFAttributeTypeOk(o.AF); ok { @@ -260,37 +316,45 @@ func (o DistributionStatisticsRecordRegions) ToMap() (map[string]interface{}, er return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDistributionStatisticsRecordRegions struct { value *DistributionStatisticsRecordRegions isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordRegions) Get() *DistributionStatisticsRecordRegions { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordRegions) Set(val *DistributionStatisticsRecordRegions) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordRegions) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordRegions) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDistributionStatisticsRecordRegions(val *DistributionStatisticsRecordRegions) *NullableDistributionStatisticsRecordRegions { return &NullableDistributionStatisticsRecordRegions{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionStatisticsRecordRegions) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_distribution_waf.go b/services/cdn/model_distribution_waf.go index 46bc2b6e3..332392afb 100644 --- a/services/cdn/model_distribution_waf.go +++ b/services/cdn/model_distribution_waf.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &DistributionWaf{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetDisabledRulesAttributeType = *[]WafStatusRuleBlock + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetDisabledRulesArgType = []WafStatusRuleBlock + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetDisabledRulesRetType = []WafStatusRuleBlock +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionWafGetDisabledRulesAttributeTypeOk(arg DistributionWafGetDisabledRulesAttributeType) (ret DistributionWafGetDisabledRulesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getDistributionWafGetDisabledRulesAttributeTypeOk(arg DistributionWafGetDis return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionWafGetDisabledRulesAttributeType(arg *DistributionWafGetDisabledRulesAttributeType, val DistributionWafGetDisabledRulesRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setDistributionWafGetDisabledRulesAttributeType(arg *DistributionWafGetDisa */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetEnabledRulesAttributeType = *[]WafStatusRuleBlock + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetEnabledRulesArgType = []WafStatusRuleBlock + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetEnabledRulesRetType = []WafStatusRuleBlock +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionWafGetEnabledRulesAttributeTypeOk(arg DistributionWafGetEnabledRulesAttributeType) (ret DistributionWafGetEnabledRulesRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getDistributionWafGetEnabledRulesAttributeTypeOk(arg DistributionWafGetEnab return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionWafGetEnabledRulesAttributeType(arg *DistributionWafGetEnabledRulesAttributeType, val DistributionWafGetEnabledRulesRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setDistributionWafGetEnabledRulesAttributeType(arg *DistributionWafGetEnabl */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetLogOnlyRulesAttributeType = *[]WafStatusRuleBlock + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetLogOnlyRulesArgType = []WafStatusRuleBlock + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWafGetLogOnlyRulesRetType = []WafStatusRuleBlock +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDistributionWafGetLogOnlyRulesAttributeTypeOk(arg DistributionWafGetLogOnlyRulesAttributeType) (ret DistributionWafGetLogOnlyRulesRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +94,13 @@ func getDistributionWafGetLogOnlyRulesAttributeTypeOk(arg DistributionWafGetLogO return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDistributionWafGetLogOnlyRulesAttributeType(arg *DistributionWafGetLogOnlyRulesAttributeType, val DistributionWafGetLogOnlyRulesRetType) { *arg = &val } // DistributionWaf For this property to be present two pre-conditions must be met: - the WAF was enabled at least once - the query parameter ?withWafStatus is truthy This property contains the waf Status. At this point in time, this contains all resolved rules. Rules are split into 3 groups: - enabledRules - logOnlyRules - disabledRules **Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!** +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DistributionWaf struct { // REQUIRED DisabledRules DistributionWafGetDisabledRulesAttributeType `json:"disabledRules" required:"true"` @@ -87,12 +110,14 @@ type DistributionWaf struct { LogOnlyRules DistributionWafGetLogOnlyRulesAttributeType `json:"logOnlyRules" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DistributionWaf DistributionWaf // NewDistributionWaf instantiates a new DistributionWaf 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionWaf(disabledRules DistributionWafGetDisabledRulesArgType, enabledRules DistributionWafGetEnabledRulesArgType, logOnlyRules DistributionWafGetLogOnlyRulesArgType) *DistributionWaf { this := DistributionWaf{} setDistributionWafGetDisabledRulesAttributeType(&this.DisabledRules, disabledRules) @@ -104,12 +129,14 @@ func NewDistributionWaf(disabledRules DistributionWafGetDisabledRulesArgType, en // NewDistributionWafWithDefaults instantiates a new DistributionWaf 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDistributionWafWithDefaults() *DistributionWaf { this := DistributionWaf{} return &this } // GetDisabledRules returns the DisabledRules field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) GetDisabledRules() (ret DistributionWafGetDisabledRulesRetType) { ret, _ = o.GetDisabledRulesOk() return ret @@ -117,16 +144,19 @@ func (o *DistributionWaf) GetDisabledRules() (ret DistributionWafGetDisabledRule // GetDisabledRulesOk returns a tuple with the DisabledRules field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) GetDisabledRulesOk() (ret DistributionWafGetDisabledRulesRetType, ok bool) { return getDistributionWafGetDisabledRulesAttributeTypeOk(o.DisabledRules) } // SetDisabledRules sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) SetDisabledRules(v DistributionWafGetDisabledRulesRetType) { setDistributionWafGetDisabledRulesAttributeType(&o.DisabledRules, v) } // GetEnabledRules returns the EnabledRules field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) GetEnabledRules() (ret DistributionWafGetEnabledRulesRetType) { ret, _ = o.GetEnabledRulesOk() return ret @@ -134,16 +164,19 @@ func (o *DistributionWaf) GetEnabledRules() (ret DistributionWafGetEnabledRulesR // GetEnabledRulesOk returns a tuple with the EnabledRules field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) GetEnabledRulesOk() (ret DistributionWafGetEnabledRulesRetType, ok bool) { return getDistributionWafGetEnabledRulesAttributeTypeOk(o.EnabledRules) } // SetEnabledRules sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) SetEnabledRules(v DistributionWafGetEnabledRulesRetType) { setDistributionWafGetEnabledRulesAttributeType(&o.EnabledRules, v) } // GetLogOnlyRules returns the LogOnlyRules field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) GetLogOnlyRules() (ret DistributionWafGetLogOnlyRulesRetType) { ret, _ = o.GetLogOnlyRulesOk() return ret @@ -151,15 +184,18 @@ func (o *DistributionWaf) GetLogOnlyRules() (ret DistributionWafGetLogOnlyRulesR // GetLogOnlyRulesOk returns a tuple with the LogOnlyRules field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) GetLogOnlyRulesOk() (ret DistributionWafGetLogOnlyRulesRetType, ok bool) { return getDistributionWafGetLogOnlyRulesAttributeTypeOk(o.LogOnlyRules) } // SetLogOnlyRules sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DistributionWaf) SetLogOnlyRules(v DistributionWafGetLogOnlyRulesRetType) { setDistributionWafGetLogOnlyRulesAttributeType(&o.LogOnlyRules, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DistributionWaf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDistributionWafGetDisabledRulesAttributeTypeOk(o.DisabledRules); ok { @@ -174,37 +210,45 @@ func (o DistributionWaf) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDistributionWaf struct { value *DistributionWaf isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionWaf) Get() *DistributionWaf { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionWaf) Set(val *DistributionWaf) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionWaf) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionWaf) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDistributionWaf(val *DistributionWaf) *NullableDistributionWaf { return &NullableDistributionWaf{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDistributionWaf) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDistributionWaf) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_domain.go b/services/cdn/model_domain.go index dc6f4e9f0..71d9e1208 100644 --- a/services/cdn/model_domain.go +++ b/services/cdn/model_domain.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &Domain{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetErrorsAttributeType = *[]StatusError + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetErrorsArgType = []StatusError + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetErrorsRetType = []StatusError +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDomainGetErrorsAttributeTypeOk(arg DomainGetErrorsAttributeType) (ret DomainGetErrorsRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getDomainGetErrorsAttributeTypeOk(arg DomainGetErrorsAttributeType) (ret Do return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDomainGetErrorsAttributeType(arg *DomainGetErrorsAttributeType, val DomainGetErrorsRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setDomainGetErrorsAttributeType(arg *DomainGetErrorsAttributeType, val Doma */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDomainGetNameAttributeTypeOk(arg DomainGetNameAttributeType) (ret DomainGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getDomainGetNameAttributeTypeOk(arg DomainGetNameAttributeType) (ret Domain return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDomainGetNameAttributeType(arg *DomainGetNameAttributeType, val DomainGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetNameRetType = string /* @@ -64,10 +78,16 @@ type DomainGetNameRetType = string */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetStatusAttributeType = *DomainStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetStatusArgType = DomainStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetStatusRetType = DomainStatus +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDomainGetStatusAttributeTypeOk(arg DomainGetStatusAttributeType) (ret DomainGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getDomainGetStatusAttributeTypeOk(arg DomainGetStatusAttributeType) (ret Do return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDomainGetStatusAttributeType(arg *DomainGetStatusAttributeType, val DomainGetStatusRetType) { *arg = &val } @@ -87,20 +108,25 @@ func setDomainGetStatusAttributeType(arg *DomainGetStatusAttributeType, val Doma // DomainTypes Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainTypes string // List of Type const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead DOMAINTYPE_MANAGED DomainTypes = "managed" - DOMAINTYPE_CUSTOM DomainTypes = "custom" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DOMAINTYPE_CUSTOM DomainTypes = "custom" ) // All allowed values of Domain enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedDomainTypesEnumValues = []DomainTypes{ "managed", "custom", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *DomainTypes) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers @@ -128,6 +154,7 @@ func (v *DomainTypes) UnmarshalJSON(src []byte) error { // NewDomainTypesFromValue returns a pointer to a valid DomainTypes // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDomainTypesFromValue(v DomainTypes) (*DomainTypes, error) { ev := DomainTypes(v) if ev.IsValid() { @@ -138,6 +165,7 @@ func NewDomainTypesFromValue(v DomainTypes) (*DomainTypes, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v DomainTypes) IsValid() bool { for _, existing := range AllowedDomainTypesEnumValues { if existing == v { @@ -148,50 +176,65 @@ func (v DomainTypes) IsValid() bool { } // Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v DomainTypes) Ptr() *DomainTypes { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDomainTypes struct { value *DomainTypes isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomainTypes) Get() *DomainTypes { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomainTypes) Set(val *DomainTypes) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomainTypes) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomainTypes) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDomainTypes(val *DomainTypes) *NullableDomainTypes { return &NullableDomainTypes{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomainTypes) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomainTypes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetTypeAttributeType = *DomainTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetTypeArgType = DomainTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainGetTypeRetType = DomainTypes +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDomainGetTypeAttributeTypeOk(arg DomainGetTypeAttributeType) (ret DomainGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -199,11 +242,13 @@ func getDomainGetTypeAttributeTypeOk(arg DomainGetTypeAttributeType) (ret Domain return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDomainGetTypeAttributeType(arg *DomainGetTypeAttributeType, val DomainGetTypeRetType) { *arg = &val } // Domain Definition of a custom or managed domain without any certificates or keys +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Domain struct { // This object is present if the custom domain has errors. Errors DomainGetErrorsAttributeType `json:"errors,omitempty"` @@ -217,12 +262,14 @@ type Domain struct { Type DomainGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Domain Domain // NewDomain instantiates a new Domain 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDomain(name DomainGetNameArgType, status DomainGetStatusArgType, types DomainGetTypeArgType) *Domain { this := Domain{} setDomainGetNameAttributeType(&this.Name, name) @@ -234,12 +281,14 @@ func NewDomain(name DomainGetNameArgType, status DomainGetStatusArgType, types D // NewDomainWithDefaults instantiates a new Domain 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDomainWithDefaults() *Domain { this := Domain{} return &this } // GetErrors returns the Errors field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) GetErrors() (res DomainGetErrorsRetType) { res, _ = o.GetErrorsOk() return @@ -247,22 +296,26 @@ func (o *Domain) GetErrors() (res DomainGetErrorsRetType) { // GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) GetErrorsOk() (ret DomainGetErrorsRetType, ok bool) { return getDomainGetErrorsAttributeTypeOk(o.Errors) } // HasErrors returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) HasErrors() bool { _, ok := o.GetErrorsOk() return ok } // SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) SetErrors(v DomainGetErrorsRetType) { setDomainGetErrorsAttributeType(&o.Errors, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) GetName() (ret DomainGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -270,16 +323,19 @@ func (o *Domain) GetName() (ret DomainGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) GetNameOk() (ret DomainGetNameRetType, ok bool) { return getDomainGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) SetName(v DomainGetNameRetType) { setDomainGetNameAttributeType(&o.Name, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) GetStatus() (ret DomainGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -287,16 +343,19 @@ func (o *Domain) GetStatus() (ret DomainGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) GetStatusOk() (ret DomainGetStatusRetType, ok bool) { return getDomainGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) SetStatus(v DomainGetStatusRetType) { setDomainGetStatusAttributeType(&o.Status, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) GetType() (ret DomainGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -304,15 +363,18 @@ func (o *Domain) GetType() (ret DomainGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) GetTypeOk() (ret DomainGetTypeRetType, ok bool) { return getDomainGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Domain) SetType(v DomainGetTypeRetType) { setDomainGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Domain) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDomainGetErrorsAttributeTypeOk(o.Errors); ok { @@ -330,37 +392,45 @@ func (o Domain) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDomain struct { value *Domain isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomain) Get() *Domain { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomain) Set(val *Domain) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomain) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomain) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDomain(val *Domain) *NullableDomain { return &NullableDomain{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomain) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomain) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_domain_status.go b/services/cdn/model_domain_status.go index ab899ac50..9e564a082 100644 --- a/services/cdn/model_domain_status.go +++ b/services/cdn/model_domain_status.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,18 +17,25 @@ import ( ) // DomainStatus The status of the domain: CREATING indicates that the custom domain is being set up. UPDATING means that requested changes are being applied to the custom domain. ACTIVE means the custom domain is currently configured and active. DELETING means that the domain is in the process of being removed from the distribution. In case the domain has the ERROR state, more information will be available in the errors list. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DomainStatus string // List of DomainStatus const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead DOMAINSTATUS_CREATING DomainStatus = "CREATING" - DOMAINSTATUS_ACTIVE DomainStatus = "ACTIVE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DOMAINSTATUS_ACTIVE DomainStatus = "ACTIVE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead DOMAINSTATUS_UPDATING DomainStatus = "UPDATING" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead DOMAINSTATUS_DELETING DomainStatus = "DELETING" - DOMAINSTATUS_ERROR DomainStatus = "ERROR" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + DOMAINSTATUS_ERROR DomainStatus = "ERROR" ) // All allowed values of DomainStatus enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedDomainStatusEnumValues = []DomainStatus{ "CREATING", "ACTIVE", @@ -36,6 +44,7 @@ var AllowedDomainStatusEnumValues = []DomainStatus{ "ERROR", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *DomainStatus) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -60,6 +69,7 @@ func (v *DomainStatus) UnmarshalJSON(src []byte) error { // NewDomainStatusFromValue returns a pointer to a valid DomainStatus // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDomainStatusFromValue(v string) (*DomainStatus, error) { ev := DomainStatus(v) if ev.IsValid() { @@ -70,6 +80,7 @@ func NewDomainStatusFromValue(v string) (*DomainStatus, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v DomainStatus) IsValid() bool { for _, existing := range AllowedDomainStatusEnumValues { if existing == v { @@ -80,41 +91,50 @@ func (v DomainStatus) IsValid() bool { } // Ptr returns reference to DomainStatus value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v DomainStatus) Ptr() *DomainStatus { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDomainStatus struct { value *DomainStatus isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomainStatus) Get() *DomainStatus { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomainStatus) Set(val *DomainStatus) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomainStatus) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomainStatus) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDomainStatus(val *DomainStatus) *NullableDomainStatus { return &NullableDomainStatus{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDomainStatus) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDomainStatus) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_error_details.go b/services/cdn/model_error_details.go index 8889ea340..f75eb73d7 100644 --- a/services/cdn/model_error_details.go +++ b/services/cdn/model_error_details.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &ErrorDetails{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetDeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorDetailsGetDeAttributeTypeOk(arg ErrorDetailsGetDeAttributeType) (ret ErrorDetailsGetDeRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getErrorDetailsGetDeAttributeTypeOk(arg ErrorDetailsGetDeAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorDetailsGetDeAttributeType(arg *ErrorDetailsGetDeAttributeType, val ErrorDetailsGetDeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetDeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetDeRetType = string /* @@ -44,8 +51,10 @@ type ErrorDetailsGetDeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetEnAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorDetailsGetEnAttributeTypeOk(arg ErrorDetailsGetEnAttributeType) (ret ErrorDetailsGetEnRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +62,15 @@ func getErrorDetailsGetEnAttributeTypeOk(arg ErrorDetailsGetEnAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorDetailsGetEnAttributeType(arg *ErrorDetailsGetEnAttributeType, val ErrorDetailsGetEnRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetEnArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetEnRetType = string /* @@ -65,8 +78,10 @@ type ErrorDetailsGetEnRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetFieldAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorDetailsGetFieldAttributeTypeOk(arg ErrorDetailsGetFieldAttributeType) (ret ErrorDetailsGetFieldRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +89,15 @@ func getErrorDetailsGetFieldAttributeTypeOk(arg ErrorDetailsGetFieldAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorDetailsGetFieldAttributeType(arg *ErrorDetailsGetFieldAttributeType, val ErrorDetailsGetFieldRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetFieldArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetFieldRetType = string /* @@ -89,17 +108,23 @@ type ErrorDetailsGetFieldRetType = string // ErrorDetailsKey the model 'ErrorDetails' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsKey string // List of Key const ( - ERRORDETAILSKEY_UNKNOWN ErrorDetailsKey = "UNKNOWN" - ERRORDETAILSKEY_CUSTOM_DOMAIN_CNAME_MISSING ErrorDetailsKey = "CUSTOM_DOMAIN_CNAME_MISSING" - ERRORDETAILSKEY_INVALID_ARGUMENT ErrorDetailsKey = "INVALID_ARGUMENT" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + ERRORDETAILSKEY_UNKNOWN ErrorDetailsKey = "UNKNOWN" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + ERRORDETAILSKEY_CUSTOM_DOMAIN_CNAME_MISSING ErrorDetailsKey = "CUSTOM_DOMAIN_CNAME_MISSING" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + ERRORDETAILSKEY_INVALID_ARGUMENT ErrorDetailsKey = "INVALID_ARGUMENT" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead ERRORDETAILSKEY_LOG_SINK_INSTANCE_UNAVAILABLE ErrorDetailsKey = "LOG_SINK_INSTANCE_UNAVAILABLE" ) // All allowed values of ErrorDetails enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedErrorDetailsKeyEnumValues = []ErrorDetailsKey{ "UNKNOWN", "CUSTOM_DOMAIN_CNAME_MISSING", @@ -107,6 +132,7 @@ var AllowedErrorDetailsKeyEnumValues = []ErrorDetailsKey{ "LOG_SINK_INSTANCE_UNAVAILABLE", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *ErrorDetailsKey) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers @@ -134,6 +160,7 @@ func (v *ErrorDetailsKey) UnmarshalJSON(src []byte) error { // NewErrorDetailsKeyFromValue returns a pointer to a valid ErrorDetailsKey // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewErrorDetailsKeyFromValue(v ErrorDetailsKey) (*ErrorDetailsKey, error) { ev := ErrorDetailsKey(v) if ev.IsValid() { @@ -144,6 +171,7 @@ func NewErrorDetailsKeyFromValue(v ErrorDetailsKey) (*ErrorDetailsKey, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ErrorDetailsKey) IsValid() bool { for _, existing := range AllowedErrorDetailsKeyEnumValues { if existing == v { @@ -154,50 +182,65 @@ func (v ErrorDetailsKey) IsValid() bool { } // Ptr returns reference to KeyKey value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v ErrorDetailsKey) Ptr() *ErrorDetailsKey { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableErrorDetailsKey struct { value *ErrorDetailsKey isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorDetailsKey) Get() *ErrorDetailsKey { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorDetailsKey) Set(val *ErrorDetailsKey) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorDetailsKey) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorDetailsKey) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableErrorDetailsKey(val *ErrorDetailsKey) *NullableErrorDetailsKey { return &NullableErrorDetailsKey{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorDetailsKey) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorDetailsKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetKeyAttributeType = *ErrorDetailsKey + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetKeyArgType = ErrorDetailsKey + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetailsGetKeyRetType = ErrorDetailsKey +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorDetailsGetKeyAttributeTypeOk(arg ErrorDetailsGetKeyAttributeType) (ret ErrorDetailsGetKeyRetType, ok bool) { if arg == nil { return ret, false @@ -205,11 +248,13 @@ func getErrorDetailsGetKeyAttributeTypeOk(arg ErrorDetailsGetKeyAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorDetailsGetKeyAttributeType(arg *ErrorDetailsGetKeyAttributeType, val ErrorDetailsGetKeyRetType) { *arg = &val } // ErrorDetails struct for ErrorDetails +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorDetails struct { // German description of the error De ErrorDetailsGetDeAttributeType `json:"de,omitempty"` @@ -222,12 +267,14 @@ type ErrorDetails struct { Key ErrorDetailsGetKeyAttributeType `json:"key" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ErrorDetails ErrorDetails // NewErrorDetails instantiates a new ErrorDetails 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewErrorDetails(en ErrorDetailsGetEnArgType, key ErrorDetailsGetKeyArgType) *ErrorDetails { this := ErrorDetails{} setErrorDetailsGetEnAttributeType(&this.En, en) @@ -238,12 +285,14 @@ func NewErrorDetails(en ErrorDetailsGetEnArgType, key ErrorDetailsGetKeyArgType) // NewErrorDetailsWithDefaults instantiates a new ErrorDetails 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewErrorDetailsWithDefaults() *ErrorDetails { this := ErrorDetails{} return &this } // GetDe returns the De field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) GetDe() (res ErrorDetailsGetDeRetType) { res, _ = o.GetDeOk() return @@ -251,22 +300,26 @@ func (o *ErrorDetails) GetDe() (res ErrorDetailsGetDeRetType) { // GetDeOk returns a tuple with the De field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) GetDeOk() (ret ErrorDetailsGetDeRetType, ok bool) { return getErrorDetailsGetDeAttributeTypeOk(o.De) } // HasDe returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) HasDe() bool { _, ok := o.GetDeOk() return ok } // SetDe gets a reference to the given string and assigns it to the De field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) SetDe(v ErrorDetailsGetDeRetType) { setErrorDetailsGetDeAttributeType(&o.De, v) } // GetEn returns the En field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) GetEn() (ret ErrorDetailsGetEnRetType) { ret, _ = o.GetEnOk() return ret @@ -274,16 +327,19 @@ func (o *ErrorDetails) GetEn() (ret ErrorDetailsGetEnRetType) { // GetEnOk returns a tuple with the En field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) GetEnOk() (ret ErrorDetailsGetEnRetType, ok bool) { return getErrorDetailsGetEnAttributeTypeOk(o.En) } // SetEn sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) SetEn(v ErrorDetailsGetEnRetType) { setErrorDetailsGetEnAttributeType(&o.En, v) } // GetField returns the Field field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) GetField() (res ErrorDetailsGetFieldRetType) { res, _ = o.GetFieldOk() return @@ -291,22 +347,26 @@ func (o *ErrorDetails) GetField() (res ErrorDetailsGetFieldRetType) { // GetFieldOk returns a tuple with the Field field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) GetFieldOk() (ret ErrorDetailsGetFieldRetType, ok bool) { return getErrorDetailsGetFieldAttributeTypeOk(o.Field) } // HasField returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) HasField() bool { _, ok := o.GetFieldOk() return ok } // SetField gets a reference to the given string and assigns it to the Field field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) SetField(v ErrorDetailsGetFieldRetType) { setErrorDetailsGetFieldAttributeType(&o.Field, v) } // GetKey returns the Key field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) GetKey() (ret ErrorDetailsGetKeyRetType) { ret, _ = o.GetKeyOk() return ret @@ -314,15 +374,18 @@ func (o *ErrorDetails) GetKey() (ret ErrorDetailsGetKeyRetType) { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) GetKeyOk() (ret ErrorDetailsGetKeyRetType, ok bool) { return getErrorDetailsGetKeyAttributeTypeOk(o.Key) } // SetKey sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorDetails) SetKey(v ErrorDetailsGetKeyRetType) { setErrorDetailsGetKeyAttributeType(&o.Key, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ErrorDetails) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getErrorDetailsGetDeAttributeTypeOk(o.De); ok { @@ -340,37 +403,45 @@ func (o ErrorDetails) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableErrorDetails struct { value *ErrorDetails isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorDetails) Get() *ErrorDetails { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorDetails) Set(val *ErrorDetails) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorDetails) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorDetails) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableErrorDetails(val *ErrorDetails) *NullableErrorDetails { return &NullableErrorDetails{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorDetails) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorDetails) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_find_cache_paths_response.go b/services/cdn/model_find_cache_paths_response.go index 9f190cef9..a25a57579 100644 --- a/services/cdn/model_find_cache_paths_response.go +++ b/services/cdn/model_find_cache_paths_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &FindCachePathsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsResponseGetResponseAttributeType = *[]FindCachePathsResponseEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsResponseGetResponseArgType = []FindCachePathsResponseEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsResponseGetResponseRetType = []FindCachePathsResponseEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFindCachePathsResponseGetResponseAttributeTypeOk(arg FindCachePathsResponseGetResponseAttributeType) (ret FindCachePathsResponseGetResponseRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getFindCachePathsResponseGetResponseAttributeTypeOk(arg FindCachePathsRespo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFindCachePathsResponseGetResponseAttributeType(arg *FindCachePathsResponseGetResponseAttributeType, val FindCachePathsResponseGetResponseRetType) { *arg = &val } // FindCachePathsResponse struct for FindCachePathsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsResponse struct { // REQUIRED Response FindCachePathsResponseGetResponseAttributeType `json:"response" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _FindCachePathsResponse FindCachePathsResponse // NewFindCachePathsResponse instantiates a new FindCachePathsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewFindCachePathsResponse(response FindCachePathsResponseGetResponseArgType) *FindCachePathsResponse { this := FindCachePathsResponse{} setFindCachePathsResponseGetResponseAttributeType(&this.Response, response) @@ -58,12 +69,14 @@ func NewFindCachePathsResponse(response FindCachePathsResponseGetResponseArgType // NewFindCachePathsResponseWithDefaults instantiates a new FindCachePathsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewFindCachePathsResponseWithDefaults() *FindCachePathsResponse { this := FindCachePathsResponse{} return &this } // GetResponse returns the Response field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *FindCachePathsResponse) GetResponse() (ret FindCachePathsResponseGetResponseRetType) { ret, _ = o.GetResponseOk() return ret @@ -71,15 +84,18 @@ func (o *FindCachePathsResponse) GetResponse() (ret FindCachePathsResponseGetRes // GetResponseOk returns a tuple with the Response field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *FindCachePathsResponse) GetResponseOk() (ret FindCachePathsResponseGetResponseRetType, ok bool) { return getFindCachePathsResponseGetResponseAttributeTypeOk(o.Response) } // SetResponse sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *FindCachePathsResponse) SetResponse(v FindCachePathsResponseGetResponseRetType) { setFindCachePathsResponseGetResponseAttributeType(&o.Response, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o FindCachePathsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getFindCachePathsResponseGetResponseAttributeTypeOk(o.Response); ok { @@ -88,37 +104,45 @@ func (o FindCachePathsResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFindCachePathsResponse struct { value *FindCachePathsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFindCachePathsResponse) Get() *FindCachePathsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFindCachePathsResponse) Set(val *FindCachePathsResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFindCachePathsResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFindCachePathsResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFindCachePathsResponse(val *FindCachePathsResponse) *NullableFindCachePathsResponse { return &NullableFindCachePathsResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFindCachePathsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFindCachePathsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_find_cache_paths_response_entry.go b/services/cdn/model_find_cache_paths_response_entry.go index c04a6330c..4b74f02c8 100644 --- a/services/cdn/model_find_cache_paths_response_entry.go +++ b/services/cdn/model_find_cache_paths_response_entry.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &FindCachePathsResponseEntry{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsResponseEntryGetPathAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFindCachePathsResponseEntryGetPathAttributeTypeOk(arg FindCachePathsResponseEntryGetPathAttributeType) (ret FindCachePathsResponseEntryGetPathRetType, ok bool) { if arg == nil { return ret, false @@ -31,26 +34,33 @@ func getFindCachePathsResponseEntryGetPathAttributeTypeOk(arg FindCachePathsResp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFindCachePathsResponseEntryGetPathAttributeType(arg *FindCachePathsResponseEntryGetPathAttributeType, val FindCachePathsResponseEntryGetPathRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsResponseEntryGetPathArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsResponseEntryGetPathRetType = string // FindCachePathsResponseEntry struct for FindCachePathsResponseEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FindCachePathsResponseEntry struct { // Defines one path that was previously used as part of a granular purge // REQUIRED Path FindCachePathsResponseEntryGetPathAttributeType `json:"path" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _FindCachePathsResponseEntry FindCachePathsResponseEntry // NewFindCachePathsResponseEntry instantiates a new FindCachePathsResponseEntry 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewFindCachePathsResponseEntry(path FindCachePathsResponseEntryGetPathArgType) *FindCachePathsResponseEntry { this := FindCachePathsResponseEntry{} setFindCachePathsResponseEntryGetPathAttributeType(&this.Path, path) @@ -60,12 +70,14 @@ func NewFindCachePathsResponseEntry(path FindCachePathsResponseEntryGetPathArgTy // NewFindCachePathsResponseEntryWithDefaults instantiates a new FindCachePathsResponseEntry 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewFindCachePathsResponseEntryWithDefaults() *FindCachePathsResponseEntry { this := FindCachePathsResponseEntry{} return &this } // GetPath returns the Path field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *FindCachePathsResponseEntry) GetPath() (ret FindCachePathsResponseEntryGetPathRetType) { ret, _ = o.GetPathOk() return ret @@ -73,15 +85,18 @@ func (o *FindCachePathsResponseEntry) GetPath() (ret FindCachePathsResponseEntry // GetPathOk returns a tuple with the Path field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *FindCachePathsResponseEntry) GetPathOk() (ret FindCachePathsResponseEntryGetPathRetType, ok bool) { return getFindCachePathsResponseEntryGetPathAttributeTypeOk(o.Path) } // SetPath sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *FindCachePathsResponseEntry) SetPath(v FindCachePathsResponseEntryGetPathRetType) { setFindCachePathsResponseEntryGetPathAttributeType(&o.Path, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o FindCachePathsResponseEntry) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getFindCachePathsResponseEntryGetPathAttributeTypeOk(o.Path); ok { @@ -90,37 +105,45 @@ func (o FindCachePathsResponseEntry) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFindCachePathsResponseEntry struct { value *FindCachePathsResponseEntry isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFindCachePathsResponseEntry) Get() *FindCachePathsResponseEntry { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFindCachePathsResponseEntry) Set(val *FindCachePathsResponseEntry) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFindCachePathsResponseEntry) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFindCachePathsResponseEntry) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFindCachePathsResponseEntry(val *FindCachePathsResponseEntry) *NullableFindCachePathsResponseEntry { return &NullableFindCachePathsResponseEntry{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFindCachePathsResponseEntry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_generic_json_response.go b/services/cdn/model_generic_json_response.go index 0970e44c9..d72ee2bdf 100644 --- a/services/cdn/model_generic_json_response.go +++ b/services/cdn/model_generic_json_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GenericJsonResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericJsonResponseGetDetailsAttributeType = *[]ErrorDetails + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericJsonResponseGetDetailsArgType = []ErrorDetails + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericJsonResponseGetDetailsRetType = []ErrorDetails +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGenericJsonResponseGetDetailsAttributeTypeOk(arg GenericJsonResponseGetDetailsAttributeType) (ret GenericJsonResponseGetDetailsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getGenericJsonResponseGetDetailsAttributeTypeOk(arg GenericJsonResponseGetD return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGenericJsonResponseGetDetailsAttributeType(arg *GenericJsonResponseGetDetailsAttributeType, val GenericJsonResponseGetDetailsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setGenericJsonResponseGetDetailsAttributeType(arg *GenericJsonResponseGetDe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericJsonResponseGetMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGenericJsonResponseGetMessageAttributeTypeOk(arg GenericJsonResponseGetMessageAttributeType) (ret GenericJsonResponseGetMessageRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getGenericJsonResponseGetMessageAttributeTypeOk(arg GenericJsonResponseGetM return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGenericJsonResponseGetMessageAttributeType(arg *GenericJsonResponseGetMessageAttributeType, val GenericJsonResponseGetMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericJsonResponseGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericJsonResponseGetMessageRetType = string // GenericJsonResponse struct for GenericJsonResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericJsonResponse struct { // Listing of issues with your request Details GenericJsonResponseGetDetailsAttributeType `json:"details,omitempty"` @@ -66,12 +81,14 @@ type GenericJsonResponse struct { Message GenericJsonResponseGetMessageAttributeType `json:"message" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GenericJsonResponse GenericJsonResponse // NewGenericJsonResponse instantiates a new GenericJsonResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGenericJsonResponse(message GenericJsonResponseGetMessageArgType) *GenericJsonResponse { this := GenericJsonResponse{} setGenericJsonResponseGetMessageAttributeType(&this.Message, message) @@ -81,12 +98,14 @@ func NewGenericJsonResponse(message GenericJsonResponseGetMessageArgType) *Gener // NewGenericJsonResponseWithDefaults instantiates a new GenericJsonResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGenericJsonResponseWithDefaults() *GenericJsonResponse { this := GenericJsonResponse{} return &this } // GetDetails returns the Details field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericJsonResponse) GetDetails() (res GenericJsonResponseGetDetailsRetType) { res, _ = o.GetDetailsOk() return @@ -94,22 +113,26 @@ func (o *GenericJsonResponse) GetDetails() (res GenericJsonResponseGetDetailsRet // GetDetailsOk returns a tuple with the Details field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericJsonResponse) GetDetailsOk() (ret GenericJsonResponseGetDetailsRetType, ok bool) { return getGenericJsonResponseGetDetailsAttributeTypeOk(o.Details) } // HasDetails returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericJsonResponse) HasDetails() bool { _, ok := o.GetDetailsOk() return ok } // SetDetails gets a reference to the given []ErrorDetails and assigns it to the Details field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericJsonResponse) SetDetails(v GenericJsonResponseGetDetailsRetType) { setGenericJsonResponseGetDetailsAttributeType(&o.Details, v) } // GetMessage returns the Message field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericJsonResponse) GetMessage() (ret GenericJsonResponseGetMessageRetType) { ret, _ = o.GetMessageOk() return ret @@ -117,15 +140,18 @@ func (o *GenericJsonResponse) GetMessage() (ret GenericJsonResponseGetMessageRet // GetMessageOk returns a tuple with the Message field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericJsonResponse) GetMessageOk() (ret GenericJsonResponseGetMessageRetType, ok bool) { return getGenericJsonResponseGetMessageAttributeTypeOk(o.Message) } // SetMessage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericJsonResponse) SetMessage(v GenericJsonResponseGetMessageRetType) { setGenericJsonResponseGetMessageAttributeType(&o.Message, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GenericJsonResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGenericJsonResponseGetDetailsAttributeTypeOk(o.Details); ok { @@ -137,37 +163,45 @@ func (o GenericJsonResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGenericJsonResponse struct { value *GenericJsonResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGenericJsonResponse) Get() *GenericJsonResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGenericJsonResponse) Set(val *GenericJsonResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGenericJsonResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGenericJsonResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGenericJsonResponse(val *GenericJsonResponse) *NullableGenericJsonResponse { return &NullableGenericJsonResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGenericJsonResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGenericJsonResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_cache_info_response.go b/services/cdn/model_get_cache_info_response.go index c396e492c..0d74ceeb2 100644 --- a/services/cdn/model_get_cache_info_response.go +++ b/services/cdn/model_get_cache_info_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &GetCacheInfoResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseGetHistoryAttributeType = *[]GetCacheInfoResponseHistoryEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseGetHistoryArgType = []GetCacheInfoResponseHistoryEntry + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseGetHistoryRetType = []GetCacheInfoResponseHistoryEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCacheInfoResponseGetHistoryAttributeTypeOk(arg GetCacheInfoResponseGetHistoryAttributeType) (ret GetCacheInfoResponseGetHistoryRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getGetCacheInfoResponseGetHistoryAttributeTypeOk(arg GetCacheInfoResponseGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCacheInfoResponseGetHistoryAttributeType(arg *GetCacheInfoResponseGetHistoryAttributeType, val GetCacheInfoResponseGetHistoryRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setGetCacheInfoResponseGetHistoryAttributeType(arg *GetCacheInfoResponseGet */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseGetLastPurgeTimeAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseGetLastPurgeTimeArgType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseGetLastPurgeTimeRetType = *time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCacheInfoResponseGetLastPurgeTimeAttributeTypeOk(arg GetCacheInfoResponseGetLastPurgeTimeAttributeType) (ret GetCacheInfoResponseGetLastPurgeTimeRetType, ok bool) { if arg == nil { return nil, false @@ -54,11 +68,13 @@ func getGetCacheInfoResponseGetLastPurgeTimeAttributeTypeOk(arg GetCacheInfoResp return arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCacheInfoResponseGetLastPurgeTimeAttributeType(arg *GetCacheInfoResponseGetLastPurgeTimeAttributeType, val GetCacheInfoResponseGetLastPurgeTimeRetType) { *arg = val } // GetCacheInfoResponse struct for GetCacheInfoResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponse struct { // REQUIRED History GetCacheInfoResponseGetHistoryAttributeType `json:"history" required:"true"` @@ -67,12 +83,14 @@ type GetCacheInfoResponse struct { LastPurgeTime GetCacheInfoResponseGetLastPurgeTimeAttributeType `json:"lastPurgeTime" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetCacheInfoResponse GetCacheInfoResponse // NewGetCacheInfoResponse instantiates a new GetCacheInfoResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCacheInfoResponse(history GetCacheInfoResponseGetHistoryArgType, lastPurgeTime GetCacheInfoResponseGetLastPurgeTimeArgType) *GetCacheInfoResponse { this := GetCacheInfoResponse{} setGetCacheInfoResponseGetHistoryAttributeType(&this.History, history) @@ -83,12 +101,14 @@ func NewGetCacheInfoResponse(history GetCacheInfoResponseGetHistoryArgType, last // NewGetCacheInfoResponseWithDefaults instantiates a new GetCacheInfoResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCacheInfoResponseWithDefaults() *GetCacheInfoResponse { this := GetCacheInfoResponse{} return &this } // GetHistory returns the History field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponse) GetHistory() (ret GetCacheInfoResponseGetHistoryRetType) { ret, _ = o.GetHistoryOk() return ret @@ -96,17 +116,20 @@ func (o *GetCacheInfoResponse) GetHistory() (ret GetCacheInfoResponseGetHistoryR // GetHistoryOk returns a tuple with the History field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponse) GetHistoryOk() (ret GetCacheInfoResponseGetHistoryRetType, ok bool) { return getGetCacheInfoResponseGetHistoryAttributeTypeOk(o.History) } // SetHistory sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponse) SetHistory(v GetCacheInfoResponseGetHistoryRetType) { setGetCacheInfoResponseGetHistoryAttributeType(&o.History, v) } // GetLastPurgeTime returns the LastPurgeTime field value // If the value is explicit nil, the zero value for time.Time will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponse) GetLastPurgeTime() (ret GetCacheInfoResponseGetLastPurgeTimeRetType) { ret, _ = o.GetLastPurgeTimeOk() return ret @@ -115,15 +138,18 @@ func (o *GetCacheInfoResponse) GetLastPurgeTime() (ret GetCacheInfoResponseGetLa // GetLastPurgeTimeOk returns a tuple with the LastPurgeTime field value // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponse) GetLastPurgeTimeOk() (ret GetCacheInfoResponseGetLastPurgeTimeRetType, ok bool) { return getGetCacheInfoResponseGetLastPurgeTimeAttributeTypeOk(o.LastPurgeTime) } // SetLastPurgeTime sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponse) SetLastPurgeTime(v GetCacheInfoResponseGetLastPurgeTimeRetType) { setGetCacheInfoResponseGetLastPurgeTimeAttributeType(&o.LastPurgeTime, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetCacheInfoResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetCacheInfoResponseGetHistoryAttributeTypeOk(o.History); ok { @@ -135,37 +161,45 @@ func (o GetCacheInfoResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetCacheInfoResponse struct { value *GetCacheInfoResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponse) Get() *GetCacheInfoResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponse) Set(val *GetCacheInfoResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetCacheInfoResponse(val *GetCacheInfoResponse) *NullableGetCacheInfoResponse { return &NullableGetCacheInfoResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_cache_info_response_history_entry.go b/services/cdn/model_get_cache_info_response_history_entry.go index 564f0b533..6ea9625b5 100644 --- a/services/cdn/model_get_cache_info_response_history_entry.go +++ b/services/cdn/model_get_cache_info_response_history_entry.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -24,10 +25,16 @@ var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseHistoryEntryGetOccurredAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseHistoryEntryGetOccurredAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeTypeOk(arg GetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType) (ret GetCacheInfoResponseHistoryEntryGetOccurredAtRetType, ok bool) { if arg == nil { return ret, false @@ -35,6 +42,7 @@ func getGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeTypeOk(arg GetCach return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType(arg *GetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType, val GetCacheInfoResponseHistoryEntryGetOccurredAtRetType) { *arg = &val } @@ -47,20 +55,25 @@ func setGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType(arg *GetCache // GetCacheInfoResponseHistoryEntryTypes the model 'GetCacheInfoResponseHistoryEntry' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseHistoryEntryTypes string // List of Type const ( - GETCACHEINFORESPONSEHISTORYENTRYTYPE_FULL GetCacheInfoResponseHistoryEntryTypes = "full" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + GETCACHEINFORESPONSEHISTORYENTRYTYPE_FULL GetCacheInfoResponseHistoryEntryTypes = "full" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead GETCACHEINFORESPONSEHISTORYENTRYTYPE_GRANULAR GetCacheInfoResponseHistoryEntryTypes = "granular" ) // All allowed values of GetCacheInfoResponseHistoryEntry enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedGetCacheInfoResponseHistoryEntryTypesEnumValues = []GetCacheInfoResponseHistoryEntryTypes{ "full", "granular", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *GetCacheInfoResponseHistoryEntryTypes) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers @@ -88,6 +101,7 @@ func (v *GetCacheInfoResponseHistoryEntryTypes) UnmarshalJSON(src []byte) error // NewGetCacheInfoResponseHistoryEntryTypesFromValue returns a pointer to a valid GetCacheInfoResponseHistoryEntryTypes // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCacheInfoResponseHistoryEntryTypesFromValue(v GetCacheInfoResponseHistoryEntryTypes) (*GetCacheInfoResponseHistoryEntryTypes, error) { ev := GetCacheInfoResponseHistoryEntryTypes(v) if ev.IsValid() { @@ -98,6 +112,7 @@ func NewGetCacheInfoResponseHistoryEntryTypesFromValue(v GetCacheInfoResponseHis } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v GetCacheInfoResponseHistoryEntryTypes) IsValid() bool { for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypesEnumValues { if existing == v { @@ -108,50 +123,65 @@ func (v GetCacheInfoResponseHistoryEntryTypes) IsValid() bool { } // Ptr returns reference to TypeTypes value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v GetCacheInfoResponseHistoryEntryTypes) Ptr() *GetCacheInfoResponseHistoryEntryTypes { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetCacheInfoResponseHistoryEntryTypes struct { value *GetCacheInfoResponseHistoryEntryTypes isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponseHistoryEntryTypes) Get() *GetCacheInfoResponseHistoryEntryTypes { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponseHistoryEntryTypes) Set(val *GetCacheInfoResponseHistoryEntryTypes) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponseHistoryEntryTypes) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponseHistoryEntryTypes) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetCacheInfoResponseHistoryEntryTypes(val *GetCacheInfoResponseHistoryEntryTypes) *NullableGetCacheInfoResponseHistoryEntryTypes { return &NullableGetCacheInfoResponseHistoryEntryTypes{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponseHistoryEntryTypes) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponseHistoryEntryTypes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseHistoryEntryGetTypeAttributeType = *GetCacheInfoResponseHistoryEntryTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseHistoryEntryGetTypeArgType = GetCacheInfoResponseHistoryEntryTypes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseHistoryEntryGetTypeRetType = GetCacheInfoResponseHistoryEntryTypes +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCacheInfoResponseHistoryEntryGetTypeAttributeTypeOk(arg GetCacheInfoResponseHistoryEntryGetTypeAttributeType) (ret GetCacheInfoResponseHistoryEntryGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -159,11 +189,13 @@ func getGetCacheInfoResponseHistoryEntryGetTypeAttributeTypeOk(arg GetCacheInfoR return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCacheInfoResponseHistoryEntryGetTypeAttributeType(arg *GetCacheInfoResponseHistoryEntryGetTypeAttributeType, val GetCacheInfoResponseHistoryEntryGetTypeRetType) { *arg = &val } // GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCacheInfoResponseHistoryEntry struct { // REQUIRED OccurredAt GetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType `json:"occurredAt" required:"true"` @@ -171,12 +203,14 @@ type GetCacheInfoResponseHistoryEntry struct { Type GetCacheInfoResponseHistoryEntryGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry // NewGetCacheInfoResponseHistoryEntry instantiates a new GetCacheInfoResponseHistoryEntry 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCacheInfoResponseHistoryEntry(occurredAt GetCacheInfoResponseHistoryEntryGetOccurredAtArgType, types GetCacheInfoResponseHistoryEntryGetTypeArgType) *GetCacheInfoResponseHistoryEntry { this := GetCacheInfoResponseHistoryEntry{} setGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType(&this.OccurredAt, occurredAt) @@ -187,12 +221,14 @@ func NewGetCacheInfoResponseHistoryEntry(occurredAt GetCacheInfoResponseHistoryE // NewGetCacheInfoResponseHistoryEntryWithDefaults instantiates a new GetCacheInfoResponseHistoryEntry 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCacheInfoResponseHistoryEntryWithDefaults() *GetCacheInfoResponseHistoryEntry { this := GetCacheInfoResponseHistoryEntry{} return &this } // GetOccurredAt returns the OccurredAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAt() (ret GetCacheInfoResponseHistoryEntryGetOccurredAtRetType) { ret, _ = o.GetOccurredAtOk() return ret @@ -200,16 +236,19 @@ func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAt() (ret GetCacheInfoResp // GetOccurredAtOk returns a tuple with the OccurredAt field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAtOk() (ret GetCacheInfoResponseHistoryEntryGetOccurredAtRetType, ok bool) { return getGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeTypeOk(o.OccurredAt) } // SetOccurredAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v GetCacheInfoResponseHistoryEntryGetOccurredAtRetType) { setGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType(&o.OccurredAt, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponseHistoryEntry) GetType() (ret GetCacheInfoResponseHistoryEntryGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -217,15 +256,18 @@ func (o *GetCacheInfoResponseHistoryEntry) GetType() (ret GetCacheInfoResponseHi // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (ret GetCacheInfoResponseHistoryEntryGetTypeRetType, ok bool) { return getGetCacheInfoResponseHistoryEntryGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCacheInfoResponseHistoryEntry) SetType(v GetCacheInfoResponseHistoryEntryGetTypeRetType) { setGetCacheInfoResponseHistoryEntryGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetCacheInfoResponseHistoryEntry) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeTypeOk(o.OccurredAt); ok { @@ -237,37 +279,45 @@ func (o GetCacheInfoResponseHistoryEntry) ToMap() (map[string]interface{}, error return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetCacheInfoResponseHistoryEntry struct { value *GetCacheInfoResponseHistoryEntry isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponseHistoryEntry) Get() *GetCacheInfoResponseHistoryEntry { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponseHistoryEntry) Set(val *GetCacheInfoResponseHistoryEntry) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponseHistoryEntry) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponseHistoryEntry) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetCacheInfoResponseHistoryEntry(val *GetCacheInfoResponseHistoryEntry) *NullableGetCacheInfoResponseHistoryEntry { return &NullableGetCacheInfoResponseHistoryEntry{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCacheInfoResponseHistoryEntry) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_custom_domain_custom_certificate.go b/services/cdn/model_get_custom_domain_custom_certificate.go index e2b6dc38c..e3c310cac 100644 --- a/services/cdn/model_get_custom_domain_custom_certificate.go +++ b/services/cdn/model_get_custom_domain_custom_certificate.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &GetCustomDomainCustomCertificate{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainCustomCertificateGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCustomDomainCustomCertificateGetTypeAttributeTypeOk(arg GetCustomDomainCustomCertificateGetTypeAttributeType) (ret GetCustomDomainCustomCertificateGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getGetCustomDomainCustomCertificateGetTypeAttributeTypeOk(arg GetCustomDoma return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCustomDomainCustomCertificateGetTypeAttributeType(arg *GetCustomDomainCustomCertificateGetTypeAttributeType, val GetCustomDomainCustomCertificateGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainCustomCertificateGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainCustomCertificateGetTypeRetType = string /* @@ -43,10 +50,16 @@ type GetCustomDomainCustomCertificateGetTypeRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainCustomCertificateGetVersionAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainCustomCertificateGetVersionArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainCustomCertificateGetVersionRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCustomDomainCustomCertificateGetVersionAttributeTypeOk(arg GetCustomDomainCustomCertificateGetVersionAttributeType) (ret GetCustomDomainCustomCertificateGetVersionRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getGetCustomDomainCustomCertificateGetVersionAttributeTypeOk(arg GetCustomD return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCustomDomainCustomCertificateGetVersionAttributeType(arg *GetCustomDomainCustomCertificateGetVersionAttributeType, val GetCustomDomainCustomCertificateGetVersionRetType) { *arg = &val } // GetCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainCustomCertificate struct { // REQUIRED Type GetCustomDomainCustomCertificateGetTypeAttributeType `json:"type" required:"true"` @@ -68,12 +83,14 @@ type GetCustomDomainCustomCertificate struct { Version GetCustomDomainCustomCertificateGetVersionAttributeType `json:"version" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetCustomDomainCustomCertificate GetCustomDomainCustomCertificate // NewGetCustomDomainCustomCertificate instantiates a new GetCustomDomainCustomCertificate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCustomDomainCustomCertificate(types GetCustomDomainCustomCertificateGetTypeArgType, version GetCustomDomainCustomCertificateGetVersionArgType) *GetCustomDomainCustomCertificate { this := GetCustomDomainCustomCertificate{} setGetCustomDomainCustomCertificateGetTypeAttributeType(&this.Type, types) @@ -84,12 +101,14 @@ func NewGetCustomDomainCustomCertificate(types GetCustomDomainCustomCertificateG // NewGetCustomDomainCustomCertificateWithDefaults instantiates a new GetCustomDomainCustomCertificate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCustomDomainCustomCertificateWithDefaults() *GetCustomDomainCustomCertificate { this := GetCustomDomainCustomCertificate{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainCustomCertificate) GetType() (ret GetCustomDomainCustomCertificateGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -97,16 +116,19 @@ func (o *GetCustomDomainCustomCertificate) GetType() (ret GetCustomDomainCustomC // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainCustomCertificate) GetTypeOk() (ret GetCustomDomainCustomCertificateGetTypeRetType, ok bool) { return getGetCustomDomainCustomCertificateGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainCustomCertificate) SetType(v GetCustomDomainCustomCertificateGetTypeRetType) { setGetCustomDomainCustomCertificateGetTypeAttributeType(&o.Type, v) } // GetVersion returns the Version field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainCustomCertificate) GetVersion() (ret GetCustomDomainCustomCertificateGetVersionRetType) { ret, _ = o.GetVersionOk() return ret @@ -114,15 +136,18 @@ func (o *GetCustomDomainCustomCertificate) GetVersion() (ret GetCustomDomainCust // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainCustomCertificate) GetVersionOk() (ret GetCustomDomainCustomCertificateGetVersionRetType, ok bool) { return getGetCustomDomainCustomCertificateGetVersionAttributeTypeOk(o.Version) } // SetVersion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainCustomCertificate) SetVersion(v GetCustomDomainCustomCertificateGetVersionRetType) { setGetCustomDomainCustomCertificateGetVersionAttributeType(&o.Version, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetCustomDomainCustomCertificateGetTypeAttributeTypeOk(o.Type); ok { @@ -134,37 +159,45 @@ func (o GetCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetCustomDomainCustomCertificate struct { value *GetCustomDomainCustomCertificate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainCustomCertificate) Get() *GetCustomDomainCustomCertificate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainCustomCertificate) Set(val *GetCustomDomainCustomCertificate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainCustomCertificate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainCustomCertificate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetCustomDomainCustomCertificate(val *GetCustomDomainCustomCertificate) *NullableGetCustomDomainCustomCertificate { return &NullableGetCustomDomainCustomCertificate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_custom_domain_managed_certificate.go b/services/cdn/model_get_custom_domain_managed_certificate.go index 50c67ab33..369cca18f 100644 --- a/services/cdn/model_get_custom_domain_managed_certificate.go +++ b/services/cdn/model_get_custom_domain_managed_certificate.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &GetCustomDomainManagedCertificate{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainManagedCertificateGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCustomDomainManagedCertificateGetTypeAttributeTypeOk(arg GetCustomDomainManagedCertificateGetTypeAttributeType) (ret GetCustomDomainManagedCertificateGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,25 +34,32 @@ func getGetCustomDomainManagedCertificateGetTypeAttributeTypeOk(arg GetCustomDom return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCustomDomainManagedCertificateGetTypeAttributeType(arg *GetCustomDomainManagedCertificateGetTypeAttributeType, val GetCustomDomainManagedCertificateGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainManagedCertificateGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainManagedCertificateGetTypeRetType = string // GetCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainManagedCertificate struct { // REQUIRED Type GetCustomDomainManagedCertificateGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetCustomDomainManagedCertificate GetCustomDomainManagedCertificate // NewGetCustomDomainManagedCertificate instantiates a new GetCustomDomainManagedCertificate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCustomDomainManagedCertificate(types GetCustomDomainManagedCertificateGetTypeArgType) *GetCustomDomainManagedCertificate { this := GetCustomDomainManagedCertificate{} setGetCustomDomainManagedCertificateGetTypeAttributeType(&this.Type, types) @@ -59,12 +69,14 @@ func NewGetCustomDomainManagedCertificate(types GetCustomDomainManagedCertificat // NewGetCustomDomainManagedCertificateWithDefaults instantiates a new GetCustomDomainManagedCertificate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCustomDomainManagedCertificateWithDefaults() *GetCustomDomainManagedCertificate { this := GetCustomDomainManagedCertificate{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainManagedCertificate) GetType() (ret GetCustomDomainManagedCertificateGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -72,15 +84,18 @@ func (o *GetCustomDomainManagedCertificate) GetType() (ret GetCustomDomainManage // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainManagedCertificate) GetTypeOk() (ret GetCustomDomainManagedCertificateGetTypeRetType, ok bool) { return getGetCustomDomainManagedCertificateGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainManagedCertificate) SetType(v GetCustomDomainManagedCertificateGetTypeRetType) { setGetCustomDomainManagedCertificateGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetCustomDomainManagedCertificateGetTypeAttributeTypeOk(o.Type); ok { @@ -89,37 +104,45 @@ func (o GetCustomDomainManagedCertificate) ToMap() (map[string]interface{}, erro return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetCustomDomainManagedCertificate struct { value *GetCustomDomainManagedCertificate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainManagedCertificate) Get() *GetCustomDomainManagedCertificate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainManagedCertificate) Set(val *GetCustomDomainManagedCertificate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainManagedCertificate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainManagedCertificate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetCustomDomainManagedCertificate(val *GetCustomDomainManagedCertificate) *NullableGetCustomDomainManagedCertificate { return &NullableGetCustomDomainManagedCertificate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_custom_domain_response.go b/services/cdn/model_get_custom_domain_response.go index 2d60686d2..b361c75aa 100644 --- a/services/cdn/model_get_custom_domain_response.go +++ b/services/cdn/model_get_custom_domain_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetCustomDomainResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainResponseGetCertificateAttributeType = *GetCustomDomainResponseCertificate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainResponseGetCertificateArgType = GetCustomDomainResponseCertificate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainResponseGetCertificateRetType = GetCustomDomainResponseCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCustomDomainResponseGetCertificateAttributeTypeOk(arg GetCustomDomainResponseGetCertificateAttributeType) (ret GetCustomDomainResponseGetCertificateRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getGetCustomDomainResponseGetCertificateAttributeTypeOk(arg GetCustomDomain return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCustomDomainResponseGetCertificateAttributeType(arg *GetCustomDomainResponseGetCertificateAttributeType, val GetCustomDomainResponseGetCertificateRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setGetCustomDomainResponseGetCertificateAttributeType(arg *GetCustomDomainR */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainResponseGetCustomDomainAttributeType = *CustomDomain + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainResponseGetCustomDomainArgType = CustomDomain + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainResponseGetCustomDomainRetType = CustomDomain +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetCustomDomainResponseGetCustomDomainAttributeTypeOk(arg GetCustomDomainResponseGetCustomDomainAttributeType) (ret GetCustomDomainResponseGetCustomDomainRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getGetCustomDomainResponseGetCustomDomainAttributeTypeOk(arg GetCustomDomai return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetCustomDomainResponseGetCustomDomainAttributeType(arg *GetCustomDomainResponseGetCustomDomainAttributeType, val GetCustomDomainResponseGetCustomDomainRetType) { *arg = &val } // GetCustomDomainResponse struct for GetCustomDomainResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainResponse struct { // REQUIRED Certificate GetCustomDomainResponseGetCertificateAttributeType `json:"certificate" required:"true"` @@ -65,12 +81,14 @@ type GetCustomDomainResponse struct { CustomDomain GetCustomDomainResponseGetCustomDomainAttributeType `json:"customDomain" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetCustomDomainResponse GetCustomDomainResponse // NewGetCustomDomainResponse instantiates a new GetCustomDomainResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCustomDomainResponse(certificate GetCustomDomainResponseGetCertificateArgType, customDomain GetCustomDomainResponseGetCustomDomainArgType) *GetCustomDomainResponse { this := GetCustomDomainResponse{} setGetCustomDomainResponseGetCertificateAttributeType(&this.Certificate, certificate) @@ -81,12 +99,14 @@ func NewGetCustomDomainResponse(certificate GetCustomDomainResponseGetCertificat // NewGetCustomDomainResponseWithDefaults instantiates a new GetCustomDomainResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetCustomDomainResponseWithDefaults() *GetCustomDomainResponse { this := GetCustomDomainResponse{} return &this } // GetCertificate returns the Certificate field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainResponse) GetCertificate() (ret GetCustomDomainResponseGetCertificateRetType) { ret, _ = o.GetCertificateOk() return ret @@ -94,16 +114,19 @@ func (o *GetCustomDomainResponse) GetCertificate() (ret GetCustomDomainResponseG // GetCertificateOk returns a tuple with the Certificate field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainResponse) GetCertificateOk() (ret GetCustomDomainResponseGetCertificateRetType, ok bool) { return getGetCustomDomainResponseGetCertificateAttributeTypeOk(o.Certificate) } // SetCertificate sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainResponse) SetCertificate(v GetCustomDomainResponseGetCertificateRetType) { setGetCustomDomainResponseGetCertificateAttributeType(&o.Certificate, v) } // GetCustomDomain returns the CustomDomain field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainResponse) GetCustomDomain() (ret GetCustomDomainResponseGetCustomDomainRetType) { ret, _ = o.GetCustomDomainOk() return ret @@ -111,15 +134,18 @@ func (o *GetCustomDomainResponse) GetCustomDomain() (ret GetCustomDomainResponse // GetCustomDomainOk returns a tuple with the CustomDomain field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainResponse) GetCustomDomainOk() (ret GetCustomDomainResponseGetCustomDomainRetType, ok bool) { return getGetCustomDomainResponseGetCustomDomainAttributeTypeOk(o.CustomDomain) } // SetCustomDomain sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetCustomDomainResponse) SetCustomDomain(v GetCustomDomainResponseGetCustomDomainRetType) { setGetCustomDomainResponseGetCustomDomainAttributeType(&o.CustomDomain, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetCustomDomainResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetCustomDomainResponseGetCertificateAttributeTypeOk(o.Certificate); ok { @@ -131,37 +157,45 @@ func (o GetCustomDomainResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetCustomDomainResponse struct { value *GetCustomDomainResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainResponse) Get() *GetCustomDomainResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainResponse) Set(val *GetCustomDomainResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetCustomDomainResponse(val *GetCustomDomainResponse) *NullableGetCustomDomainResponse { return &NullableGetCustomDomainResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_custom_domain_response_certificate.go b/services/cdn/model_get_custom_domain_response_certificate.go index 4f9cef48b..8bea48148 100644 --- a/services/cdn/model_get_custom_domain_response_certificate.go +++ b/services/cdn/model_get_custom_domain_response_certificate.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,12 +17,14 @@ import ( ) // GetCustomDomainResponseCertificate - struct for GetCustomDomainResponseCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetCustomDomainResponseCertificate struct { GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate } // GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in GetCustomDomainResponseCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) GetCustomDomainResponseCertificate { return GetCustomDomainResponseCertificate{ GetCustomDomainCustomCertificate: v, @@ -29,6 +32,7 @@ func GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate(v *Get } // GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in GetCustomDomainResponseCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) GetCustomDomainResponseCertificate { return GetCustomDomainResponseCertificate{ GetCustomDomainManagedCertificate: v, @@ -36,6 +40,7 @@ func GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate(v *Ge } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *GetCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -98,6 +103,7 @@ func (dst *GetCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error // Marshal data from the first non-nil pointers in the struct to JSON func (src GetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.GetCustomDomainCustomCertificate != nil { return json.Marshal(&src.GetCustomDomainCustomCertificate) } @@ -110,6 +116,7 @@ func (src GetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *GetCustomDomainResponseCertificate) GetActualInstance() interface{} { if obj == nil { return nil @@ -126,37 +133,45 @@ func (obj *GetCustomDomainResponseCertificate) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetCustomDomainResponseCertificate struct { value *GetCustomDomainResponseCertificate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainResponseCertificate) Get() *GetCustomDomainResponseCertificate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainResponseCertificate) Set(val *GetCustomDomainResponseCertificate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainResponseCertificate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainResponseCertificate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetCustomDomainResponseCertificate(val *GetCustomDomainResponseCertificate) *NullableGetCustomDomainResponseCertificate { return &NullableGetCustomDomainResponseCertificate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_distribution_response.go b/services/cdn/model_get_distribution_response.go index 153f3833b..da1055488 100644 --- a/services/cdn/model_get_distribution_response.go +++ b/services/cdn/model_get_distribution_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetDistributionResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDistributionResponseGetDistributionAttributeType = *Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDistributionResponseGetDistributionArgType = Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDistributionResponseGetDistributionRetType = Distribution +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetDistributionResponseGetDistributionAttributeTypeOk(arg GetDistributionResponseGetDistributionAttributeType) (ret GetDistributionResponseGetDistributionRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getGetDistributionResponseGetDistributionAttributeTypeOk(arg GetDistributio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetDistributionResponseGetDistributionAttributeType(arg *GetDistributionResponseGetDistributionAttributeType, val GetDistributionResponseGetDistributionRetType) { *arg = &val } // GetDistributionResponse struct for GetDistributionResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetDistributionResponse struct { // REQUIRED Distribution GetDistributionResponseGetDistributionAttributeType `json:"distribution" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetDistributionResponse GetDistributionResponse // NewGetDistributionResponse instantiates a new GetDistributionResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetDistributionResponse(distribution GetDistributionResponseGetDistributionArgType) *GetDistributionResponse { this := GetDistributionResponse{} setGetDistributionResponseGetDistributionAttributeType(&this.Distribution, distribution) @@ -58,12 +69,14 @@ func NewGetDistributionResponse(distribution GetDistributionResponseGetDistribut // NewGetDistributionResponseWithDefaults instantiates a new GetDistributionResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetDistributionResponseWithDefaults() *GetDistributionResponse { this := GetDistributionResponse{} return &this } // GetDistribution returns the Distribution field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetDistributionResponse) GetDistribution() (ret GetDistributionResponseGetDistributionRetType) { ret, _ = o.GetDistributionOk() return ret @@ -71,15 +84,18 @@ func (o *GetDistributionResponse) GetDistribution() (ret GetDistributionResponse // GetDistributionOk returns a tuple with the Distribution field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetDistributionResponse) GetDistributionOk() (ret GetDistributionResponseGetDistributionRetType, ok bool) { return getGetDistributionResponseGetDistributionAttributeTypeOk(o.Distribution) } // SetDistribution sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetDistributionResponse) SetDistribution(v GetDistributionResponseGetDistributionRetType) { setGetDistributionResponseGetDistributionAttributeType(&o.Distribution, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetDistributionResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetDistributionResponseGetDistributionAttributeTypeOk(o.Distribution); ok { @@ -88,37 +104,45 @@ func (o GetDistributionResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetDistributionResponse struct { value *GetDistributionResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetDistributionResponse) Get() *GetDistributionResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetDistributionResponse) Set(val *GetDistributionResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetDistributionResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetDistributionResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetDistributionResponse(val *GetDistributionResponse) *NullableGetDistributionResponse { return &NullableGetDistributionResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetDistributionResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetDistributionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_logs_response.go b/services/cdn/model_get_logs_response.go index f061747dc..ad98da6cf 100644 --- a/services/cdn/model_get_logs_response.go +++ b/services/cdn/model_get_logs_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetLogsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsResponseGetLogsAttributeType = *[]DistributionLogsRecord + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsResponseGetLogsArgType = []DistributionLogsRecord + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsResponseGetLogsRetType = []DistributionLogsRecord +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsResponseGetLogsAttributeTypeOk(arg GetLogsResponseGetLogsAttributeType) (ret GetLogsResponseGetLogsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getGetLogsResponseGetLogsAttributeTypeOk(arg GetLogsResponseGetLogsAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsResponseGetLogsAttributeType(arg *GetLogsResponseGetLogsAttributeType, val GetLogsResponseGetLogsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setGetLogsResponseGetLogsAttributeType(arg *GetLogsResponseGetLogsAttribute */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsResponseGetNextPageIdentifierAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsResponseGetNextPageIdentifierAttributeTypeOk(arg GetLogsResponseGetNextPageIdentifierAttributeType) (ret GetLogsResponseGetNextPageIdentifierRetType, ok bool) { if arg == nil { return ret, false @@ -51,26 +61,33 @@ func getGetLogsResponseGetNextPageIdentifierAttributeTypeOk(arg GetLogsResponseG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsResponseGetNextPageIdentifierAttributeType(arg *GetLogsResponseGetNextPageIdentifierAttributeType, val GetLogsResponseGetNextPageIdentifierRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsResponseGetNextPageIdentifierArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsResponseGetNextPageIdentifierRetType = string // GetLogsResponse struct for GetLogsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsResponse struct { // REQUIRED Logs GetLogsResponseGetLogsAttributeType `json:"logs" required:"true"` NextPageIdentifier GetLogsResponseGetNextPageIdentifierAttributeType `json:"nextPageIdentifier,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetLogsResponse GetLogsResponse // NewGetLogsResponse instantiates a new GetLogsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetLogsResponse(logs GetLogsResponseGetLogsArgType) *GetLogsResponse { this := GetLogsResponse{} setGetLogsResponseGetLogsAttributeType(&this.Logs, logs) @@ -80,12 +97,14 @@ func NewGetLogsResponse(logs GetLogsResponseGetLogsArgType) *GetLogsResponse { // NewGetLogsResponseWithDefaults instantiates a new GetLogsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetLogsResponseWithDefaults() *GetLogsResponse { this := GetLogsResponse{} return &this } // GetLogs returns the Logs field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsResponse) GetLogs() (ret GetLogsResponseGetLogsRetType) { ret, _ = o.GetLogsOk() return ret @@ -93,16 +112,19 @@ func (o *GetLogsResponse) GetLogs() (ret GetLogsResponseGetLogsRetType) { // GetLogsOk returns a tuple with the Logs field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsResponse) GetLogsOk() (ret GetLogsResponseGetLogsRetType, ok bool) { return getGetLogsResponseGetLogsAttributeTypeOk(o.Logs) } // SetLogs sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsResponse) SetLogs(v GetLogsResponseGetLogsRetType) { setGetLogsResponseGetLogsAttributeType(&o.Logs, v) } // GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsResponse) GetNextPageIdentifier() (res GetLogsResponseGetNextPageIdentifierRetType) { res, _ = o.GetNextPageIdentifierOk() return @@ -110,21 +132,25 @@ func (o *GetLogsResponse) GetNextPageIdentifier() (res GetLogsResponseGetNextPag // GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsResponse) GetNextPageIdentifierOk() (ret GetLogsResponseGetNextPageIdentifierRetType, ok bool) { return getGetLogsResponseGetNextPageIdentifierAttributeTypeOk(o.NextPageIdentifier) } // HasNextPageIdentifier returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsResponse) HasNextPageIdentifier() bool { _, ok := o.GetNextPageIdentifierOk() return ok } // SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsResponse) SetNextPageIdentifier(v GetLogsResponseGetNextPageIdentifierRetType) { setGetLogsResponseGetNextPageIdentifierAttributeType(&o.NextPageIdentifier, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetLogsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetLogsResponseGetLogsAttributeTypeOk(o.Logs); ok { @@ -136,37 +162,45 @@ func (o GetLogsResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetLogsResponse struct { value *GetLogsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsResponse) Get() *GetLogsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsResponse) Set(val *GetLogsResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetLogsResponse(val *GetLogsResponse) *NullableGetLogsResponse { return &NullableGetLogsResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_logs_search_filters_response.go b/services/cdn/model_get_logs_search_filters_response.go index f6d7e7e3c..331b7265c 100644 --- a/services/cdn/model_get_logs_search_filters_response.go +++ b/services/cdn/model_get_logs_search_filters_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetLogsSearchFiltersResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetCacheAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetCacheArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetCacheRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseGetCacheAttributeTypeOk(arg GetLogsSearchFiltersResponseGetCacheAttributeType) (ret GetLogsSearchFiltersResponseGetCacheRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getGetLogsSearchFiltersResponseGetCacheAttributeTypeOk(arg GetLogsSearchFil return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseGetCacheAttributeType(arg *GetLogsSearchFiltersResponseGetCacheAttributeType, val GetLogsSearchFiltersResponseGetCacheRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setGetLogsSearchFiltersResponseGetCacheAttributeType(arg *GetLogsSearchFilt */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetDataCenterAttributeType = *GetLogsSearchFiltersResponseDatacenterBlock + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetDataCenterArgType = GetLogsSearchFiltersResponseDatacenterBlock + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetDataCenterRetType = GetLogsSearchFiltersResponseDatacenterBlock +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseGetDataCenterAttributeTypeOk(arg GetLogsSearchFiltersResponseGetDataCenterAttributeType) (ret GetLogsSearchFiltersResponseGetDataCenterRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getGetLogsSearchFiltersResponseGetDataCenterAttributeTypeOk(arg GetLogsSear return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseGetDataCenterAttributeType(arg *GetLogsSearchFiltersResponseGetDataCenterAttributeType, val GetLogsSearchFiltersResponseGetDataCenterRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setGetLogsSearchFiltersResponseGetDataCenterAttributeType(arg *GetLogsSearc */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetRemoteCountryAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetRemoteCountryArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetRemoteCountryRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseGetRemoteCountryAttributeTypeOk(arg GetLogsSearchFiltersResponseGetRemoteCountryAttributeType) (ret GetLogsSearchFiltersResponseGetRemoteCountryRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getGetLogsSearchFiltersResponseGetRemoteCountryAttributeTypeOk(arg GetLogsS return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseGetRemoteCountryAttributeType(arg *GetLogsSearchFiltersResponseGetRemoteCountryAttributeType, val GetLogsSearchFiltersResponseGetRemoteCountryRetType) { *arg = &val } @@ -82,10 +104,16 @@ func setGetLogsSearchFiltersResponseGetRemoteCountryAttributeType(arg *GetLogsSe */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetStatusAttributeType = *[]int32 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetStatusArgType = []int32 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseGetStatusRetType = []int32 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseGetStatusAttributeTypeOk(arg GetLogsSearchFiltersResponseGetStatusAttributeType) (ret GetLogsSearchFiltersResponseGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +121,13 @@ func getGetLogsSearchFiltersResponseGetStatusAttributeTypeOk(arg GetLogsSearchFi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseGetStatusAttributeType(arg *GetLogsSearchFiltersResponseGetStatusAttributeType, val GetLogsSearchFiltersResponseGetStatusRetType) { *arg = &val } // GetLogsSearchFiltersResponse struct for GetLogsSearchFiltersResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponse struct { // REQUIRED Cache GetLogsSearchFiltersResponseGetCacheAttributeType `json:"cache" required:"true"` @@ -111,12 +141,14 @@ type GetLogsSearchFiltersResponse struct { Status GetLogsSearchFiltersResponseGetStatusAttributeType `json:"status" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetLogsSearchFiltersResponse GetLogsSearchFiltersResponse // NewGetLogsSearchFiltersResponse instantiates a new GetLogsSearchFiltersResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetLogsSearchFiltersResponse(cache GetLogsSearchFiltersResponseGetCacheArgType, dataCenter GetLogsSearchFiltersResponseGetDataCenterArgType, remoteCountry GetLogsSearchFiltersResponseGetRemoteCountryArgType, status GetLogsSearchFiltersResponseGetStatusArgType) *GetLogsSearchFiltersResponse { this := GetLogsSearchFiltersResponse{} setGetLogsSearchFiltersResponseGetCacheAttributeType(&this.Cache, cache) @@ -129,12 +161,14 @@ func NewGetLogsSearchFiltersResponse(cache GetLogsSearchFiltersResponseGetCacheA // NewGetLogsSearchFiltersResponseWithDefaults instantiates a new GetLogsSearchFiltersResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetLogsSearchFiltersResponseWithDefaults() *GetLogsSearchFiltersResponse { this := GetLogsSearchFiltersResponse{} return &this } // GetCache returns the Cache field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) GetCache() (ret GetLogsSearchFiltersResponseGetCacheRetType) { ret, _ = o.GetCacheOk() return ret @@ -142,16 +176,19 @@ func (o *GetLogsSearchFiltersResponse) GetCache() (ret GetLogsSearchFiltersRespo // GetCacheOk returns a tuple with the Cache field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) GetCacheOk() (ret GetLogsSearchFiltersResponseGetCacheRetType, ok bool) { return getGetLogsSearchFiltersResponseGetCacheAttributeTypeOk(o.Cache) } // SetCache sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) SetCache(v GetLogsSearchFiltersResponseGetCacheRetType) { setGetLogsSearchFiltersResponseGetCacheAttributeType(&o.Cache, v) } // GetDataCenter returns the DataCenter field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) GetDataCenter() (ret GetLogsSearchFiltersResponseGetDataCenterRetType) { ret, _ = o.GetDataCenterOk() return ret @@ -159,16 +196,19 @@ func (o *GetLogsSearchFiltersResponse) GetDataCenter() (ret GetLogsSearchFilters // GetDataCenterOk returns a tuple with the DataCenter field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) GetDataCenterOk() (ret GetLogsSearchFiltersResponseGetDataCenterRetType, ok bool) { return getGetLogsSearchFiltersResponseGetDataCenterAttributeTypeOk(o.DataCenter) } // SetDataCenter sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) SetDataCenter(v GetLogsSearchFiltersResponseGetDataCenterRetType) { setGetLogsSearchFiltersResponseGetDataCenterAttributeType(&o.DataCenter, v) } // GetRemoteCountry returns the RemoteCountry field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) GetRemoteCountry() (ret GetLogsSearchFiltersResponseGetRemoteCountryRetType) { ret, _ = o.GetRemoteCountryOk() return ret @@ -176,16 +216,19 @@ func (o *GetLogsSearchFiltersResponse) GetRemoteCountry() (ret GetLogsSearchFilt // GetRemoteCountryOk returns a tuple with the RemoteCountry field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) GetRemoteCountryOk() (ret GetLogsSearchFiltersResponseGetRemoteCountryRetType, ok bool) { return getGetLogsSearchFiltersResponseGetRemoteCountryAttributeTypeOk(o.RemoteCountry) } // SetRemoteCountry sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) SetRemoteCountry(v GetLogsSearchFiltersResponseGetRemoteCountryRetType) { setGetLogsSearchFiltersResponseGetRemoteCountryAttributeType(&o.RemoteCountry, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) GetStatus() (ret GetLogsSearchFiltersResponseGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -193,15 +236,18 @@ func (o *GetLogsSearchFiltersResponse) GetStatus() (ret GetLogsSearchFiltersResp // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) GetStatusOk() (ret GetLogsSearchFiltersResponseGetStatusRetType, ok bool) { return getGetLogsSearchFiltersResponseGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponse) SetStatus(v GetLogsSearchFiltersResponseGetStatusRetType) { setGetLogsSearchFiltersResponseGetStatusAttributeType(&o.Status, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetLogsSearchFiltersResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetLogsSearchFiltersResponseGetCacheAttributeTypeOk(o.Cache); ok { @@ -219,37 +265,45 @@ func (o GetLogsSearchFiltersResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetLogsSearchFiltersResponse struct { value *GetLogsSearchFiltersResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponse) Get() *GetLogsSearchFiltersResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponse) Set(val *GetLogsSearchFiltersResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetLogsSearchFiltersResponse(val *GetLogsSearchFiltersResponse) *NullableGetLogsSearchFiltersResponse { return &NullableGetLogsSearchFiltersResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_logs_search_filters_response_datacenter_block.go b/services/cdn/model_get_logs_search_filters_response_datacenter_block.go index 9192b119d..4932257dd 100644 --- a/services/cdn/model_get_logs_search_filters_response_datacenter_block.go +++ b/services/cdn/model_get_logs_search_filters_response_datacenter_block.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetLogsSearchFiltersResponseDatacenterBlock{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeType = *[]GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetAFArgType = []GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetAFRetType = []GetLogsSearchFiltersResponseDatacenterBlockItem +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeTypeOk(arg GetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeType) (ret GetLogsSearchFiltersResponseDatacenterBlockGetAFRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getGetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeTypeOk(arg GetL return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeType(arg *GetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeType, val GetLogsSearchFiltersResponseDatacenterBlockGetAFRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setGetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeType(arg *GetLo */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeType = *[]GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetASIAArgType = []GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetASIARetType = []GetLogsSearchFiltersResponseDatacenterBlockItem +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeTypeOk(arg GetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeType) (ret GetLogsSearchFiltersResponseDatacenterBlockGetASIARetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getGetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeTypeOk(arg Ge return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeType(arg *GetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeType, val GetLogsSearchFiltersResponseDatacenterBlockGetASIARetType) { *arg = &val } @@ -62,10 +77,16 @@ func setGetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeType(arg *Get */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeType = *[]GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetEUArgType = []GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetEURetType = []GetLogsSearchFiltersResponseDatacenterBlockItem +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeTypeOk(arg GetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeType) (ret GetLogsSearchFiltersResponseDatacenterBlockGetEURetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getGetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeTypeOk(arg GetL return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeType(arg *GetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeType, val GetLogsSearchFiltersResponseDatacenterBlockGetEURetType) { *arg = &val } @@ -82,10 +104,16 @@ func setGetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeType(arg *GetLo */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeType = *[]GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetNAArgType = []GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetNARetType = []GetLogsSearchFiltersResponseDatacenterBlockItem +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeTypeOk(arg GetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeType) (ret GetLogsSearchFiltersResponseDatacenterBlockGetNARetType, ok bool) { if arg == nil { return ret, false @@ -93,6 +121,7 @@ func getGetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeTypeOk(arg GetL return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeType(arg *GetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeType, val GetLogsSearchFiltersResponseDatacenterBlockGetNARetType) { *arg = &val } @@ -102,10 +131,16 @@ func setGetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeType(arg *GetLo */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeType = *[]GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetSAArgType = []GetLogsSearchFiltersResponseDatacenterBlockItem + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockGetSARetType = []GetLogsSearchFiltersResponseDatacenterBlockItem +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeTypeOk(arg GetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeType) (ret GetLogsSearchFiltersResponseDatacenterBlockGetSARetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +148,13 @@ func getGetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeTypeOk(arg GetL return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeType(arg *GetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeType, val GetLogsSearchFiltersResponseDatacenterBlockGetSARetType) { *arg = &val } // GetLogsSearchFiltersResponseDatacenterBlock Object containing Datacenters to filter for. Each datacenter is grouped to the respective region. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlock struct { // REQUIRED AF GetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeType `json:"AF" required:"true"` @@ -131,12 +168,14 @@ type GetLogsSearchFiltersResponseDatacenterBlock struct { SA GetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeType `json:"SA" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetLogsSearchFiltersResponseDatacenterBlock GetLogsSearchFiltersResponseDatacenterBlock // NewGetLogsSearchFiltersResponseDatacenterBlock instantiates a new GetLogsSearchFiltersResponseDatacenterBlock 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetLogsSearchFiltersResponseDatacenterBlock(aF GetLogsSearchFiltersResponseDatacenterBlockGetAFArgType, aSIA GetLogsSearchFiltersResponseDatacenterBlockGetASIAArgType, eU GetLogsSearchFiltersResponseDatacenterBlockGetEUArgType, nA GetLogsSearchFiltersResponseDatacenterBlockGetNAArgType, sA GetLogsSearchFiltersResponseDatacenterBlockGetSAArgType) *GetLogsSearchFiltersResponseDatacenterBlock { this := GetLogsSearchFiltersResponseDatacenterBlock{} setGetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeType(&this.AF, aF) @@ -150,12 +189,14 @@ func NewGetLogsSearchFiltersResponseDatacenterBlock(aF GetLogsSearchFiltersRespo // NewGetLogsSearchFiltersResponseDatacenterBlockWithDefaults instantiates a new GetLogsSearchFiltersResponseDatacenterBlock 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetLogsSearchFiltersResponseDatacenterBlockWithDefaults() *GetLogsSearchFiltersResponseDatacenterBlock { this := GetLogsSearchFiltersResponseDatacenterBlock{} return &this } // GetAF returns the AF field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAF() (ret GetLogsSearchFiltersResponseDatacenterBlockGetAFRetType) { ret, _ = o.GetAFOk() return ret @@ -163,16 +204,19 @@ func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAF() (ret GetLogsSearch // GetAFOk returns a tuple with the AF field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAFOk() (ret GetLogsSearchFiltersResponseDatacenterBlockGetAFRetType, ok bool) { return getGetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeTypeOk(o.AF) } // SetAF sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetAF(v GetLogsSearchFiltersResponseDatacenterBlockGetAFRetType) { setGetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeType(&o.AF, v) } // GetASIA returns the ASIA field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIA() (ret GetLogsSearchFiltersResponseDatacenterBlockGetASIARetType) { ret, _ = o.GetASIAOk() return ret @@ -180,16 +224,19 @@ func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIA() (ret GetLogsSear // GetASIAOk returns a tuple with the ASIA field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIAOk() (ret GetLogsSearchFiltersResponseDatacenterBlockGetASIARetType, ok bool) { return getGetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeTypeOk(o.ASIA) } // SetASIA sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetASIA(v GetLogsSearchFiltersResponseDatacenterBlockGetASIARetType) { setGetLogsSearchFiltersResponseDatacenterBlockGetASIAAttributeType(&o.ASIA, v) } // GetEU returns the EU field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEU() (ret GetLogsSearchFiltersResponseDatacenterBlockGetEURetType) { ret, _ = o.GetEUOk() return ret @@ -197,16 +244,19 @@ func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEU() (ret GetLogsSearch // GetEUOk returns a tuple with the EU field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEUOk() (ret GetLogsSearchFiltersResponseDatacenterBlockGetEURetType, ok bool) { return getGetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeTypeOk(o.EU) } // SetEU sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetEU(v GetLogsSearchFiltersResponseDatacenterBlockGetEURetType) { setGetLogsSearchFiltersResponseDatacenterBlockGetEUAttributeType(&o.EU, v) } // GetNA returns the NA field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNA() (ret GetLogsSearchFiltersResponseDatacenterBlockGetNARetType) { ret, _ = o.GetNAOk() return ret @@ -214,16 +264,19 @@ func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNA() (ret GetLogsSearch // GetNAOk returns a tuple with the NA field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNAOk() (ret GetLogsSearchFiltersResponseDatacenterBlockGetNARetType, ok bool) { return getGetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeTypeOk(o.NA) } // SetNA sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetNA(v GetLogsSearchFiltersResponseDatacenterBlockGetNARetType) { setGetLogsSearchFiltersResponseDatacenterBlockGetNAAttributeType(&o.NA, v) } // GetSA returns the SA field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSA() (ret GetLogsSearchFiltersResponseDatacenterBlockGetSARetType) { ret, _ = o.GetSAOk() return ret @@ -231,15 +284,18 @@ func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSA() (ret GetLogsSearch // GetSAOk returns a tuple with the SA field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSAOk() (ret GetLogsSearchFiltersResponseDatacenterBlockGetSARetType, ok bool) { return getGetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeTypeOk(o.SA) } // SetSA sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetSA(v GetLogsSearchFiltersResponseDatacenterBlockGetSARetType) { setGetLogsSearchFiltersResponseDatacenterBlockGetSAAttributeType(&o.SA, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetLogsSearchFiltersResponseDatacenterBlock) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetLogsSearchFiltersResponseDatacenterBlockGetAFAttributeTypeOk(o.AF); ok { @@ -260,37 +316,45 @@ func (o GetLogsSearchFiltersResponseDatacenterBlock) ToMap() (map[string]interfa return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetLogsSearchFiltersResponseDatacenterBlock struct { value *GetLogsSearchFiltersResponseDatacenterBlock isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) Get() *GetLogsSearchFiltersResponseDatacenterBlock { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) Set(val *GetLogsSearchFiltersResponseDatacenterBlock) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetLogsSearchFiltersResponseDatacenterBlock(val *GetLogsSearchFiltersResponseDatacenterBlock) *NullableGetLogsSearchFiltersResponseDatacenterBlock { return &NullableGetLogsSearchFiltersResponseDatacenterBlock{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_logs_search_filters_response_datacenter_block_item.go b/services/cdn/model_get_logs_search_filters_response_datacenter_block_item.go index 103c39081..405fb7b9d 100644 --- a/services/cdn/model_get_logs_search_filters_response_datacenter_block_item.go +++ b/services/cdn/model_get_logs_search_filters_response_datacenter_block_item.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &GetLogsSearchFiltersResponseDatacenterBlockItem{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeTypeOk(arg GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeType) (ret GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getGetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeTy return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeType(arg *GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeType, val GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameRetType = string /* @@ -43,8 +50,10 @@ type GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameRetType = stri */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeTypeOk(arg GetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeType) (ret GetLogsSearchFiltersResponseDatacenterBlockItemGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getGetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeTypeOk(arg return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeType(arg *GetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeType, val GetLogsSearchFiltersResponseDatacenterBlockItemGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockItemGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockItemGetIdRetType = string // GetLogsSearchFiltersResponseDatacenterBlockItem A datacenter. The `id` defines the key needed to filter against the logs endpoint, while the `displayName` defines a human-readable Name. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetLogsSearchFiltersResponseDatacenterBlockItem struct { // REQUIRED DisplayName GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeType `json:"displayName" required:"true"` @@ -67,12 +81,14 @@ type GetLogsSearchFiltersResponseDatacenterBlockItem struct { Id GetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeType `json:"id" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetLogsSearchFiltersResponseDatacenterBlockItem GetLogsSearchFiltersResponseDatacenterBlockItem // NewGetLogsSearchFiltersResponseDatacenterBlockItem instantiates a new GetLogsSearchFiltersResponseDatacenterBlockItem 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetLogsSearchFiltersResponseDatacenterBlockItem(displayName GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameArgType, id GetLogsSearchFiltersResponseDatacenterBlockItemGetIdArgType) *GetLogsSearchFiltersResponseDatacenterBlockItem { this := GetLogsSearchFiltersResponseDatacenterBlockItem{} setGetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeType(&this.DisplayName, displayName) @@ -83,12 +99,14 @@ func NewGetLogsSearchFiltersResponseDatacenterBlockItem(displayName GetLogsSearc // NewGetLogsSearchFiltersResponseDatacenterBlockItemWithDefaults instantiates a new GetLogsSearchFiltersResponseDatacenterBlockItem 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetLogsSearchFiltersResponseDatacenterBlockItemWithDefaults() *GetLogsSearchFiltersResponseDatacenterBlockItem { this := GetLogsSearchFiltersResponseDatacenterBlockItem{} return &this } // GetDisplayName returns the DisplayName field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayName() (ret GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameRetType) { ret, _ = o.GetDisplayNameOk() return ret @@ -96,16 +114,19 @@ func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayName() (ret // GetDisplayNameOk returns a tuple with the DisplayName field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayNameOk() (ret GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameRetType, ok bool) { return getGetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeTypeOk(o.DisplayName) } // SetDisplayName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) SetDisplayName(v GetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameRetType) { setGetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeType(&o.DisplayName, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetId() (ret GetLogsSearchFiltersResponseDatacenterBlockItemGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -113,15 +134,18 @@ func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetId() (ret GetLogsSe // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetIdOk() (ret GetLogsSearchFiltersResponseDatacenterBlockItemGetIdRetType, ok bool) { return getGetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) SetId(v GetLogsSearchFiltersResponseDatacenterBlockItemGetIdRetType) { setGetLogsSearchFiltersResponseDatacenterBlockItemGetIdAttributeType(&o.Id, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetLogsSearchFiltersResponseDatacenterBlockItem) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetLogsSearchFiltersResponseDatacenterBlockItemGetDisplayNameAttributeTypeOk(o.DisplayName); ok { @@ -133,37 +157,45 @@ func (o GetLogsSearchFiltersResponseDatacenterBlockItem) ToMap() (map[string]int return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetLogsSearchFiltersResponseDatacenterBlockItem struct { value *GetLogsSearchFiltersResponseDatacenterBlockItem isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Get() *GetLogsSearchFiltersResponseDatacenterBlockItem { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Set(val *GetLogsSearchFiltersResponseDatacenterBlockItem) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetLogsSearchFiltersResponseDatacenterBlockItem(val *GetLogsSearchFiltersResponseDatacenterBlockItem) *NullableGetLogsSearchFiltersResponseDatacenterBlockItem { return &NullableGetLogsSearchFiltersResponseDatacenterBlockItem{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_get_statistics_response.go b/services/cdn/model_get_statistics_response.go index e554d5c41..cca6732a2 100644 --- a/services/cdn/model_get_statistics_response.go +++ b/services/cdn/model_get_statistics_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetStatisticsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetStatisticsResponseGetRecordsAttributeType = *[]DistributionStatisticsRecord + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetStatisticsResponseGetRecordsArgType = []DistributionStatisticsRecord + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetStatisticsResponseGetRecordsRetType = []DistributionStatisticsRecord +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetStatisticsResponseGetRecordsAttributeTypeOk(arg GetStatisticsResponseGetRecordsAttributeType) (ret GetStatisticsResponseGetRecordsRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getGetStatisticsResponseGetRecordsAttributeTypeOk(arg GetStatisticsResponse return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetStatisticsResponseGetRecordsAttributeType(arg *GetStatisticsResponseGetRecordsAttributeType, val GetStatisticsResponseGetRecordsRetType) { *arg = &val } // GetStatisticsResponse struct for GetStatisticsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetStatisticsResponse struct { // REQUIRED Records GetStatisticsResponseGetRecordsAttributeType `json:"records" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GetStatisticsResponse GetStatisticsResponse // NewGetStatisticsResponse instantiates a new GetStatisticsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetStatisticsResponse(records GetStatisticsResponseGetRecordsArgType) *GetStatisticsResponse { this := GetStatisticsResponse{} setGetStatisticsResponseGetRecordsAttributeType(&this.Records, records) @@ -58,12 +69,14 @@ func NewGetStatisticsResponse(records GetStatisticsResponseGetRecordsArgType) *G // NewGetStatisticsResponseWithDefaults instantiates a new GetStatisticsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetStatisticsResponseWithDefaults() *GetStatisticsResponse { this := GetStatisticsResponse{} return &this } // GetRecords returns the Records field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetStatisticsResponse) GetRecords() (ret GetStatisticsResponseGetRecordsRetType) { ret, _ = o.GetRecordsOk() return ret @@ -71,15 +84,18 @@ func (o *GetStatisticsResponse) GetRecords() (ret GetStatisticsResponseGetRecord // GetRecordsOk returns a tuple with the Records field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetStatisticsResponse) GetRecordsOk() (ret GetStatisticsResponseGetRecordsRetType, ok bool) { return getGetStatisticsResponseGetRecordsAttributeTypeOk(o.Records) } // SetRecords sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetStatisticsResponse) SetRecords(v GetStatisticsResponseGetRecordsRetType) { setGetStatisticsResponseGetRecordsAttributeType(&o.Records, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetStatisticsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetStatisticsResponseGetRecordsAttributeTypeOk(o.Records); ok { @@ -88,37 +104,45 @@ func (o GetStatisticsResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetStatisticsResponse struct { value *GetStatisticsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetStatisticsResponse) Get() *GetStatisticsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetStatisticsResponse) Set(val *GetStatisticsResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetStatisticsResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetStatisticsResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetStatisticsResponse(val *GetStatisticsResponse) *NullableGetStatisticsResponse { return &NullableGetStatisticsResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetStatisticsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetStatisticsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_http_backend.go b/services/cdn/model_http_backend.go index 425a753c7..0f144e5d9 100644 --- a/services/cdn/model_http_backend.go +++ b/services/cdn/model_http_backend.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &HttpBackend{} */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetGeofencingAttributeType = *map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetGeofencingArgType = map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetGeofencingRetType = map[string][]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendGetGeofencingAttributeTypeOk(arg HttpBackendGetGeofencingAttributeType) (ret HttpBackendGetGeofencingRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getHttpBackendGetGeofencingAttributeTypeOk(arg HttpBackendGetGeofencingAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendGetGeofencingAttributeType(arg *HttpBackendGetGeofencingAttributeType, val HttpBackendGetGeofencingRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setHttpBackendGetGeofencingAttributeType(arg *HttpBackendGetGeofencingAttri */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetOriginRequestHeadersAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetOriginRequestHeadersArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetOriginRequestHeadersRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendGetOriginRequestHeadersAttributeType) (ret HttpBackendGetOriginRequestHeadersRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getHttpBackendGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendGetOrig return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendGetOriginRequestHeadersAttributeType(arg *HttpBackendGetOriginRequestHeadersAttributeType, val HttpBackendGetOriginRequestHeadersRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setHttpBackendGetOriginRequestHeadersAttributeType(arg *HttpBackendGetOrigi */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetOriginUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendGetOriginUrlAttributeTypeOk(arg HttpBackendGetOriginUrlAttributeType) (ret HttpBackendGetOriginUrlRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getHttpBackendGetOriginUrlAttributeTypeOk(arg HttpBackendGetOriginUrlAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendGetOriginUrlAttributeType(arg *HttpBackendGetOriginUrlAttributeType, val HttpBackendGetOriginUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetOriginUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetOriginUrlRetType = string /* @@ -83,8 +104,10 @@ type HttpBackendGetOriginUrlRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendGetTypeAttributeTypeOk(arg HttpBackendGetTypeAttributeType) (ret HttpBackendGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -92,14 +115,19 @@ func getHttpBackendGetTypeAttributeTypeOk(arg HttpBackendGetTypeAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendGetTypeAttributeType(arg *HttpBackendGetTypeAttributeType, val HttpBackendGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendGetTypeRetType = string // HttpBackend struct for HttpBackend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackend struct { // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. // REQUIRED @@ -114,12 +142,14 @@ type HttpBackend struct { Type HttpBackendGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _HttpBackend HttpBackend // NewHttpBackend instantiates a new HttpBackend 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewHttpBackend(geofencing HttpBackendGetGeofencingArgType, originRequestHeaders HttpBackendGetOriginRequestHeadersArgType, originUrl HttpBackendGetOriginUrlArgType, types HttpBackendGetTypeArgType) *HttpBackend { this := HttpBackend{} setHttpBackendGetGeofencingAttributeType(&this.Geofencing, geofencing) @@ -132,12 +162,14 @@ func NewHttpBackend(geofencing HttpBackendGetGeofencingArgType, originRequestHea // NewHttpBackendWithDefaults instantiates a new HttpBackend 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewHttpBackendWithDefaults() *HttpBackend { this := HttpBackend{} return &this } // GetGeofencing returns the Geofencing field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) GetGeofencing() (ret HttpBackendGetGeofencingRetType) { ret, _ = o.GetGeofencingOk() return ret @@ -145,16 +177,19 @@ func (o *HttpBackend) GetGeofencing() (ret HttpBackendGetGeofencingRetType) { // GetGeofencingOk returns a tuple with the Geofencing field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) GetGeofencingOk() (ret HttpBackendGetGeofencingRetType, ok bool) { return getHttpBackendGetGeofencingAttributeTypeOk(o.Geofencing) } // SetGeofencing sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) SetGeofencing(v HttpBackendGetGeofencingRetType) { setHttpBackendGetGeofencingAttributeType(&o.Geofencing, v) } // GetOriginRequestHeaders returns the OriginRequestHeaders field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) GetOriginRequestHeaders() (ret HttpBackendGetOriginRequestHeadersRetType) { ret, _ = o.GetOriginRequestHeadersOk() return ret @@ -162,16 +197,19 @@ func (o *HttpBackend) GetOriginRequestHeaders() (ret HttpBackendGetOriginRequest // GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) GetOriginRequestHeadersOk() (ret HttpBackendGetOriginRequestHeadersRetType, ok bool) { return getHttpBackendGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders) } // SetOriginRequestHeaders sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) SetOriginRequestHeaders(v HttpBackendGetOriginRequestHeadersRetType) { setHttpBackendGetOriginRequestHeadersAttributeType(&o.OriginRequestHeaders, v) } // GetOriginUrl returns the OriginUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) GetOriginUrl() (ret HttpBackendGetOriginUrlRetType) { ret, _ = o.GetOriginUrlOk() return ret @@ -179,16 +217,19 @@ func (o *HttpBackend) GetOriginUrl() (ret HttpBackendGetOriginUrlRetType) { // GetOriginUrlOk returns a tuple with the OriginUrl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) GetOriginUrlOk() (ret HttpBackendGetOriginUrlRetType, ok bool) { return getHttpBackendGetOriginUrlAttributeTypeOk(o.OriginUrl) } // SetOriginUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) SetOriginUrl(v HttpBackendGetOriginUrlRetType) { setHttpBackendGetOriginUrlAttributeType(&o.OriginUrl, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) GetType() (ret HttpBackendGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -196,15 +237,18 @@ func (o *HttpBackend) GetType() (ret HttpBackendGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) GetTypeOk() (ret HttpBackendGetTypeRetType, ok bool) { return getHttpBackendGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackend) SetType(v HttpBackendGetTypeRetType) { setHttpBackendGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o HttpBackend) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getHttpBackendGetGeofencingAttributeTypeOk(o.Geofencing); ok { @@ -222,37 +266,45 @@ func (o HttpBackend) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableHttpBackend struct { value *HttpBackend isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackend) Get() *HttpBackend { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackend) Set(val *HttpBackend) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackend) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackend) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableHttpBackend(val *HttpBackend) *NullableHttpBackend { return &NullableHttpBackend{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackend) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackend) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_http_backend_create.go b/services/cdn/model_http_backend_create.go index 8e8435d56..702289d77 100644 --- a/services/cdn/model_http_backend_create.go +++ b/services/cdn/model_http_backend_create.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &HttpBackendCreate{} */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetGeofencingAttributeType = *map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetGeofencingArgType = map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetGeofencingRetType = map[string][]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendCreateGetGeofencingAttributeTypeOk(arg HttpBackendCreateGetGeofencingAttributeType) (ret HttpBackendCreateGetGeofencingRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getHttpBackendCreateGetGeofencingAttributeTypeOk(arg HttpBackendCreateGetGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendCreateGetGeofencingAttributeType(arg *HttpBackendCreateGetGeofencingAttributeType, val HttpBackendCreateGetGeofencingRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setHttpBackendCreateGetGeofencingAttributeType(arg *HttpBackendCreateGetGeo */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetOriginRequestHeadersAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetOriginRequestHeadersArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetOriginRequestHeadersRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendCreateGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendCreateGetOriginRequestHeadersAttributeType) (ret HttpBackendCreateGetOriginRequestHeadersRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getHttpBackendCreateGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendC return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendCreateGetOriginRequestHeadersAttributeType(arg *HttpBackendCreateGetOriginRequestHeadersAttributeType, val HttpBackendCreateGetOriginRequestHeadersRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setHttpBackendCreateGetOriginRequestHeadersAttributeType(arg *HttpBackendCr */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetOriginUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendCreateGetOriginUrlAttributeTypeOk(arg HttpBackendCreateGetOriginUrlAttributeType) (ret HttpBackendCreateGetOriginUrlRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getHttpBackendCreateGetOriginUrlAttributeTypeOk(arg HttpBackendCreateGetOri return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendCreateGetOriginUrlAttributeType(arg *HttpBackendCreateGetOriginUrlAttributeType, val HttpBackendCreateGetOriginUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetOriginUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetOriginUrlRetType = string /* @@ -83,8 +104,10 @@ type HttpBackendCreateGetOriginUrlRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendCreateGetTypeAttributeTypeOk(arg HttpBackendCreateGetTypeAttributeType) (ret HttpBackendCreateGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -92,14 +115,19 @@ func getHttpBackendCreateGetTypeAttributeTypeOk(arg HttpBackendCreateGetTypeAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendCreateGetTypeAttributeType(arg *HttpBackendCreateGetTypeAttributeType, val HttpBackendCreateGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreateGetTypeRetType = string // HttpBackendCreate struct for HttpBackendCreate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendCreate struct { // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. Geofencing HttpBackendCreateGetGeofencingAttributeType `json:"geofencing,omitempty"` @@ -112,12 +140,14 @@ type HttpBackendCreate struct { Type HttpBackendCreateGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _HttpBackendCreate HttpBackendCreate // NewHttpBackendCreate instantiates a new HttpBackendCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewHttpBackendCreate(originUrl HttpBackendCreateGetOriginUrlArgType, types HttpBackendCreateGetTypeArgType) *HttpBackendCreate { this := HttpBackendCreate{} setHttpBackendCreateGetOriginUrlAttributeType(&this.OriginUrl, originUrl) @@ -128,12 +158,14 @@ func NewHttpBackendCreate(originUrl HttpBackendCreateGetOriginUrlArgType, types // NewHttpBackendCreateWithDefaults instantiates a new HttpBackendCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewHttpBackendCreateWithDefaults() *HttpBackendCreate { this := HttpBackendCreate{} return &this } // GetGeofencing returns the Geofencing field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) GetGeofencing() (res HttpBackendCreateGetGeofencingRetType) { res, _ = o.GetGeofencingOk() return @@ -141,22 +173,26 @@ func (o *HttpBackendCreate) GetGeofencing() (res HttpBackendCreateGetGeofencingR // GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) GetGeofencingOk() (ret HttpBackendCreateGetGeofencingRetType, ok bool) { return getHttpBackendCreateGetGeofencingAttributeTypeOk(o.Geofencing) } // HasGeofencing returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) HasGeofencing() bool { _, ok := o.GetGeofencingOk() return ok } // SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) SetGeofencing(v HttpBackendCreateGetGeofencingRetType) { setHttpBackendCreateGetGeofencingAttributeType(&o.Geofencing, v) } // GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) GetOriginRequestHeaders() (res HttpBackendCreateGetOriginRequestHeadersRetType) { res, _ = o.GetOriginRequestHeadersOk() return @@ -164,22 +200,26 @@ func (o *HttpBackendCreate) GetOriginRequestHeaders() (res HttpBackendCreateGetO // GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) GetOriginRequestHeadersOk() (ret HttpBackendCreateGetOriginRequestHeadersRetType, ok bool) { return getHttpBackendCreateGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders) } // HasOriginRequestHeaders returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) HasOriginRequestHeaders() bool { _, ok := o.GetOriginRequestHeadersOk() return ok } // SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) SetOriginRequestHeaders(v HttpBackendCreateGetOriginRequestHeadersRetType) { setHttpBackendCreateGetOriginRequestHeadersAttributeType(&o.OriginRequestHeaders, v) } // GetOriginUrl returns the OriginUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) GetOriginUrl() (ret HttpBackendCreateGetOriginUrlRetType) { ret, _ = o.GetOriginUrlOk() return ret @@ -187,16 +227,19 @@ func (o *HttpBackendCreate) GetOriginUrl() (ret HttpBackendCreateGetOriginUrlRet // GetOriginUrlOk returns a tuple with the OriginUrl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) GetOriginUrlOk() (ret HttpBackendCreateGetOriginUrlRetType, ok bool) { return getHttpBackendCreateGetOriginUrlAttributeTypeOk(o.OriginUrl) } // SetOriginUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) SetOriginUrl(v HttpBackendCreateGetOriginUrlRetType) { setHttpBackendCreateGetOriginUrlAttributeType(&o.OriginUrl, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) GetType() (ret HttpBackendCreateGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -204,15 +247,18 @@ func (o *HttpBackendCreate) GetType() (ret HttpBackendCreateGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) GetTypeOk() (ret HttpBackendCreateGetTypeRetType, ok bool) { return getHttpBackendCreateGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendCreate) SetType(v HttpBackendCreateGetTypeRetType) { setHttpBackendCreateGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o HttpBackendCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getHttpBackendCreateGetGeofencingAttributeTypeOk(o.Geofencing); ok { @@ -230,37 +276,45 @@ func (o HttpBackendCreate) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableHttpBackendCreate struct { value *HttpBackendCreate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackendCreate) Get() *HttpBackendCreate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackendCreate) Set(val *HttpBackendCreate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackendCreate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackendCreate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableHttpBackendCreate(val *HttpBackendCreate) *NullableHttpBackendCreate { return &NullableHttpBackendCreate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackendCreate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackendCreate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_http_backend_patch.go b/services/cdn/model_http_backend_patch.go index ce2fe13a0..901f943e4 100644 --- a/services/cdn/model_http_backend_patch.go +++ b/services/cdn/model_http_backend_patch.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &HttpBackendPatch{} */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetGeofencingAttributeType = *map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetGeofencingArgType = map[string][]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetGeofencingRetType = map[string][]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendPatchGetGeofencingAttributeTypeOk(arg HttpBackendPatchGetGeofencingAttributeType) (ret HttpBackendPatchGetGeofencingRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getHttpBackendPatchGetGeofencingAttributeTypeOk(arg HttpBackendPatchGetGeof return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendPatchGetGeofencingAttributeType(arg *HttpBackendPatchGetGeofencingAttributeType, val HttpBackendPatchGetGeofencingRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setHttpBackendPatchGetGeofencingAttributeType(arg *HttpBackendPatchGetGeofe */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetOriginRequestHeadersAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetOriginRequestHeadersArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetOriginRequestHeadersRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendPatchGetOriginRequestHeadersAttributeType) (ret HttpBackendPatchGetOriginRequestHeadersRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendPatchGetOriginRequestHeadersAttributeType(arg *HttpBackendPatchGetOriginRequestHeadersAttributeType, val HttpBackendPatchGetOriginRequestHeadersRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setHttpBackendPatchGetOriginRequestHeadersAttributeType(arg *HttpBackendPat */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetOriginUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendPatchGetOriginUrlAttributeTypeOk(arg HttpBackendPatchGetOriginUrlAttributeType) (ret HttpBackendPatchGetOriginUrlRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getHttpBackendPatchGetOriginUrlAttributeTypeOk(arg HttpBackendPatchGetOrigi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendPatchGetOriginUrlAttributeType(arg *HttpBackendPatchGetOriginUrlAttributeType, val HttpBackendPatchGetOriginUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetOriginUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetOriginUrlRetType = string /* @@ -83,8 +104,10 @@ type HttpBackendPatchGetOriginUrlRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getHttpBackendPatchGetTypeAttributeTypeOk(arg HttpBackendPatchGetTypeAttributeType) (ret HttpBackendPatchGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -92,14 +115,19 @@ func getHttpBackendPatchGetTypeAttributeTypeOk(arg HttpBackendPatchGetTypeAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setHttpBackendPatchGetTypeAttributeType(arg *HttpBackendPatchGetTypeAttributeType, val HttpBackendPatchGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatchGetTypeRetType = string // HttpBackendPatch A partial HTTP Backend +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type HttpBackendPatch struct { // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. Geofencing HttpBackendPatchGetGeofencingAttributeType `json:"geofencing,omitempty"` @@ -111,12 +139,14 @@ type HttpBackendPatch struct { Type HttpBackendPatchGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _HttpBackendPatch HttpBackendPatch // NewHttpBackendPatch instantiates a new HttpBackendPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewHttpBackendPatch(types HttpBackendPatchGetTypeArgType) *HttpBackendPatch { this := HttpBackendPatch{} setHttpBackendPatchGetTypeAttributeType(&this.Type, types) @@ -126,12 +156,14 @@ func NewHttpBackendPatch(types HttpBackendPatchGetTypeArgType) *HttpBackendPatch // NewHttpBackendPatchWithDefaults instantiates a new HttpBackendPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewHttpBackendPatchWithDefaults() *HttpBackendPatch { this := HttpBackendPatch{} return &this } // GetGeofencing returns the Geofencing field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) GetGeofencing() (res HttpBackendPatchGetGeofencingRetType) { res, _ = o.GetGeofencingOk() return @@ -139,22 +171,26 @@ func (o *HttpBackendPatch) GetGeofencing() (res HttpBackendPatchGetGeofencingRet // GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) GetGeofencingOk() (ret HttpBackendPatchGetGeofencingRetType, ok bool) { return getHttpBackendPatchGetGeofencingAttributeTypeOk(o.Geofencing) } // HasGeofencing returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) HasGeofencing() bool { _, ok := o.GetGeofencingOk() return ok } // SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) SetGeofencing(v HttpBackendPatchGetGeofencingRetType) { setHttpBackendPatchGetGeofencingAttributeType(&o.Geofencing, v) } // GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) GetOriginRequestHeaders() (res HttpBackendPatchGetOriginRequestHeadersRetType) { res, _ = o.GetOriginRequestHeadersOk() return @@ -162,22 +198,26 @@ func (o *HttpBackendPatch) GetOriginRequestHeaders() (res HttpBackendPatchGetOri // GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) GetOriginRequestHeadersOk() (ret HttpBackendPatchGetOriginRequestHeadersRetType, ok bool) { return getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders) } // HasOriginRequestHeaders returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) HasOriginRequestHeaders() bool { _, ok := o.GetOriginRequestHeadersOk() return ok } // SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) SetOriginRequestHeaders(v HttpBackendPatchGetOriginRequestHeadersRetType) { setHttpBackendPatchGetOriginRequestHeadersAttributeType(&o.OriginRequestHeaders, v) } // GetOriginUrl returns the OriginUrl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) GetOriginUrl() (res HttpBackendPatchGetOriginUrlRetType) { res, _ = o.GetOriginUrlOk() return @@ -185,22 +225,26 @@ func (o *HttpBackendPatch) GetOriginUrl() (res HttpBackendPatchGetOriginUrlRetTy // GetOriginUrlOk returns a tuple with the OriginUrl field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) GetOriginUrlOk() (ret HttpBackendPatchGetOriginUrlRetType, ok bool) { return getHttpBackendPatchGetOriginUrlAttributeTypeOk(o.OriginUrl) } // HasOriginUrl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) HasOriginUrl() bool { _, ok := o.GetOriginUrlOk() return ok } // SetOriginUrl gets a reference to the given string and assigns it to the OriginUrl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) SetOriginUrl(v HttpBackendPatchGetOriginUrlRetType) { setHttpBackendPatchGetOriginUrlAttributeType(&o.OriginUrl, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) GetType() (ret HttpBackendPatchGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -208,15 +252,18 @@ func (o *HttpBackendPatch) GetType() (ret HttpBackendPatchGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) GetTypeOk() (ret HttpBackendPatchGetTypeRetType, ok bool) { return getHttpBackendPatchGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *HttpBackendPatch) SetType(v HttpBackendPatchGetTypeRetType) { setHttpBackendPatchGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getHttpBackendPatchGetGeofencingAttributeTypeOk(o.Geofencing); ok { @@ -234,37 +281,45 @@ func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableHttpBackendPatch struct { value *HttpBackendPatch isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackendPatch) Get() *HttpBackendPatch { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackendPatch) Set(val *HttpBackendPatch) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackendPatch) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackendPatch) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableHttpBackendPatch(val *HttpBackendPatch) *NullableHttpBackendPatch { return &NullableHttpBackendPatch{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableHttpBackendPatch) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableHttpBackendPatch) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_list_distributions_response.go b/services/cdn/model_list_distributions_response.go index 3cea183aa..07726de3f 100644 --- a/services/cdn/model_list_distributions_response.go +++ b/services/cdn/model_list_distributions_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListDistributionsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDistributionsResponseGetDistributionsAttributeType = *[]Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDistributionsResponseGetDistributionsArgType = []Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDistributionsResponseGetDistributionsRetType = []Distribution +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListDistributionsResponseGetDistributionsAttributeTypeOk(arg ListDistributionsResponseGetDistributionsAttributeType) (ret ListDistributionsResponseGetDistributionsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getListDistributionsResponseGetDistributionsAttributeTypeOk(arg ListDistrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListDistributionsResponseGetDistributionsAttributeType(arg *ListDistributionsResponseGetDistributionsAttributeType, val ListDistributionsResponseGetDistributionsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setListDistributionsResponseGetDistributionsAttributeType(arg *ListDistribu */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDistributionsResponseGetNextPageIdentifierAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListDistributionsResponseGetNextPageIdentifierAttributeTypeOk(arg ListDistributionsResponseGetNextPageIdentifierAttributeType) (ret ListDistributionsResponseGetNextPageIdentifierRetType, ok bool) { if arg == nil { return ret, false @@ -51,26 +61,33 @@ func getListDistributionsResponseGetNextPageIdentifierAttributeTypeOk(arg ListDi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListDistributionsResponseGetNextPageIdentifierAttributeType(arg *ListDistributionsResponseGetNextPageIdentifierAttributeType, val ListDistributionsResponseGetNextPageIdentifierRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDistributionsResponseGetNextPageIdentifierArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDistributionsResponseGetNextPageIdentifierRetType = string // ListDistributionsResponse struct for ListDistributionsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListDistributionsResponse struct { // REQUIRED Distributions ListDistributionsResponseGetDistributionsAttributeType `json:"distributions" required:"true"` NextPageIdentifier ListDistributionsResponseGetNextPageIdentifierAttributeType `json:"nextPageIdentifier,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ListDistributionsResponse ListDistributionsResponse // NewListDistributionsResponse instantiates a new ListDistributionsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewListDistributionsResponse(distributions ListDistributionsResponseGetDistributionsArgType) *ListDistributionsResponse { this := ListDistributionsResponse{} setListDistributionsResponseGetDistributionsAttributeType(&this.Distributions, distributions) @@ -80,12 +97,14 @@ func NewListDistributionsResponse(distributions ListDistributionsResponseGetDist // NewListDistributionsResponseWithDefaults instantiates a new ListDistributionsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewListDistributionsResponseWithDefaults() *ListDistributionsResponse { this := ListDistributionsResponse{} return &this } // GetDistributions returns the Distributions field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListDistributionsResponse) GetDistributions() (ret ListDistributionsResponseGetDistributionsRetType) { ret, _ = o.GetDistributionsOk() return ret @@ -93,16 +112,19 @@ func (o *ListDistributionsResponse) GetDistributions() (ret ListDistributionsRes // GetDistributionsOk returns a tuple with the Distributions field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListDistributionsResponse) GetDistributionsOk() (ret ListDistributionsResponseGetDistributionsRetType, ok bool) { return getListDistributionsResponseGetDistributionsAttributeTypeOk(o.Distributions) } // SetDistributions sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListDistributionsResponse) SetDistributions(v ListDistributionsResponseGetDistributionsRetType) { setListDistributionsResponseGetDistributionsAttributeType(&o.Distributions, v) } // GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListDistributionsResponse) GetNextPageIdentifier() (res ListDistributionsResponseGetNextPageIdentifierRetType) { res, _ = o.GetNextPageIdentifierOk() return @@ -110,21 +132,25 @@ func (o *ListDistributionsResponse) GetNextPageIdentifier() (res ListDistributio // GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListDistributionsResponse) GetNextPageIdentifierOk() (ret ListDistributionsResponseGetNextPageIdentifierRetType, ok bool) { return getListDistributionsResponseGetNextPageIdentifierAttributeTypeOk(o.NextPageIdentifier) } // HasNextPageIdentifier returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListDistributionsResponse) HasNextPageIdentifier() bool { _, ok := o.GetNextPageIdentifierOk() return ok } // SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListDistributionsResponse) SetNextPageIdentifier(v ListDistributionsResponseGetNextPageIdentifierRetType) { setListDistributionsResponseGetNextPageIdentifierAttributeType(&o.NextPageIdentifier, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListDistributionsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListDistributionsResponseGetDistributionsAttributeTypeOk(o.Distributions); ok { @@ -136,37 +162,45 @@ func (o ListDistributionsResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableListDistributionsResponse struct { value *ListDistributionsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListDistributionsResponse) Get() *ListDistributionsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListDistributionsResponse) Set(val *ListDistributionsResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListDistributionsResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListDistributionsResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableListDistributionsResponse(val *ListDistributionsResponse) *NullableListDistributionsResponse { return &NullableListDistributionsResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListDistributionsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListDistributionsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_list_waf_collections_response.go b/services/cdn/model_list_waf_collections_response.go index 8a8227979..6e6c9de80 100644 --- a/services/cdn/model_list_waf_collections_response.go +++ b/services/cdn/model_list_waf_collections_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListWafCollectionsResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListWafCollectionsResponseGetCollectionsAttributeType = *[]WafRuleCollection + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListWafCollectionsResponseGetCollectionsArgType = []WafRuleCollection + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListWafCollectionsResponseGetCollectionsRetType = []WafRuleCollection +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListWafCollectionsResponseGetCollectionsAttributeTypeOk(arg ListWafCollectionsResponseGetCollectionsAttributeType) (ret ListWafCollectionsResponseGetCollectionsRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getListWafCollectionsResponseGetCollectionsAttributeTypeOk(arg ListWafColle return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListWafCollectionsResponseGetCollectionsAttributeType(arg *ListWafCollectionsResponseGetCollectionsAttributeType, val ListWafCollectionsResponseGetCollectionsRetType) { *arg = &val } // ListWafCollectionsResponse struct for ListWafCollectionsResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListWafCollectionsResponse struct { // REQUIRED Collections ListWafCollectionsResponseGetCollectionsAttributeType `json:"collections" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ListWafCollectionsResponse ListWafCollectionsResponse // NewListWafCollectionsResponse instantiates a new ListWafCollectionsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewListWafCollectionsResponse(collections ListWafCollectionsResponseGetCollectionsArgType) *ListWafCollectionsResponse { this := ListWafCollectionsResponse{} setListWafCollectionsResponseGetCollectionsAttributeType(&this.Collections, collections) @@ -58,12 +69,14 @@ func NewListWafCollectionsResponse(collections ListWafCollectionsResponseGetColl // NewListWafCollectionsResponseWithDefaults instantiates a new ListWafCollectionsResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewListWafCollectionsResponseWithDefaults() *ListWafCollectionsResponse { this := ListWafCollectionsResponse{} return &this } // GetCollections returns the Collections field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListWafCollectionsResponse) GetCollections() (ret ListWafCollectionsResponseGetCollectionsRetType) { ret, _ = o.GetCollectionsOk() return ret @@ -71,15 +84,18 @@ func (o *ListWafCollectionsResponse) GetCollections() (ret ListWafCollectionsRes // GetCollectionsOk returns a tuple with the Collections field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListWafCollectionsResponse) GetCollectionsOk() (ret ListWafCollectionsResponseGetCollectionsRetType, ok bool) { return getListWafCollectionsResponseGetCollectionsAttributeTypeOk(o.Collections) } // SetCollections sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListWafCollectionsResponse) SetCollections(v ListWafCollectionsResponseGetCollectionsRetType) { setListWafCollectionsResponseGetCollectionsAttributeType(&o.Collections, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListWafCollectionsResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListWafCollectionsResponseGetCollectionsAttributeTypeOk(o.Collections); ok { @@ -88,37 +104,45 @@ func (o ListWafCollectionsResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableListWafCollectionsResponse struct { value *ListWafCollectionsResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListWafCollectionsResponse) Get() *ListWafCollectionsResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListWafCollectionsResponse) Set(val *ListWafCollectionsResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListWafCollectionsResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListWafCollectionsResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableListWafCollectionsResponse(val *ListWafCollectionsResponse) *NullableListWafCollectionsResponse { return &NullableListWafCollectionsResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListWafCollectionsResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListWafCollectionsResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_loki_log_sink.go b/services/cdn/model_loki_log_sink.go index b1bdc24aa..09378e880 100644 --- a/services/cdn/model_loki_log_sink.go +++ b/services/cdn/model_loki_log_sink.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &LokiLogSink{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkGetPushUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkGetPushUrlAttributeTypeOk(arg LokiLogSinkGetPushUrlAttributeType) (ret LokiLogSinkGetPushUrlRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getLokiLogSinkGetPushUrlAttributeTypeOk(arg LokiLogSinkGetPushUrlAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkGetPushUrlAttributeType(arg *LokiLogSinkGetPushUrlAttributeType, val LokiLogSinkGetPushUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkGetPushUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkGetPushUrlRetType = string /* @@ -43,8 +50,10 @@ type LokiLogSinkGetPushUrlRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkGetTypeAttributeTypeOk(arg LokiLogSinkGetTypeAttributeType) (ret LokiLogSinkGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getLokiLogSinkGetTypeAttributeTypeOk(arg LokiLogSinkGetTypeAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkGetTypeAttributeType(arg *LokiLogSinkGetTypeAttributeType, val LokiLogSinkGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkGetTypeRetType = string // LokiLogSink struct for LokiLogSink +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSink struct { // REQUIRED PushUrl LokiLogSinkGetPushUrlAttributeType `json:"pushUrl" required:"true"` @@ -67,12 +81,14 @@ type LokiLogSink struct { Type LokiLogSinkGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _LokiLogSink LokiLogSink // NewLokiLogSink instantiates a new LokiLogSink 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewLokiLogSink(pushUrl LokiLogSinkGetPushUrlArgType, types LokiLogSinkGetTypeArgType) *LokiLogSink { this := LokiLogSink{} setLokiLogSinkGetPushUrlAttributeType(&this.PushUrl, pushUrl) @@ -83,12 +99,14 @@ func NewLokiLogSink(pushUrl LokiLogSinkGetPushUrlArgType, types LokiLogSinkGetTy // NewLokiLogSinkWithDefaults instantiates a new LokiLogSink 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewLokiLogSinkWithDefaults() *LokiLogSink { this := LokiLogSink{} return &this } // GetPushUrl returns the PushUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSink) GetPushUrl() (ret LokiLogSinkGetPushUrlRetType) { ret, _ = o.GetPushUrlOk() return ret @@ -96,16 +114,19 @@ func (o *LokiLogSink) GetPushUrl() (ret LokiLogSinkGetPushUrlRetType) { // GetPushUrlOk returns a tuple with the PushUrl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSink) GetPushUrlOk() (ret LokiLogSinkGetPushUrlRetType, ok bool) { return getLokiLogSinkGetPushUrlAttributeTypeOk(o.PushUrl) } // SetPushUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSink) SetPushUrl(v LokiLogSinkGetPushUrlRetType) { setLokiLogSinkGetPushUrlAttributeType(&o.PushUrl, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSink) GetType() (ret LokiLogSinkGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -113,15 +134,18 @@ func (o *LokiLogSink) GetType() (ret LokiLogSinkGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSink) GetTypeOk() (ret LokiLogSinkGetTypeRetType, ok bool) { return getLokiLogSinkGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSink) SetType(v LokiLogSinkGetTypeRetType) { setLokiLogSinkGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o LokiLogSink) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getLokiLogSinkGetPushUrlAttributeTypeOk(o.PushUrl); ok { @@ -133,37 +157,45 @@ func (o LokiLogSink) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableLokiLogSink struct { value *LokiLogSink isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSink) Get() *LokiLogSink { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSink) Set(val *LokiLogSink) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSink) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSink) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableLokiLogSink(val *LokiLogSink) *NullableLokiLogSink { return &NullableLokiLogSink{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSink) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSink) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_loki_log_sink_create.go b/services/cdn/model_loki_log_sink_create.go index ea1b895fd..00fabe0ae 100644 --- a/services/cdn/model_loki_log_sink_create.go +++ b/services/cdn/model_loki_log_sink_create.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &LokiLogSinkCreate{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetCredentialsAttributeType = *LokiLogSinkCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetCredentialsArgType = LokiLogSinkCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetCredentialsRetType = LokiLogSinkCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkCreateGetCredentialsAttributeTypeOk(arg LokiLogSinkCreateGetCredentialsAttributeType) (ret LokiLogSinkCreateGetCredentialsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getLokiLogSinkCreateGetCredentialsAttributeTypeOk(arg LokiLogSinkCreateGetC return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkCreateGetCredentialsAttributeType(arg *LokiLogSinkCreateGetCredentialsAttributeType, val LokiLogSinkCreateGetCredentialsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setLokiLogSinkCreateGetCredentialsAttributeType(arg *LokiLogSinkCreateGetCr */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetPushUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkCreateGetPushUrlAttributeTypeOk(arg LokiLogSinkCreateGetPushUrlAttributeType) (ret LokiLogSinkCreateGetPushUrlRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getLokiLogSinkCreateGetPushUrlAttributeTypeOk(arg LokiLogSinkCreateGetPushU return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkCreateGetPushUrlAttributeType(arg *LokiLogSinkCreateGetPushUrlAttributeType, val LokiLogSinkCreateGetPushUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetPushUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetPushUrlRetType = string /* @@ -63,8 +77,10 @@ type LokiLogSinkCreateGetPushUrlRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkCreateGetTypeAttributeTypeOk(arg LokiLogSinkCreateGetTypeAttributeType) (ret LokiLogSinkCreateGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getLokiLogSinkCreateGetTypeAttributeTypeOk(arg LokiLogSinkCreateGetTypeAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkCreateGetTypeAttributeType(arg *LokiLogSinkCreateGetTypeAttributeType, val LokiLogSinkCreateGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreateGetTypeRetType = string // LokiLogSinkCreate struct for LokiLogSinkCreate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCreate struct { // REQUIRED Credentials LokiLogSinkCreateGetCredentialsAttributeType `json:"credentials" required:"true"` @@ -89,12 +110,14 @@ type LokiLogSinkCreate struct { Type LokiLogSinkCreateGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _LokiLogSinkCreate LokiLogSinkCreate // NewLokiLogSinkCreate instantiates a new LokiLogSinkCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewLokiLogSinkCreate(credentials LokiLogSinkCreateGetCredentialsArgType, pushUrl LokiLogSinkCreateGetPushUrlArgType, types LokiLogSinkCreateGetTypeArgType) *LokiLogSinkCreate { this := LokiLogSinkCreate{} setLokiLogSinkCreateGetCredentialsAttributeType(&this.Credentials, credentials) @@ -106,12 +129,14 @@ func NewLokiLogSinkCreate(credentials LokiLogSinkCreateGetCredentialsArgType, pu // NewLokiLogSinkCreateWithDefaults instantiates a new LokiLogSinkCreate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewLokiLogSinkCreateWithDefaults() *LokiLogSinkCreate { this := LokiLogSinkCreate{} return &this } // GetCredentials returns the Credentials field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) GetCredentials() (ret LokiLogSinkCreateGetCredentialsRetType) { ret, _ = o.GetCredentialsOk() return ret @@ -119,16 +144,19 @@ func (o *LokiLogSinkCreate) GetCredentials() (ret LokiLogSinkCreateGetCredential // GetCredentialsOk returns a tuple with the Credentials field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) GetCredentialsOk() (ret LokiLogSinkCreateGetCredentialsRetType, ok bool) { return getLokiLogSinkCreateGetCredentialsAttributeTypeOk(o.Credentials) } // SetCredentials sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) SetCredentials(v LokiLogSinkCreateGetCredentialsRetType) { setLokiLogSinkCreateGetCredentialsAttributeType(&o.Credentials, v) } // GetPushUrl returns the PushUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) GetPushUrl() (ret LokiLogSinkCreateGetPushUrlRetType) { ret, _ = o.GetPushUrlOk() return ret @@ -136,16 +164,19 @@ func (o *LokiLogSinkCreate) GetPushUrl() (ret LokiLogSinkCreateGetPushUrlRetType // GetPushUrlOk returns a tuple with the PushUrl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) GetPushUrlOk() (ret LokiLogSinkCreateGetPushUrlRetType, ok bool) { return getLokiLogSinkCreateGetPushUrlAttributeTypeOk(o.PushUrl) } // SetPushUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) SetPushUrl(v LokiLogSinkCreateGetPushUrlRetType) { setLokiLogSinkCreateGetPushUrlAttributeType(&o.PushUrl, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) GetType() (ret LokiLogSinkCreateGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -153,15 +184,18 @@ func (o *LokiLogSinkCreate) GetType() (ret LokiLogSinkCreateGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) GetTypeOk() (ret LokiLogSinkCreateGetTypeRetType, ok bool) { return getLokiLogSinkCreateGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCreate) SetType(v LokiLogSinkCreateGetTypeRetType) { setLokiLogSinkCreateGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o LokiLogSinkCreate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getLokiLogSinkCreateGetCredentialsAttributeTypeOk(o.Credentials); ok { @@ -176,37 +210,45 @@ func (o LokiLogSinkCreate) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableLokiLogSinkCreate struct { value *LokiLogSinkCreate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkCreate) Get() *LokiLogSinkCreate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkCreate) Set(val *LokiLogSinkCreate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkCreate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkCreate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableLokiLogSinkCreate(val *LokiLogSinkCreate) *NullableLokiLogSinkCreate { return &NullableLokiLogSinkCreate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkCreate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkCreate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_loki_log_sink_credentials.go b/services/cdn/model_loki_log_sink_credentials.go index 530f8c2d6..07d4721ab 100644 --- a/services/cdn/model_loki_log_sink_credentials.go +++ b/services/cdn/model_loki_log_sink_credentials.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &LokiLogSinkCredentials{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentialsGetPasswordAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkCredentialsGetPasswordAttributeTypeOk(arg LokiLogSinkCredentialsGetPasswordAttributeType) (ret LokiLogSinkCredentialsGetPasswordRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getLokiLogSinkCredentialsGetPasswordAttributeTypeOk(arg LokiLogSinkCredenti return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkCredentialsGetPasswordAttributeType(arg *LokiLogSinkCredentialsGetPasswordAttributeType, val LokiLogSinkCredentialsGetPasswordRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentialsGetPasswordArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentialsGetPasswordRetType = string /* @@ -43,8 +50,10 @@ type LokiLogSinkCredentialsGetPasswordRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentialsGetUsernameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkCredentialsGetUsernameAttributeTypeOk(arg LokiLogSinkCredentialsGetUsernameAttributeType) (ret LokiLogSinkCredentialsGetUsernameRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getLokiLogSinkCredentialsGetUsernameAttributeTypeOk(arg LokiLogSinkCredenti return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkCredentialsGetUsernameAttributeType(arg *LokiLogSinkCredentialsGetUsernameAttributeType, val LokiLogSinkCredentialsGetUsernameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentialsGetUsernameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentialsGetUsernameRetType = string // LokiLogSinkCredentials struct for LokiLogSinkCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkCredentials struct { // REQUIRED Password LokiLogSinkCredentialsGetPasswordAttributeType `json:"password" required:"true"` @@ -67,12 +81,14 @@ type LokiLogSinkCredentials struct { Username LokiLogSinkCredentialsGetUsernameAttributeType `json:"username" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _LokiLogSinkCredentials LokiLogSinkCredentials // NewLokiLogSinkCredentials instantiates a new LokiLogSinkCredentials 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewLokiLogSinkCredentials(password LokiLogSinkCredentialsGetPasswordArgType, username LokiLogSinkCredentialsGetUsernameArgType) *LokiLogSinkCredentials { this := LokiLogSinkCredentials{} setLokiLogSinkCredentialsGetPasswordAttributeType(&this.Password, password) @@ -83,12 +99,14 @@ func NewLokiLogSinkCredentials(password LokiLogSinkCredentialsGetPasswordArgType // NewLokiLogSinkCredentialsWithDefaults instantiates a new LokiLogSinkCredentials 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewLokiLogSinkCredentialsWithDefaults() *LokiLogSinkCredentials { this := LokiLogSinkCredentials{} return &this } // GetPassword returns the Password field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCredentials) GetPassword() (ret LokiLogSinkCredentialsGetPasswordRetType) { ret, _ = o.GetPasswordOk() return ret @@ -96,16 +114,19 @@ func (o *LokiLogSinkCredentials) GetPassword() (ret LokiLogSinkCredentialsGetPas // GetPasswordOk returns a tuple with the Password field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCredentials) GetPasswordOk() (ret LokiLogSinkCredentialsGetPasswordRetType, ok bool) { return getLokiLogSinkCredentialsGetPasswordAttributeTypeOk(o.Password) } // SetPassword sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCredentials) SetPassword(v LokiLogSinkCredentialsGetPasswordRetType) { setLokiLogSinkCredentialsGetPasswordAttributeType(&o.Password, v) } // GetUsername returns the Username field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCredentials) GetUsername() (ret LokiLogSinkCredentialsGetUsernameRetType) { ret, _ = o.GetUsernameOk() return ret @@ -113,15 +134,18 @@ func (o *LokiLogSinkCredentials) GetUsername() (ret LokiLogSinkCredentialsGetUse // GetUsernameOk returns a tuple with the Username field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCredentials) GetUsernameOk() (ret LokiLogSinkCredentialsGetUsernameRetType, ok bool) { return getLokiLogSinkCredentialsGetUsernameAttributeTypeOk(o.Username) } // SetUsername sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkCredentials) SetUsername(v LokiLogSinkCredentialsGetUsernameRetType) { setLokiLogSinkCredentialsGetUsernameAttributeType(&o.Username, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o LokiLogSinkCredentials) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getLokiLogSinkCredentialsGetPasswordAttributeTypeOk(o.Password); ok { @@ -133,37 +157,45 @@ func (o LokiLogSinkCredentials) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableLokiLogSinkCredentials struct { value *LokiLogSinkCredentials isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkCredentials) Get() *LokiLogSinkCredentials { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkCredentials) Set(val *LokiLogSinkCredentials) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkCredentials) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkCredentials) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableLokiLogSinkCredentials(val *LokiLogSinkCredentials) *NullableLokiLogSinkCredentials { return &NullableLokiLogSinkCredentials{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkCredentials) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkCredentials) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_loki_log_sink_patch.go b/services/cdn/model_loki_log_sink_patch.go index 7d6d241a9..399a52411 100644 --- a/services/cdn/model_loki_log_sink_patch.go +++ b/services/cdn/model_loki_log_sink_patch.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &LokiLogSinkPatch{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetCredentialsAttributeType = *LokiLogSinkCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetCredentialsArgType = LokiLogSinkCredentials + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetCredentialsRetType = LokiLogSinkCredentials +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkPatchGetCredentialsAttributeTypeOk(arg LokiLogSinkPatchGetCredentialsAttributeType) (ret LokiLogSinkPatchGetCredentialsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getLokiLogSinkPatchGetCredentialsAttributeTypeOk(arg LokiLogSinkPatchGetCre return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkPatchGetCredentialsAttributeType(arg *LokiLogSinkPatchGetCredentialsAttributeType, val LokiLogSinkPatchGetCredentialsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setLokiLogSinkPatchGetCredentialsAttributeType(arg *LokiLogSinkPatchGetCred */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetPushUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkPatchGetPushUrlAttributeTypeOk(arg LokiLogSinkPatchGetPushUrlAttributeType) (ret LokiLogSinkPatchGetPushUrlRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getLokiLogSinkPatchGetPushUrlAttributeTypeOk(arg LokiLogSinkPatchGetPushUrl return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkPatchGetPushUrlAttributeType(arg *LokiLogSinkPatchGetPushUrlAttributeType, val LokiLogSinkPatchGetPushUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetPushUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetPushUrlRetType = string /* @@ -63,8 +77,10 @@ type LokiLogSinkPatchGetPushUrlRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getLokiLogSinkPatchGetTypeAttributeTypeOk(arg LokiLogSinkPatchGetTypeAttributeType) (ret LokiLogSinkPatchGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getLokiLogSinkPatchGetTypeAttributeTypeOk(arg LokiLogSinkPatchGetTypeAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setLokiLogSinkPatchGetTypeAttributeType(arg *LokiLogSinkPatchGetTypeAttributeType, val LokiLogSinkPatchGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatchGetTypeRetType = string // LokiLogSinkPatch struct for LokiLogSinkPatch +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type LokiLogSinkPatch struct { Credentials LokiLogSinkPatchGetCredentialsAttributeType `json:"credentials,omitempty"` PushUrl LokiLogSinkPatchGetPushUrlAttributeType `json:"pushUrl,omitempty"` @@ -87,12 +108,14 @@ type LokiLogSinkPatch struct { Type LokiLogSinkPatchGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _LokiLogSinkPatch LokiLogSinkPatch // NewLokiLogSinkPatch instantiates a new LokiLogSinkPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewLokiLogSinkPatch(types LokiLogSinkPatchGetTypeArgType) *LokiLogSinkPatch { this := LokiLogSinkPatch{} setLokiLogSinkPatchGetTypeAttributeType(&this.Type, types) @@ -102,12 +125,14 @@ func NewLokiLogSinkPatch(types LokiLogSinkPatchGetTypeArgType) *LokiLogSinkPatch // NewLokiLogSinkPatchWithDefaults instantiates a new LokiLogSinkPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewLokiLogSinkPatchWithDefaults() *LokiLogSinkPatch { this := LokiLogSinkPatch{} return &this } // GetCredentials returns the Credentials field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) GetCredentials() (res LokiLogSinkPatchGetCredentialsRetType) { res, _ = o.GetCredentialsOk() return @@ -115,22 +140,26 @@ func (o *LokiLogSinkPatch) GetCredentials() (res LokiLogSinkPatchGetCredentialsR // GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) GetCredentialsOk() (ret LokiLogSinkPatchGetCredentialsRetType, ok bool) { return getLokiLogSinkPatchGetCredentialsAttributeTypeOk(o.Credentials) } // HasCredentials returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) HasCredentials() bool { _, ok := o.GetCredentialsOk() return ok } // SetCredentials gets a reference to the given LokiLogSinkCredentials and assigns it to the Credentials field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) SetCredentials(v LokiLogSinkPatchGetCredentialsRetType) { setLokiLogSinkPatchGetCredentialsAttributeType(&o.Credentials, v) } // GetPushUrl returns the PushUrl field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) GetPushUrl() (res LokiLogSinkPatchGetPushUrlRetType) { res, _ = o.GetPushUrlOk() return @@ -138,22 +167,26 @@ func (o *LokiLogSinkPatch) GetPushUrl() (res LokiLogSinkPatchGetPushUrlRetType) // GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) GetPushUrlOk() (ret LokiLogSinkPatchGetPushUrlRetType, ok bool) { return getLokiLogSinkPatchGetPushUrlAttributeTypeOk(o.PushUrl) } // HasPushUrl returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) HasPushUrl() bool { _, ok := o.GetPushUrlOk() return ok } // SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) SetPushUrl(v LokiLogSinkPatchGetPushUrlRetType) { setLokiLogSinkPatchGetPushUrlAttributeType(&o.PushUrl, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) GetType() (ret LokiLogSinkPatchGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -161,15 +194,18 @@ func (o *LokiLogSinkPatch) GetType() (ret LokiLogSinkPatchGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) GetTypeOk() (ret LokiLogSinkPatchGetTypeRetType, ok bool) { return getLokiLogSinkPatchGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *LokiLogSinkPatch) SetType(v LokiLogSinkPatchGetTypeRetType) { setLokiLogSinkPatchGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o LokiLogSinkPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getLokiLogSinkPatchGetCredentialsAttributeTypeOk(o.Credentials); ok { @@ -184,37 +220,45 @@ func (o LokiLogSinkPatch) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableLokiLogSinkPatch struct { value *LokiLogSinkPatch isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkPatch) Get() *LokiLogSinkPatch { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkPatch) Set(val *LokiLogSinkPatch) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkPatch) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkPatch) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableLokiLogSinkPatch(val *LokiLogSinkPatch) *NullableLokiLogSinkPatch { return &NullableLokiLogSinkPatch{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableLokiLogSinkPatch) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableLokiLogSinkPatch) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_match_condition.go b/services/cdn/model_match_condition.go index b7f5bad43..245055b68 100644 --- a/services/cdn/model_match_condition.go +++ b/services/cdn/model_match_condition.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,22 +17,28 @@ import ( ) // MatchCondition Defines how multiple matchers within this rule are combined (ALL, ANY, NONE). Defaults to ANY. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MatchCondition string // List of MatchCondition const ( - MATCHCONDITION_ANY MatchCondition = "ANY" - MATCHCONDITION_ALL MatchCondition = "ALL" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + MATCHCONDITION_ANY MatchCondition = "ANY" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + MATCHCONDITION_ALL MatchCondition = "ALL" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead MATCHCONDITION_NONE MatchCondition = "NONE" ) // All allowed values of MatchCondition enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedMatchConditionEnumValues = []MatchCondition{ "ANY", "ALL", "NONE", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *MatchCondition) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -56,6 +63,7 @@ func (v *MatchCondition) UnmarshalJSON(src []byte) error { // NewMatchConditionFromValue returns a pointer to a valid MatchCondition // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewMatchConditionFromValue(v string) (*MatchCondition, error) { ev := MatchCondition(v) if ev.IsValid() { @@ -66,6 +74,7 @@ func NewMatchConditionFromValue(v string) (*MatchCondition, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v MatchCondition) IsValid() bool { for _, existing := range AllowedMatchConditionEnumValues { if existing == v { @@ -76,41 +85,50 @@ func (v MatchCondition) IsValid() bool { } // Ptr returns reference to MatchCondition value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v MatchCondition) Ptr() *MatchCondition { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableMatchCondition struct { value *MatchCondition isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMatchCondition) Get() *MatchCondition { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMatchCondition) Set(val *MatchCondition) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMatchCondition) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMatchCondition) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableMatchCondition(val *MatchCondition) *NullableMatchCondition { return &NullableMatchCondition{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMatchCondition) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMatchCondition) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_matcher.go b/services/cdn/model_matcher.go index 88a5ca989..ae6a0c81d 100644 --- a/services/cdn/model_matcher.go +++ b/services/cdn/model_matcher.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Matcher{} */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MatcherGetValueMatchConditionAttributeType = *MatchCondition + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MatcherGetValueMatchConditionArgType = MatchCondition + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MatcherGetValueMatchConditionRetType = MatchCondition +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMatcherGetValueMatchConditionAttributeTypeOk(arg MatcherGetValueMatchConditionAttributeType) (ret MatcherGetValueMatchConditionRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getMatcherGetValueMatchConditionAttributeTypeOk(arg MatcherGetValueMatchCon return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMatcherGetValueMatchConditionAttributeType(arg *MatcherGetValueMatchConditionAttributeType, val MatcherGetValueMatchConditionRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setMatcherGetValueMatchConditionAttributeType(arg *MatcherGetValueMatchCond */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MatcherGetValuesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MatcherGetValuesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MatcherGetValuesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMatcherGetValuesAttributeTypeOk(arg MatcherGetValuesAttributeType) (ret MatcherGetValuesRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getMatcherGetValuesAttributeTypeOk(arg MatcherGetValuesAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMatcherGetValuesAttributeType(arg *MatcherGetValuesAttributeType, val MatcherGetValuesRetType) { *arg = &val } // Matcher A matcher containing a list of string values to compare against the request path. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Matcher struct { ValueMatchCondition MatcherGetValueMatchConditionAttributeType `json:"valueMatchCondition,omitempty"` // A list of glob patterns to match against the request path. At least one value is required. Examples: \"/shop/_*\" or \"*_/img/_*\" @@ -65,12 +81,14 @@ type Matcher struct { Values MatcherGetValuesAttributeType `json:"values" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Matcher Matcher // NewMatcher instantiates a new Matcher 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewMatcher(values MatcherGetValuesArgType) *Matcher { this := Matcher{} setMatcherGetValuesAttributeType(&this.Values, values) @@ -80,6 +98,7 @@ func NewMatcher(values MatcherGetValuesArgType) *Matcher { // NewMatcherWithDefaults instantiates a new Matcher 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewMatcherWithDefaults() *Matcher { this := Matcher{} var valueMatchCondition MatchCondition = MATCHCONDITION_ANY @@ -88,6 +107,7 @@ func NewMatcherWithDefaults() *Matcher { } // GetValueMatchCondition returns the ValueMatchCondition field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Matcher) GetValueMatchCondition() (res MatcherGetValueMatchConditionRetType) { res, _ = o.GetValueMatchConditionOk() return @@ -95,22 +115,26 @@ func (o *Matcher) GetValueMatchCondition() (res MatcherGetValueMatchConditionRet // GetValueMatchConditionOk returns a tuple with the ValueMatchCondition field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Matcher) GetValueMatchConditionOk() (ret MatcherGetValueMatchConditionRetType, ok bool) { return getMatcherGetValueMatchConditionAttributeTypeOk(o.ValueMatchCondition) } // HasValueMatchCondition returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Matcher) HasValueMatchCondition() bool { _, ok := o.GetValueMatchConditionOk() return ok } // SetValueMatchCondition gets a reference to the given MatchCondition and assigns it to the ValueMatchCondition field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Matcher) SetValueMatchCondition(v MatcherGetValueMatchConditionRetType) { setMatcherGetValueMatchConditionAttributeType(&o.ValueMatchCondition, v) } // GetValues returns the Values field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Matcher) GetValues() (ret MatcherGetValuesRetType) { ret, _ = o.GetValuesOk() return ret @@ -118,15 +142,18 @@ func (o *Matcher) GetValues() (ret MatcherGetValuesRetType) { // GetValuesOk returns a tuple with the Values field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Matcher) GetValuesOk() (ret MatcherGetValuesRetType, ok bool) { return getMatcherGetValuesAttributeTypeOk(o.Values) } // SetValues sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Matcher) SetValues(v MatcherGetValuesRetType) { setMatcherGetValuesAttributeType(&o.Values, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Matcher) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getMatcherGetValueMatchConditionAttributeTypeOk(o.ValueMatchCondition); ok { @@ -138,37 +165,45 @@ func (o Matcher) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableMatcher struct { value *Matcher isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMatcher) Get() *Matcher { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMatcher) Set(val *Matcher) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMatcher) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMatcher) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableMatcher(val *Matcher) *NullableMatcher { return &NullableMatcher{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMatcher) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMatcher) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_optimizer.go b/services/cdn/model_optimizer.go index 667f2158e..8c6ddb814 100644 --- a/services/cdn/model_optimizer.go +++ b/services/cdn/model_optimizer.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Optimizer{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type OptimizergetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type OptimizergetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type OptimizergetEnabledRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getOptimizergetEnabledAttributeTypeOk(arg OptimizergetEnabledAttributeType) (ret OptimizergetEnabledRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getOptimizergetEnabledAttributeTypeOk(arg OptimizergetEnabledAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setOptimizergetEnabledAttributeType(arg *OptimizergetEnabledAttributeType, val OptimizergetEnabledRetType) { *arg = &val } // Optimizer Optimizer is paid feature, a real-time on the fly image manipulation and optimization service that automatically optimizes your images for faster image delivery. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Optimizer struct { // Determines if the optimizer should be enabled for this distribution and incurs a monthly fee // REQUIRED Enabled OptimizergetEnabledAttributeType `json:"enabled" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Optimizer Optimizer // NewOptimizer instantiates a new Optimizer 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewOptimizer(enabled OptimizergetEnabledArgType) *Optimizer { this := Optimizer{} setOptimizergetEnabledAttributeType(&this.Enabled, enabled) @@ -59,12 +70,14 @@ func NewOptimizer(enabled OptimizergetEnabledArgType) *Optimizer { // NewOptimizerWithDefaults instantiates a new Optimizer 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewOptimizerWithDefaults() *Optimizer { this := Optimizer{} return &this } // GetEnabled returns the Enabled field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Optimizer) GetEnabled() (ret OptimizergetEnabledRetType) { ret, _ = o.GetEnabledOk() return ret @@ -72,15 +85,18 @@ func (o *Optimizer) GetEnabled() (ret OptimizergetEnabledRetType) { // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Optimizer) GetEnabledOk() (ret OptimizergetEnabledRetType, ok bool) { return getOptimizergetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Optimizer) SetEnabled(v OptimizergetEnabledRetType) { setOptimizergetEnabledAttributeType(&o.Enabled, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Optimizer) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getOptimizergetEnabledAttributeTypeOk(o.Enabled); ok { @@ -89,37 +105,45 @@ func (o Optimizer) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableOptimizer struct { value *Optimizer isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableOptimizer) Get() *Optimizer { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableOptimizer) Set(val *Optimizer) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableOptimizer) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableOptimizer) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableOptimizer(val *Optimizer) *NullableOptimizer { return &NullableOptimizer{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableOptimizer) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableOptimizer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_optimizer_patch.go b/services/cdn/model_optimizer_patch.go index b5759d959..bbb6db904 100644 --- a/services/cdn/model_optimizer_patch.go +++ b/services/cdn/model_optimizer_patch.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &OptimizerPatch{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type OptimizerPatchgetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type OptimizerPatchgetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type OptimizerPatchgetEnabledRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getOptimizerPatchgetEnabledAttributeTypeOk(arg OptimizerPatchgetEnabledAttributeType) (ret OptimizerPatchgetEnabledRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getOptimizerPatchgetEnabledAttributeTypeOk(arg OptimizerPatchgetEnabledAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setOptimizerPatchgetEnabledAttributeType(arg *OptimizerPatchgetEnabledAttributeType, val OptimizerPatchgetEnabledRetType) { *arg = &val } // OptimizerPatch struct for OptimizerPatch +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type OptimizerPatch struct { Enabled OptimizerPatchgetEnabledAttributeType `json:"enabled,omitempty"` } @@ -46,6 +55,7 @@ type OptimizerPatch struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewOptimizerPatch() *OptimizerPatch { this := OptimizerPatch{} return &this @@ -54,12 +64,14 @@ func NewOptimizerPatch() *OptimizerPatch { // NewOptimizerPatchWithDefaults instantiates a new OptimizerPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewOptimizerPatchWithDefaults() *OptimizerPatch { this := OptimizerPatch{} return &this } // GetEnabled returns the Enabled field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *OptimizerPatch) GetEnabled() (res OptimizerPatchgetEnabledRetType) { res, _ = o.GetEnabledOk() return @@ -67,21 +79,25 @@ func (o *OptimizerPatch) GetEnabled() (res OptimizerPatchgetEnabledRetType) { // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *OptimizerPatch) GetEnabledOk() (ret OptimizerPatchgetEnabledRetType, ok bool) { return getOptimizerPatchgetEnabledAttributeTypeOk(o.Enabled) } // HasEnabled returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *OptimizerPatch) HasEnabled() bool { _, ok := o.GetEnabledOk() return ok } // SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *OptimizerPatch) SetEnabled(v OptimizerPatchgetEnabledRetType) { setOptimizerPatchgetEnabledAttributeType(&o.Enabled, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o OptimizerPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getOptimizerPatchgetEnabledAttributeTypeOk(o.Enabled); ok { @@ -90,37 +106,45 @@ func (o OptimizerPatch) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableOptimizerPatch struct { value *OptimizerPatch isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableOptimizerPatch) Get() *OptimizerPatch { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableOptimizerPatch) Set(val *OptimizerPatch) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableOptimizerPatch) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableOptimizerPatch) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableOptimizerPatch(val *OptimizerPatch) *NullableOptimizerPatch { return &NullableOptimizerPatch{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableOptimizerPatch) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableOptimizerPatch) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_patch_distribution_payload.go b/services/cdn/model_patch_distribution_payload.go index 143d9cc03..7a5da9c17 100644 --- a/services/cdn/model_patch_distribution_payload.go +++ b/services/cdn/model_patch_distribution_payload.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PatchDistributionPayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionPayloadGetConfigAttributeType = *ConfigPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionPayloadGetConfigArgType = ConfigPatch + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionPayloadGetConfigRetType = ConfigPatch +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPatchDistributionPayloadGetConfigAttributeTypeOk(arg PatchDistributionPayloadGetConfigAttributeType) (ret PatchDistributionPayloadGetConfigRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getPatchDistributionPayloadGetConfigAttributeTypeOk(arg PatchDistributionPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPatchDistributionPayloadGetConfigAttributeType(arg *PatchDistributionPayloadGetConfigAttributeType, val PatchDistributionPayloadGetConfigRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setPatchDistributionPayloadGetConfigAttributeType(arg *PatchDistributionPay */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionPayloadGetIntentIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPatchDistributionPayloadGetIntentIdAttributeTypeOk(arg PatchDistributionPayloadGetIntentIdAttributeType) (ret PatchDistributionPayloadGetIntentIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getPatchDistributionPayloadGetIntentIdAttributeTypeOk(arg PatchDistribution return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPatchDistributionPayloadGetIntentIdAttributeType(arg *PatchDistributionPayloadGetIntentIdAttributeType, val PatchDistributionPayloadGetIntentIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionPayloadGetIntentIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionPayloadGetIntentIdRetType = string // PatchDistributionPayload Defines a partial distribution. Set values +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionPayload struct { Config PatchDistributionPayloadGetConfigAttributeType `json:"config,omitempty"` // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. @@ -69,6 +84,7 @@ type PatchDistributionPayload struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPatchDistributionPayload() *PatchDistributionPayload { this := PatchDistributionPayload{} return &this @@ -77,12 +93,14 @@ func NewPatchDistributionPayload() *PatchDistributionPayload { // NewPatchDistributionPayloadWithDefaults instantiates a new PatchDistributionPayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPatchDistributionPayloadWithDefaults() *PatchDistributionPayload { this := PatchDistributionPayload{} return &this } // GetConfig returns the Config field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionPayload) GetConfig() (res PatchDistributionPayloadGetConfigRetType) { res, _ = o.GetConfigOk() return @@ -90,22 +108,26 @@ func (o *PatchDistributionPayload) GetConfig() (res PatchDistributionPayloadGetC // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionPayload) GetConfigOk() (ret PatchDistributionPayloadGetConfigRetType, ok bool) { return getPatchDistributionPayloadGetConfigAttributeTypeOk(o.Config) } // HasConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionPayload) HasConfig() bool { _, ok := o.GetConfigOk() return ok } // SetConfig gets a reference to the given ConfigPatch and assigns it to the Config field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionPayload) SetConfig(v PatchDistributionPayloadGetConfigRetType) { setPatchDistributionPayloadGetConfigAttributeType(&o.Config, v) } // GetIntentId returns the IntentId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionPayload) GetIntentId() (res PatchDistributionPayloadGetIntentIdRetType) { res, _ = o.GetIntentIdOk() return @@ -113,21 +135,25 @@ func (o *PatchDistributionPayload) GetIntentId() (res PatchDistributionPayloadGe // GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionPayload) GetIntentIdOk() (ret PatchDistributionPayloadGetIntentIdRetType, ok bool) { return getPatchDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId) } // HasIntentId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionPayload) HasIntentId() bool { _, ok := o.GetIntentIdOk() return ok } // SetIntentId gets a reference to the given string and assigns it to the IntentId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionPayload) SetIntentId(v PatchDistributionPayloadGetIntentIdRetType) { setPatchDistributionPayloadGetIntentIdAttributeType(&o.IntentId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PatchDistributionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPatchDistributionPayloadGetConfigAttributeTypeOk(o.Config); ok { @@ -139,37 +165,45 @@ func (o PatchDistributionPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePatchDistributionPayload struct { value *PatchDistributionPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchDistributionPayload) Get() *PatchDistributionPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchDistributionPayload) Set(val *PatchDistributionPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchDistributionPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchDistributionPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePatchDistributionPayload(val *PatchDistributionPayload) *NullablePatchDistributionPayload { return &NullablePatchDistributionPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchDistributionPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchDistributionPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_patch_distribution_response.go b/services/cdn/model_patch_distribution_response.go index 6628343bb..0c290e35e 100644 --- a/services/cdn/model_patch_distribution_response.go +++ b/services/cdn/model_patch_distribution_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PatchDistributionResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionResponseGetDistributionAttributeType = *Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionResponseGetDistributionArgType = Distribution + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionResponseGetDistributionRetType = Distribution +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPatchDistributionResponseGetDistributionAttributeTypeOk(arg PatchDistributionResponseGetDistributionAttributeType) (ret PatchDistributionResponseGetDistributionRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getPatchDistributionResponseGetDistributionAttributeTypeOk(arg PatchDistrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPatchDistributionResponseGetDistributionAttributeType(arg *PatchDistributionResponseGetDistributionAttributeType, val PatchDistributionResponseGetDistributionRetType) { *arg = &val } // PatchDistributionResponse struct for PatchDistributionResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchDistributionResponse struct { // REQUIRED Distribution PatchDistributionResponseGetDistributionAttributeType `json:"distribution" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PatchDistributionResponse PatchDistributionResponse // NewPatchDistributionResponse instantiates a new PatchDistributionResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPatchDistributionResponse(distribution PatchDistributionResponseGetDistributionArgType) *PatchDistributionResponse { this := PatchDistributionResponse{} setPatchDistributionResponseGetDistributionAttributeType(&this.Distribution, distribution) @@ -58,12 +69,14 @@ func NewPatchDistributionResponse(distribution PatchDistributionResponseGetDistr // NewPatchDistributionResponseWithDefaults instantiates a new PatchDistributionResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPatchDistributionResponseWithDefaults() *PatchDistributionResponse { this := PatchDistributionResponse{} return &this } // GetDistribution returns the Distribution field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionResponse) GetDistribution() (ret PatchDistributionResponseGetDistributionRetType) { ret, _ = o.GetDistributionOk() return ret @@ -71,15 +84,18 @@ func (o *PatchDistributionResponse) GetDistribution() (ret PatchDistributionResp // GetDistributionOk returns a tuple with the Distribution field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionResponse) GetDistributionOk() (ret PatchDistributionResponseGetDistributionRetType, ok bool) { return getPatchDistributionResponseGetDistributionAttributeTypeOk(o.Distribution) } // SetDistribution sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchDistributionResponse) SetDistribution(v PatchDistributionResponseGetDistributionRetType) { setPatchDistributionResponseGetDistributionAttributeType(&o.Distribution, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PatchDistributionResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPatchDistributionResponseGetDistributionAttributeTypeOk(o.Distribution); ok { @@ -88,37 +104,45 @@ func (o PatchDistributionResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePatchDistributionResponse struct { value *PatchDistributionResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchDistributionResponse) Get() *PatchDistributionResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchDistributionResponse) Set(val *PatchDistributionResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchDistributionResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchDistributionResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePatchDistributionResponse(val *PatchDistributionResponse) *NullablePatchDistributionResponse { return &NullablePatchDistributionResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchDistributionResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchDistributionResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_purge_cache_payload.go b/services/cdn/model_purge_cache_payload.go index 162011f2f..5fcfb4cab 100644 --- a/services/cdn/model_purge_cache_payload.go +++ b/services/cdn/model_purge_cache_payload.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &PurgeCachePayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PurgeCachePayloadGetPathAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPurgeCachePayloadGetPathAttributeTypeOk(arg PurgeCachePayloadGetPathAttributeType) (ret PurgeCachePayloadGetPathRetType, ok bool) { if arg == nil { return ret, false @@ -31,14 +34,19 @@ func getPurgeCachePayloadGetPathAttributeTypeOk(arg PurgeCachePayloadGetPathAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPurgeCachePayloadGetPathAttributeType(arg *PurgeCachePayloadGetPathAttributeType, val PurgeCachePayloadGetPathRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PurgeCachePayloadGetPathArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PurgeCachePayloadGetPathRetType = string // PurgeCachePayload struct for PurgeCachePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PurgeCachePayload struct { // Defines an optional path. If this is set, a granular purge is done. If missing, the entire cache is invalidated. During a granular cache purge, only the provided path is purged. Please do not that for example `/some/path` and `/some/path.txt` are considered different paths. Path PurgeCachePayloadGetPathAttributeType `json:"path,omitempty"` @@ -48,6 +56,7 @@ type PurgeCachePayload struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPurgeCachePayload() *PurgeCachePayload { this := PurgeCachePayload{} return &this @@ -56,12 +65,14 @@ func NewPurgeCachePayload() *PurgeCachePayload { // NewPurgeCachePayloadWithDefaults instantiates a new PurgeCachePayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPurgeCachePayloadWithDefaults() *PurgeCachePayload { this := PurgeCachePayload{} return &this } // GetPath returns the Path field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PurgeCachePayload) GetPath() (res PurgeCachePayloadGetPathRetType) { res, _ = o.GetPathOk() return @@ -69,21 +80,25 @@ func (o *PurgeCachePayload) GetPath() (res PurgeCachePayloadGetPathRetType) { // GetPathOk returns a tuple with the Path field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PurgeCachePayload) GetPathOk() (ret PurgeCachePayloadGetPathRetType, ok bool) { return getPurgeCachePayloadGetPathAttributeTypeOk(o.Path) } // HasPath returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PurgeCachePayload) HasPath() bool { _, ok := o.GetPathOk() return ok } // SetPath gets a reference to the given string and assigns it to the Path field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PurgeCachePayload) SetPath(v PurgeCachePayloadGetPathRetType) { setPurgeCachePayloadGetPathAttributeType(&o.Path, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PurgeCachePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPurgeCachePayloadGetPathAttributeTypeOk(o.Path); ok { @@ -92,37 +107,45 @@ func (o PurgeCachePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePurgeCachePayload struct { value *PurgeCachePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePurgeCachePayload) Get() *PurgeCachePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePurgeCachePayload) Set(val *PurgeCachePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePurgeCachePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePurgeCachePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePurgeCachePayload(val *PurgeCachePayload) *NullablePurgeCachePayload { return &NullablePurgeCachePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePurgeCachePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePurgeCachePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_put_custom_domain_custom_certificate.go b/services/cdn/model_put_custom_domain_custom_certificate.go index ac32b774a..1fecfd5e0 100644 --- a/services/cdn/model_put_custom_domain_custom_certificate.go +++ b/services/cdn/model_put_custom_domain_custom_certificate.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &PutCustomDomainCustomCertificate{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetCertificateAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPutCustomDomainCustomCertificateGetCertificateAttributeTypeOk(arg PutCustomDomainCustomCertificateGetCertificateAttributeType) (ret PutCustomDomainCustomCertificateGetCertificateRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getPutCustomDomainCustomCertificateGetCertificateAttributeTypeOk(arg PutCus return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPutCustomDomainCustomCertificateGetCertificateAttributeType(arg *PutCustomDomainCustomCertificateGetCertificateAttributeType, val PutCustomDomainCustomCertificateGetCertificateRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetCertificateArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetCertificateRetType = string /* @@ -43,8 +50,10 @@ type PutCustomDomainCustomCertificateGetCertificateRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetKeyAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPutCustomDomainCustomCertificateGetKeyAttributeTypeOk(arg PutCustomDomainCustomCertificateGetKeyAttributeType) (ret PutCustomDomainCustomCertificateGetKeyRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getPutCustomDomainCustomCertificateGetKeyAttributeTypeOk(arg PutCustomDomai return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPutCustomDomainCustomCertificateGetKeyAttributeType(arg *PutCustomDomainCustomCertificateGetKeyAttributeType, val PutCustomDomainCustomCertificateGetKeyRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetKeyArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetKeyRetType = string /* @@ -64,8 +77,10 @@ type PutCustomDomainCustomCertificateGetKeyRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPutCustomDomainCustomCertificateGetTypeAttributeTypeOk(arg PutCustomDomainCustomCertificateGetTypeAttributeType) (ret PutCustomDomainCustomCertificateGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -73,14 +88,19 @@ func getPutCustomDomainCustomCertificateGetTypeAttributeTypeOk(arg PutCustomDoma return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPutCustomDomainCustomCertificateGetTypeAttributeType(arg *PutCustomDomainCustomCertificateGetTypeAttributeType, val PutCustomDomainCustomCertificateGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificateGetTypeRetType = string // PutCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainCustomCertificate struct { // base64-encoded PEM-encoded certificate // REQUIRED @@ -92,12 +112,14 @@ type PutCustomDomainCustomCertificate struct { Type PutCustomDomainCustomCertificateGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PutCustomDomainCustomCertificate PutCustomDomainCustomCertificate // NewPutCustomDomainCustomCertificate instantiates a new PutCustomDomainCustomCertificate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPutCustomDomainCustomCertificate(certificate PutCustomDomainCustomCertificateGetCertificateArgType, key PutCustomDomainCustomCertificateGetKeyArgType, types PutCustomDomainCustomCertificateGetTypeArgType) *PutCustomDomainCustomCertificate { this := PutCustomDomainCustomCertificate{} setPutCustomDomainCustomCertificateGetCertificateAttributeType(&this.Certificate, certificate) @@ -109,12 +131,14 @@ func NewPutCustomDomainCustomCertificate(certificate PutCustomDomainCustomCertif // NewPutCustomDomainCustomCertificateWithDefaults instantiates a new PutCustomDomainCustomCertificate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPutCustomDomainCustomCertificateWithDefaults() *PutCustomDomainCustomCertificate { this := PutCustomDomainCustomCertificate{} return &this } // GetCertificate returns the Certificate field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) GetCertificate() (ret PutCustomDomainCustomCertificateGetCertificateRetType) { ret, _ = o.GetCertificateOk() return ret @@ -122,16 +146,19 @@ func (o *PutCustomDomainCustomCertificate) GetCertificate() (ret PutCustomDomain // GetCertificateOk returns a tuple with the Certificate field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) GetCertificateOk() (ret PutCustomDomainCustomCertificateGetCertificateRetType, ok bool) { return getPutCustomDomainCustomCertificateGetCertificateAttributeTypeOk(o.Certificate) } // SetCertificate sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) SetCertificate(v PutCustomDomainCustomCertificateGetCertificateRetType) { setPutCustomDomainCustomCertificateGetCertificateAttributeType(&o.Certificate, v) } // GetKey returns the Key field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) GetKey() (ret PutCustomDomainCustomCertificateGetKeyRetType) { ret, _ = o.GetKeyOk() return ret @@ -139,16 +166,19 @@ func (o *PutCustomDomainCustomCertificate) GetKey() (ret PutCustomDomainCustomCe // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) GetKeyOk() (ret PutCustomDomainCustomCertificateGetKeyRetType, ok bool) { return getPutCustomDomainCustomCertificateGetKeyAttributeTypeOk(o.Key) } // SetKey sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) SetKey(v PutCustomDomainCustomCertificateGetKeyRetType) { setPutCustomDomainCustomCertificateGetKeyAttributeType(&o.Key, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) GetType() (ret PutCustomDomainCustomCertificateGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -156,15 +186,18 @@ func (o *PutCustomDomainCustomCertificate) GetType() (ret PutCustomDomainCustomC // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) GetTypeOk() (ret PutCustomDomainCustomCertificateGetTypeRetType, ok bool) { return getPutCustomDomainCustomCertificateGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainCustomCertificate) SetType(v PutCustomDomainCustomCertificateGetTypeRetType) { setPutCustomDomainCustomCertificateGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PutCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPutCustomDomainCustomCertificateGetCertificateAttributeTypeOk(o.Certificate); ok { @@ -179,37 +212,45 @@ func (o PutCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePutCustomDomainCustomCertificate struct { value *PutCustomDomainCustomCertificate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainCustomCertificate) Get() *PutCustomDomainCustomCertificate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainCustomCertificate) Set(val *PutCustomDomainCustomCertificate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainCustomCertificate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainCustomCertificate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePutCustomDomainCustomCertificate(val *PutCustomDomainCustomCertificate) *NullablePutCustomDomainCustomCertificate { return &NullablePutCustomDomainCustomCertificate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_put_custom_domain_managed_certificate.go b/services/cdn/model_put_custom_domain_managed_certificate.go index 32865499f..7a02888a8 100644 --- a/services/cdn/model_put_custom_domain_managed_certificate.go +++ b/services/cdn/model_put_custom_domain_managed_certificate.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &PutCustomDomainManagedCertificate{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainManagedCertificateGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPutCustomDomainManagedCertificateGetTypeAttributeTypeOk(arg PutCustomDomainManagedCertificateGetTypeAttributeType) (ret PutCustomDomainManagedCertificateGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,25 +34,32 @@ func getPutCustomDomainManagedCertificateGetTypeAttributeTypeOk(arg PutCustomDom return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPutCustomDomainManagedCertificateGetTypeAttributeType(arg *PutCustomDomainManagedCertificateGetTypeAttributeType, val PutCustomDomainManagedCertificateGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainManagedCertificateGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainManagedCertificateGetTypeRetType = string // PutCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainManagedCertificate struct { // REQUIRED Type PutCustomDomainManagedCertificateGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PutCustomDomainManagedCertificate PutCustomDomainManagedCertificate // NewPutCustomDomainManagedCertificate instantiates a new PutCustomDomainManagedCertificate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPutCustomDomainManagedCertificate(types PutCustomDomainManagedCertificateGetTypeArgType) *PutCustomDomainManagedCertificate { this := PutCustomDomainManagedCertificate{} setPutCustomDomainManagedCertificateGetTypeAttributeType(&this.Type, types) @@ -59,12 +69,14 @@ func NewPutCustomDomainManagedCertificate(types PutCustomDomainManagedCertificat // NewPutCustomDomainManagedCertificateWithDefaults instantiates a new PutCustomDomainManagedCertificate 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPutCustomDomainManagedCertificateWithDefaults() *PutCustomDomainManagedCertificate { this := PutCustomDomainManagedCertificate{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainManagedCertificate) GetType() (ret PutCustomDomainManagedCertificateGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -72,15 +84,18 @@ func (o *PutCustomDomainManagedCertificate) GetType() (ret PutCustomDomainManage // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainManagedCertificate) GetTypeOk() (ret PutCustomDomainManagedCertificateGetTypeRetType, ok bool) { return getPutCustomDomainManagedCertificateGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainManagedCertificate) SetType(v PutCustomDomainManagedCertificateGetTypeRetType) { setPutCustomDomainManagedCertificateGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PutCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPutCustomDomainManagedCertificateGetTypeAttributeTypeOk(o.Type); ok { @@ -89,37 +104,45 @@ func (o PutCustomDomainManagedCertificate) ToMap() (map[string]interface{}, erro return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePutCustomDomainManagedCertificate struct { value *PutCustomDomainManagedCertificate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainManagedCertificate) Get() *PutCustomDomainManagedCertificate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainManagedCertificate) Set(val *PutCustomDomainManagedCertificate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainManagedCertificate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainManagedCertificate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePutCustomDomainManagedCertificate(val *PutCustomDomainManagedCertificate) *NullablePutCustomDomainManagedCertificate { return &NullablePutCustomDomainManagedCertificate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_put_custom_domain_payload.go b/services/cdn/model_put_custom_domain_payload.go index f1764f780..aa00c27b2 100644 --- a/services/cdn/model_put_custom_domain_payload.go +++ b/services/cdn/model_put_custom_domain_payload.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PutCustomDomainPayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainPayloadGetCertificateAttributeType = *PutCustomDomainPayloadCertificate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainPayloadGetCertificateArgType = PutCustomDomainPayloadCertificate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainPayloadGetCertificateRetType = PutCustomDomainPayloadCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPutCustomDomainPayloadGetCertificateAttributeTypeOk(arg PutCustomDomainPayloadGetCertificateAttributeType) (ret PutCustomDomainPayloadGetCertificateRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getPutCustomDomainPayloadGetCertificateAttributeTypeOk(arg PutCustomDomainP return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPutCustomDomainPayloadGetCertificateAttributeType(arg *PutCustomDomainPayloadGetCertificateAttributeType, val PutCustomDomainPayloadGetCertificateRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setPutCustomDomainPayloadGetCertificateAttributeType(arg *PutCustomDomainPa */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainPayloadGetIntentIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPutCustomDomainPayloadGetIntentIdAttributeTypeOk(arg PutCustomDomainPayloadGetIntentIdAttributeType) (ret PutCustomDomainPayloadGetIntentIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getPutCustomDomainPayloadGetIntentIdAttributeTypeOk(arg PutCustomDomainPayl return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPutCustomDomainPayloadGetIntentIdAttributeType(arg *PutCustomDomainPayloadGetIntentIdAttributeType, val PutCustomDomainPayloadGetIntentIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainPayloadGetIntentIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainPayloadGetIntentIdRetType = string // PutCustomDomainPayload struct for PutCustomDomainPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainPayload struct { Certificate PutCustomDomainPayloadGetCertificateAttributeType `json:"certificate,omitempty"` // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. @@ -69,6 +84,7 @@ type PutCustomDomainPayload struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPutCustomDomainPayload() *PutCustomDomainPayload { this := PutCustomDomainPayload{} return &this @@ -77,12 +93,14 @@ func NewPutCustomDomainPayload() *PutCustomDomainPayload { // NewPutCustomDomainPayloadWithDefaults instantiates a new PutCustomDomainPayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPutCustomDomainPayloadWithDefaults() *PutCustomDomainPayload { this := PutCustomDomainPayload{} return &this } // GetCertificate returns the Certificate field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainPayload) GetCertificate() (res PutCustomDomainPayloadGetCertificateRetType) { res, _ = o.GetCertificateOk() return @@ -90,22 +108,26 @@ func (o *PutCustomDomainPayload) GetCertificate() (res PutCustomDomainPayloadGet // GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainPayload) GetCertificateOk() (ret PutCustomDomainPayloadGetCertificateRetType, ok bool) { return getPutCustomDomainPayloadGetCertificateAttributeTypeOk(o.Certificate) } // HasCertificate returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainPayload) HasCertificate() bool { _, ok := o.GetCertificateOk() return ok } // SetCertificate gets a reference to the given PutCustomDomainPayloadCertificate and assigns it to the Certificate field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainPayload) SetCertificate(v PutCustomDomainPayloadGetCertificateRetType) { setPutCustomDomainPayloadGetCertificateAttributeType(&o.Certificate, v) } // GetIntentId returns the IntentId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainPayload) GetIntentId() (res PutCustomDomainPayloadGetIntentIdRetType) { res, _ = o.GetIntentIdOk() return @@ -113,21 +135,25 @@ func (o *PutCustomDomainPayload) GetIntentId() (res PutCustomDomainPayloadGetInt // GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainPayload) GetIntentIdOk() (ret PutCustomDomainPayloadGetIntentIdRetType, ok bool) { return getPutCustomDomainPayloadGetIntentIdAttributeTypeOk(o.IntentId) } // HasIntentId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainPayload) HasIntentId() bool { _, ok := o.GetIntentIdOk() return ok } // SetIntentId gets a reference to the given string and assigns it to the IntentId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainPayload) SetIntentId(v PutCustomDomainPayloadGetIntentIdRetType) { setPutCustomDomainPayloadGetIntentIdAttributeType(&o.IntentId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PutCustomDomainPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPutCustomDomainPayloadGetCertificateAttributeTypeOk(o.Certificate); ok { @@ -139,37 +165,45 @@ func (o PutCustomDomainPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePutCustomDomainPayload struct { value *PutCustomDomainPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainPayload) Get() *PutCustomDomainPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainPayload) Set(val *PutCustomDomainPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePutCustomDomainPayload(val *PutCustomDomainPayload) *NullablePutCustomDomainPayload { return &NullablePutCustomDomainPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_put_custom_domain_payload_certificate.go b/services/cdn/model_put_custom_domain_payload_certificate.go index b502b765c..3abf8786b 100644 --- a/services/cdn/model_put_custom_domain_payload_certificate.go +++ b/services/cdn/model_put_custom_domain_payload_certificate.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,12 +17,14 @@ import ( ) // PutCustomDomainPayloadCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainPayloadCertificate struct { PutCustomDomainCustomCertificate *PutCustomDomainCustomCertificate PutCustomDomainManagedCertificate *PutCustomDomainManagedCertificate } // PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainCustomCertificate wrapped in PutCustomDomainPayloadCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainCustomCertificate) PutCustomDomainPayloadCertificate { return PutCustomDomainPayloadCertificate{ PutCustomDomainCustomCertificate: v, @@ -29,6 +32,7 @@ func PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate(v *PutC } // PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainManagedCertificate wrapped in PutCustomDomainPayloadCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainManagedCertificate) PutCustomDomainPayloadCertificate { return PutCustomDomainPayloadCertificate{ PutCustomDomainManagedCertificate: v, @@ -36,6 +40,7 @@ func PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate(v *Put } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *PutCustomDomainPayloadCertificate) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -98,6 +103,7 @@ func (dst *PutCustomDomainPayloadCertificate) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src PutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.PutCustomDomainCustomCertificate != nil { return json.Marshal(&src.PutCustomDomainCustomCertificate) } @@ -110,6 +116,7 @@ func (src PutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *PutCustomDomainPayloadCertificate) GetActualInstance() interface{} { if obj == nil { return nil @@ -126,37 +133,45 @@ func (obj *PutCustomDomainPayloadCertificate) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePutCustomDomainPayloadCertificate struct { value *PutCustomDomainPayloadCertificate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainPayloadCertificate) Get() *PutCustomDomainPayloadCertificate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainPayloadCertificate) Set(val *PutCustomDomainPayloadCertificate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainPayloadCertificate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainPayloadCertificate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePutCustomDomainPayloadCertificate(val *PutCustomDomainPayloadCertificate) *NullablePutCustomDomainPayloadCertificate { return &NullablePutCustomDomainPayloadCertificate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainPayloadCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_put_custom_domain_response.go b/services/cdn/model_put_custom_domain_response.go index 4d3968a01..736db297f 100644 --- a/services/cdn/model_put_custom_domain_response.go +++ b/services/cdn/model_put_custom_domain_response.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PutCustomDomainResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainResponseGetCertificateAttributeType = *PutCustomDomainResponseCertificate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainResponseGetCertificateArgType = PutCustomDomainResponseCertificate + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainResponseGetCertificateRetType = PutCustomDomainResponseCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPutCustomDomainResponseGetCertificateAttributeTypeOk(arg PutCustomDomainResponseGetCertificateAttributeType) (ret PutCustomDomainResponseGetCertificateRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getPutCustomDomainResponseGetCertificateAttributeTypeOk(arg PutCustomDomain return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPutCustomDomainResponseGetCertificateAttributeType(arg *PutCustomDomainResponseGetCertificateAttributeType, val PutCustomDomainResponseGetCertificateRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setPutCustomDomainResponseGetCertificateAttributeType(arg *PutCustomDomainR */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainResponseGetCustomDomainAttributeType = *CustomDomain + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainResponseGetCustomDomainArgType = CustomDomain + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainResponseGetCustomDomainRetType = CustomDomain +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPutCustomDomainResponseGetCustomDomainAttributeTypeOk(arg PutCustomDomainResponseGetCustomDomainAttributeType) (ret PutCustomDomainResponseGetCustomDomainRetType, ok bool) { if arg == nil { return ret, false @@ -53,23 +67,27 @@ func getPutCustomDomainResponseGetCustomDomainAttributeTypeOk(arg PutCustomDomai return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPutCustomDomainResponseGetCustomDomainAttributeType(arg *PutCustomDomainResponseGetCustomDomainAttributeType, val PutCustomDomainResponseGetCustomDomainRetType) { *arg = &val } // PutCustomDomainResponse struct for PutCustomDomainResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainResponse struct { Certificate PutCustomDomainResponseGetCertificateAttributeType `json:"certificate,omitempty"` // REQUIRED CustomDomain PutCustomDomainResponseGetCustomDomainAttributeType `json:"customDomain" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PutCustomDomainResponse PutCustomDomainResponse // NewPutCustomDomainResponse instantiates a new PutCustomDomainResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPutCustomDomainResponse(customDomain PutCustomDomainResponseGetCustomDomainArgType) *PutCustomDomainResponse { this := PutCustomDomainResponse{} setPutCustomDomainResponseGetCustomDomainAttributeType(&this.CustomDomain, customDomain) @@ -79,12 +97,14 @@ func NewPutCustomDomainResponse(customDomain PutCustomDomainResponseGetCustomDom // NewPutCustomDomainResponseWithDefaults instantiates a new PutCustomDomainResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPutCustomDomainResponseWithDefaults() *PutCustomDomainResponse { this := PutCustomDomainResponse{} return &this } // GetCertificate returns the Certificate field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainResponse) GetCertificate() (res PutCustomDomainResponseGetCertificateRetType) { res, _ = o.GetCertificateOk() return @@ -92,22 +112,26 @@ func (o *PutCustomDomainResponse) GetCertificate() (res PutCustomDomainResponseG // GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainResponse) GetCertificateOk() (ret PutCustomDomainResponseGetCertificateRetType, ok bool) { return getPutCustomDomainResponseGetCertificateAttributeTypeOk(o.Certificate) } // HasCertificate returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainResponse) HasCertificate() bool { _, ok := o.GetCertificateOk() return ok } // SetCertificate gets a reference to the given PutCustomDomainResponseCertificate and assigns it to the Certificate field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainResponse) SetCertificate(v PutCustomDomainResponseGetCertificateRetType) { setPutCustomDomainResponseGetCertificateAttributeType(&o.Certificate, v) } // GetCustomDomain returns the CustomDomain field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainResponse) GetCustomDomain() (ret PutCustomDomainResponseGetCustomDomainRetType) { ret, _ = o.GetCustomDomainOk() return ret @@ -115,15 +139,18 @@ func (o *PutCustomDomainResponse) GetCustomDomain() (ret PutCustomDomainResponse // GetCustomDomainOk returns a tuple with the CustomDomain field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainResponse) GetCustomDomainOk() (ret PutCustomDomainResponseGetCustomDomainRetType, ok bool) { return getPutCustomDomainResponseGetCustomDomainAttributeTypeOk(o.CustomDomain) } // SetCustomDomain sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PutCustomDomainResponse) SetCustomDomain(v PutCustomDomainResponseGetCustomDomainRetType) { setPutCustomDomainResponseGetCustomDomainAttributeType(&o.CustomDomain, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PutCustomDomainResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPutCustomDomainResponseGetCertificateAttributeTypeOk(o.Certificate); ok { @@ -135,37 +162,45 @@ func (o PutCustomDomainResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePutCustomDomainResponse struct { value *PutCustomDomainResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainResponse) Get() *PutCustomDomainResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainResponse) Set(val *PutCustomDomainResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePutCustomDomainResponse(val *PutCustomDomainResponse) *NullablePutCustomDomainResponse { return &NullablePutCustomDomainResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_put_custom_domain_response_certificate.go b/services/cdn/model_put_custom_domain_response_certificate.go index 87c506915..80a6cac1e 100644 --- a/services/cdn/model_put_custom_domain_response_certificate.go +++ b/services/cdn/model_put_custom_domain_response_certificate.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,12 +17,14 @@ import ( ) // PutCustomDomainResponseCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PutCustomDomainResponseCertificate struct { GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate } // GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in PutCustomDomainResponseCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) PutCustomDomainResponseCertificate { return PutCustomDomainResponseCertificate{ GetCustomDomainCustomCertificate: v, @@ -29,6 +32,7 @@ func GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate(v *Get } // GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in PutCustomDomainResponseCertificate +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) PutCustomDomainResponseCertificate { return PutCustomDomainResponseCertificate{ GetCustomDomainManagedCertificate: v, @@ -36,6 +40,7 @@ func GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate(v *Ge } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *PutCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -98,6 +103,7 @@ func (dst *PutCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error // Marshal data from the first non-nil pointers in the struct to JSON func (src PutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.GetCustomDomainCustomCertificate != nil { return json.Marshal(&src.GetCustomDomainCustomCertificate) } @@ -110,6 +116,7 @@ func (src PutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *PutCustomDomainResponseCertificate) GetActualInstance() interface{} { if obj == nil { return nil @@ -126,37 +133,45 @@ func (obj *PutCustomDomainResponseCertificate) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePutCustomDomainResponseCertificate struct { value *PutCustomDomainResponseCertificate isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainResponseCertificate) Get() *PutCustomDomainResponseCertificate { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainResponseCertificate) Set(val *PutCustomDomainResponseCertificate) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainResponseCertificate) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainResponseCertificate) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePutCustomDomainResponseCertificate(val *PutCustomDomainResponseCertificate) *NullablePutCustomDomainResponseCertificate { return &NullablePutCustomDomainResponseCertificate{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePutCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_redirect_config.go b/services/cdn/model_redirect_config.go index b844692ee..b8ac16840 100644 --- a/services/cdn/model_redirect_config.go +++ b/services/cdn/model_redirect_config.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &RedirectConfig{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectConfigGetRulesAttributeType = *[]RedirectRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectConfigGetRulesArgType = []RedirectRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectConfigGetRulesRetType = []RedirectRule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRedirectConfigGetRulesAttributeTypeOk(arg RedirectConfigGetRulesAttributeType) (ret RedirectConfigGetRulesRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getRedirectConfigGetRulesAttributeTypeOk(arg RedirectConfigGetRulesAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRedirectConfigGetRulesAttributeType(arg *RedirectConfigGetRulesAttributeType, val RedirectConfigGetRulesRetType) { *arg = &val } // RedirectConfig A wrapper for a list of redirect rules that allows for redirect settings on a distribution. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectConfig struct { // A list of redirect rules. The order of rules matters for evaluation. Rules RedirectConfigGetRulesAttributeType `json:"rules,omitempty"` @@ -47,6 +56,7 @@ type RedirectConfig struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRedirectConfig() *RedirectConfig { this := RedirectConfig{} return &this @@ -55,12 +65,14 @@ func NewRedirectConfig() *RedirectConfig { // NewRedirectConfigWithDefaults instantiates a new RedirectConfig 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRedirectConfigWithDefaults() *RedirectConfig { this := RedirectConfig{} return &this } // GetRules returns the Rules field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectConfig) GetRules() (res RedirectConfigGetRulesRetType) { res, _ = o.GetRulesOk() return @@ -68,21 +80,25 @@ func (o *RedirectConfig) GetRules() (res RedirectConfigGetRulesRetType) { // GetRulesOk returns a tuple with the Rules field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectConfig) GetRulesOk() (ret RedirectConfigGetRulesRetType, ok bool) { return getRedirectConfigGetRulesAttributeTypeOk(o.Rules) } // HasRules returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectConfig) HasRules() bool { _, ok := o.GetRulesOk() return ok } // SetRules gets a reference to the given []RedirectRule and assigns it to the Rules field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectConfig) SetRules(v RedirectConfigGetRulesRetType) { setRedirectConfigGetRulesAttributeType(&o.Rules, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RedirectConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRedirectConfigGetRulesAttributeTypeOk(o.Rules); ok { @@ -91,37 +107,45 @@ func (o RedirectConfig) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRedirectConfig struct { value *RedirectConfig isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectConfig) Get() *RedirectConfig { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectConfig) Set(val *RedirectConfig) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectConfig) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectConfig) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRedirectConfig(val *RedirectConfig) *NullableRedirectConfig { return &NullableRedirectConfig{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectConfig) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectConfig) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_redirect_rule.go b/services/cdn/model_redirect_rule.go index 17a337ea3..3e182114b 100644 --- a/services/cdn/model_redirect_rule.go +++ b/services/cdn/model_redirect_rule.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &RedirectRule{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRedirectRuleGetDescriptionAttributeTypeOk(arg RedirectRuleGetDescriptionAttributeType) (ret RedirectRuleGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getRedirectRuleGetDescriptionAttributeTypeOk(arg RedirectRuleGetDescription return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRedirectRuleGetDescriptionAttributeType(arg *RedirectRuleGetDescriptionAttributeType, val RedirectRuleGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetDescriptionRetType = string /* @@ -44,10 +51,16 @@ type RedirectRuleGetDescriptionRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRulegetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRulegetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRulegetEnabledRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRedirectRulegetEnabledAttributeTypeOk(arg RedirectRulegetEnabledAttributeType) (ret RedirectRulegetEnabledRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getRedirectRulegetEnabledAttributeTypeOk(arg RedirectRulegetEnabledAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRedirectRulegetEnabledAttributeType(arg *RedirectRulegetEnabledAttributeType, val RedirectRulegetEnabledRetType) { *arg = &val } @@ -64,10 +78,16 @@ func setRedirectRulegetEnabledAttributeType(arg *RedirectRulegetEnabledAttribute */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetMatchersAttributeType = *[]Matcher + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetMatchersArgType = []Matcher + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetMatchersRetType = []Matcher +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRedirectRuleGetMatchersAttributeTypeOk(arg RedirectRuleGetMatchersAttributeType) (ret RedirectRuleGetMatchersRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getRedirectRuleGetMatchersAttributeTypeOk(arg RedirectRuleGetMatchersAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRedirectRuleGetMatchersAttributeType(arg *RedirectRuleGetMatchersAttributeType, val RedirectRuleGetMatchersRetType) { *arg = &val } @@ -84,10 +105,16 @@ func setRedirectRuleGetMatchersAttributeType(arg *RedirectRuleGetMatchersAttribu */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetRuleMatchConditionAttributeType = *MatchCondition + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetRuleMatchConditionArgType = MatchCondition + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetRuleMatchConditionRetType = MatchCondition +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRedirectRuleGetRuleMatchConditionAttributeTypeOk(arg RedirectRuleGetRuleMatchConditionAttributeType) (ret RedirectRuleGetRuleMatchConditionRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +122,7 @@ func getRedirectRuleGetRuleMatchConditionAttributeTypeOk(arg RedirectRuleGetRule return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRedirectRuleGetRuleMatchConditionAttributeType(arg *RedirectRuleGetRuleMatchConditionAttributeType, val RedirectRuleGetRuleMatchConditionRetType) { *arg = &val } @@ -107,18 +135,25 @@ func setRedirectRuleGetRuleMatchConditionAttributeType(arg *RedirectRuleGetRuleM // RedirectRuleStatusCode The HTTP status code for the redirect. Must be one of 301, 302, 303, 307, or 308. // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleStatusCode int // List of StatusCode const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead REDIRECTRULESTATUS_CODE__301 RedirectRuleStatusCode = 301 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead REDIRECTRULESTATUS_CODE__302 RedirectRuleStatusCode = 302 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead REDIRECTRULESTATUS_CODE__303 RedirectRuleStatusCode = 303 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead REDIRECTRULESTATUS_CODE__307 RedirectRuleStatusCode = 307 + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead REDIRECTRULESTATUS_CODE__308 RedirectRuleStatusCode = 308 ) // All allowed values of RedirectRule enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedRedirectRuleStatusCodeEnumValues = []RedirectRuleStatusCode{ 301, 302, @@ -127,6 +162,7 @@ var AllowedRedirectRuleStatusCodeEnumValues = []RedirectRuleStatusCode{ 308, } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *RedirectRuleStatusCode) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers @@ -154,6 +190,7 @@ func (v *RedirectRuleStatusCode) UnmarshalJSON(src []byte) error { // NewRedirectRuleStatusCodeFromValue returns a pointer to a valid RedirectRuleStatusCode // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRedirectRuleStatusCodeFromValue(v RedirectRuleStatusCode) (*RedirectRuleStatusCode, error) { ev := RedirectRuleStatusCode(v) if ev.IsValid() { @@ -164,6 +201,7 @@ func NewRedirectRuleStatusCodeFromValue(v RedirectRuleStatusCode) (*RedirectRule } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v RedirectRuleStatusCode) IsValid() bool { for _, existing := range AllowedRedirectRuleStatusCodeEnumValues { if existing == v { @@ -174,50 +212,65 @@ func (v RedirectRuleStatusCode) IsValid() bool { } // Ptr returns reference to StatusCodeStatusCode value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v RedirectRuleStatusCode) Ptr() *RedirectRuleStatusCode { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRedirectRuleStatusCode struct { value *RedirectRuleStatusCode isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectRuleStatusCode) Get() *RedirectRuleStatusCode { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectRuleStatusCode) Set(val *RedirectRuleStatusCode) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectRuleStatusCode) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectRuleStatusCode) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRedirectRuleStatusCode(val *RedirectRuleStatusCode) *NullableRedirectRuleStatusCode { return &NullableRedirectRuleStatusCode{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectRuleStatusCode) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectRuleStatusCode) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetStatusCodeAttributeType = *RedirectRuleStatusCode + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetStatusCodeArgType = RedirectRuleStatusCode + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetStatusCodeRetType = RedirectRuleStatusCode +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRedirectRuleGetStatusCodeAttributeTypeOk(arg RedirectRuleGetStatusCodeAttributeType) (ret RedirectRuleGetStatusCodeRetType, ok bool) { if arg == nil { return ret, false @@ -225,6 +278,7 @@ func getRedirectRuleGetStatusCodeAttributeTypeOk(arg RedirectRuleGetStatusCodeAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRedirectRuleGetStatusCodeAttributeType(arg *RedirectRuleGetStatusCodeAttributeType, val RedirectRuleGetStatusCodeRetType) { *arg = &val } @@ -234,8 +288,10 @@ func setRedirectRuleGetStatusCodeAttributeType(arg *RedirectRuleGetStatusCodeAtt */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetTargetUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRedirectRuleGetTargetUrlAttributeTypeOk(arg RedirectRuleGetTargetUrlAttributeType) (ret RedirectRuleGetTargetUrlRetType, ok bool) { if arg == nil { return ret, false @@ -243,14 +299,19 @@ func getRedirectRuleGetTargetUrlAttributeTypeOk(arg RedirectRuleGetTargetUrlAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRedirectRuleGetTargetUrlAttributeType(arg *RedirectRuleGetTargetUrlAttributeType, val RedirectRuleGetTargetUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetTargetUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRuleGetTargetUrlRetType = string // RedirectRule A single redirect rule defining a source pattern and a target URL. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RedirectRule struct { // An optional description for the redirect rule. Description RedirectRuleGetDescriptionAttributeType `json:"description,omitempty"` @@ -269,12 +330,14 @@ type RedirectRule struct { TargetUrl RedirectRuleGetTargetUrlAttributeType `json:"targetUrl" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _RedirectRule RedirectRule // NewRedirectRule instantiates a new RedirectRule 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRedirectRule(matchers RedirectRuleGetMatchersArgType, statusCode RedirectRuleGetStatusCodeArgType, targetUrl RedirectRuleGetTargetUrlArgType) *RedirectRule { this := RedirectRule{} setRedirectRuleGetMatchersAttributeType(&this.Matchers, matchers) @@ -286,6 +349,7 @@ func NewRedirectRule(matchers RedirectRuleGetMatchersArgType, statusCode Redirec // NewRedirectRuleWithDefaults instantiates a new RedirectRule 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRedirectRuleWithDefaults() *RedirectRule { this := RedirectRule{} var enabled bool = true @@ -296,6 +360,7 @@ func NewRedirectRuleWithDefaults() *RedirectRule { } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetDescription() (res RedirectRuleGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -303,22 +368,26 @@ func (o *RedirectRule) GetDescription() (res RedirectRuleGetDescriptionRetType) // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetDescriptionOk() (ret RedirectRuleGetDescriptionRetType, ok bool) { return getRedirectRuleGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) SetDescription(v RedirectRuleGetDescriptionRetType) { setRedirectRuleGetDescriptionAttributeType(&o.Description, v) } // GetEnabled returns the Enabled field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetEnabled() (res RedirectRulegetEnabledRetType) { res, _ = o.GetEnabledOk() return @@ -326,22 +395,26 @@ func (o *RedirectRule) GetEnabled() (res RedirectRulegetEnabledRetType) { // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetEnabledOk() (ret RedirectRulegetEnabledRetType, ok bool) { return getRedirectRulegetEnabledAttributeTypeOk(o.Enabled) } // HasEnabled returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) HasEnabled() bool { _, ok := o.GetEnabledOk() return ok } // SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) SetEnabled(v RedirectRulegetEnabledRetType) { setRedirectRulegetEnabledAttributeType(&o.Enabled, v) } // GetMatchers returns the Matchers field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetMatchers() (ret RedirectRuleGetMatchersRetType) { ret, _ = o.GetMatchersOk() return ret @@ -349,16 +422,19 @@ func (o *RedirectRule) GetMatchers() (ret RedirectRuleGetMatchersRetType) { // GetMatchersOk returns a tuple with the Matchers field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetMatchersOk() (ret RedirectRuleGetMatchersRetType, ok bool) { return getRedirectRuleGetMatchersAttributeTypeOk(o.Matchers) } // SetMatchers sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) SetMatchers(v RedirectRuleGetMatchersRetType) { setRedirectRuleGetMatchersAttributeType(&o.Matchers, v) } // GetRuleMatchCondition returns the RuleMatchCondition field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetRuleMatchCondition() (res RedirectRuleGetRuleMatchConditionRetType) { res, _ = o.GetRuleMatchConditionOk() return @@ -366,22 +442,26 @@ func (o *RedirectRule) GetRuleMatchCondition() (res RedirectRuleGetRuleMatchCond // GetRuleMatchConditionOk returns a tuple with the RuleMatchCondition field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetRuleMatchConditionOk() (ret RedirectRuleGetRuleMatchConditionRetType, ok bool) { return getRedirectRuleGetRuleMatchConditionAttributeTypeOk(o.RuleMatchCondition) } // HasRuleMatchCondition returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) HasRuleMatchCondition() bool { _, ok := o.GetRuleMatchConditionOk() return ok } // SetRuleMatchCondition gets a reference to the given MatchCondition and assigns it to the RuleMatchCondition field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) SetRuleMatchCondition(v RedirectRuleGetRuleMatchConditionRetType) { setRedirectRuleGetRuleMatchConditionAttributeType(&o.RuleMatchCondition, v) } // GetStatusCode returns the StatusCode field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetStatusCode() (ret RedirectRuleGetStatusCodeRetType) { ret, _ = o.GetStatusCodeOk() return ret @@ -389,16 +469,19 @@ func (o *RedirectRule) GetStatusCode() (ret RedirectRuleGetStatusCodeRetType) { // GetStatusCodeOk returns a tuple with the StatusCode field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetStatusCodeOk() (ret RedirectRuleGetStatusCodeRetType, ok bool) { return getRedirectRuleGetStatusCodeAttributeTypeOk(o.StatusCode) } // SetStatusCode sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) SetStatusCode(v RedirectRuleGetStatusCodeRetType) { setRedirectRuleGetStatusCodeAttributeType(&o.StatusCode, v) } // GetTargetUrl returns the TargetUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetTargetUrl() (ret RedirectRuleGetTargetUrlRetType) { ret, _ = o.GetTargetUrlOk() return ret @@ -406,15 +489,18 @@ func (o *RedirectRule) GetTargetUrl() (ret RedirectRuleGetTargetUrlRetType) { // GetTargetUrlOk returns a tuple with the TargetUrl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) GetTargetUrlOk() (ret RedirectRuleGetTargetUrlRetType, ok bool) { return getRedirectRuleGetTargetUrlAttributeTypeOk(o.TargetUrl) } // SetTargetUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RedirectRule) SetTargetUrl(v RedirectRuleGetTargetUrlRetType) { setRedirectRuleGetTargetUrlAttributeType(&o.TargetUrl, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RedirectRule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRedirectRuleGetDescriptionAttributeTypeOk(o.Description); ok { @@ -438,37 +524,45 @@ func (o RedirectRule) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRedirectRule struct { value *RedirectRule isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectRule) Get() *RedirectRule { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectRule) Set(val *RedirectRule) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectRule) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectRule) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRedirectRule(val *RedirectRule) *NullableRedirectRule { return &NullableRedirectRule{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRedirectRule) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRedirectRule) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_region.go b/services/cdn/model_region.go index 9162b1808..19b4f794c 100644 --- a/services/cdn/model_region.go +++ b/services/cdn/model_region.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,18 +17,25 @@ import ( ) // Region The following regions exist: - `EU` - Europe - `US` - United States / North America - `AF` - Africa - `SA` - South America - `ASIA` - Asia and Oceania +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Region string // List of Region const ( - REGION_EU Region = "EU" - REGION_US Region = "US" - REGION_AF Region = "AF" - REGION_SA Region = "SA" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + REGION_EU Region = "EU" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + REGION_US Region = "US" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + REGION_AF Region = "AF" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + REGION_SA Region = "SA" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead REGION_ASIA Region = "ASIA" ) // All allowed values of Region enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedRegionEnumValues = []Region{ "EU", "US", @@ -36,6 +44,7 @@ var AllowedRegionEnumValues = []Region{ "ASIA", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *Region) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -60,6 +69,7 @@ func (v *Region) UnmarshalJSON(src []byte) error { // NewRegionFromValue returns a pointer to a valid Region // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRegionFromValue(v string) (*Region, error) { ev := Region(v) if ev.IsValid() { @@ -70,6 +80,7 @@ func NewRegionFromValue(v string) (*Region, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v Region) IsValid() bool { for _, existing := range AllowedRegionEnumValues { if existing == v { @@ -80,41 +91,50 @@ func (v Region) IsValid() bool { } // Ptr returns reference to Region value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v Region) Ptr() *Region { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRegion struct { value *Region isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegion) Get() *Region { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegion) Set(val *Region) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegion) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegion) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRegion(val *Region) *NullableRegion { return &NullableRegion{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegion) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegion) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_status_error.go b/services/cdn/model_status_error.go index 587e2210a..d7147144b 100644 --- a/services/cdn/model_status_error.go +++ b/services/cdn/model_status_error.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &StatusError{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetDeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStatusErrorGetDeAttributeTypeOk(arg StatusErrorGetDeAttributeType) (ret StatusErrorGetDeRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getStatusErrorGetDeAttributeTypeOk(arg StatusErrorGetDeAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStatusErrorGetDeAttributeType(arg *StatusErrorGetDeAttributeType, val StatusErrorGetDeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetDeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetDeRetType = string /* @@ -44,8 +51,10 @@ type StatusErrorGetDeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetEnAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStatusErrorGetEnAttributeTypeOk(arg StatusErrorGetEnAttributeType) (ret StatusErrorGetEnRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +62,15 @@ func getStatusErrorGetEnAttributeTypeOk(arg StatusErrorGetEnAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStatusErrorGetEnAttributeType(arg *StatusErrorGetEnAttributeType, val StatusErrorGetEnRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetEnArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetEnRetType = string /* @@ -68,19 +81,27 @@ type StatusErrorGetEnRetType = string // StatusErrorKey An enum value that describes a Status Error. // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorKey string // List of Key const ( - STATUSERRORKEY_UNKNOWN StatusErrorKey = "UNKNOWN" - STATUSERRORKEY_CUSTOM_DOMAIN_CNAME_MISSING StatusErrorKey = "CUSTOM_DOMAIN_CNAME_MISSING" - STATUSERRORKEY_CUSTOM_DOMAIN_ALREADY_IN_USE StatusErrorKey = "CUSTOM_DOMAIN_ALREADY_IN_USE" - STATUSERRORKEY_PUBLIC_BETA_QUOTA_REACHED StatusErrorKey = "PUBLIC_BETA_QUOTA_REACHED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATUSERRORKEY_UNKNOWN StatusErrorKey = "UNKNOWN" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATUSERRORKEY_CUSTOM_DOMAIN_CNAME_MISSING StatusErrorKey = "CUSTOM_DOMAIN_CNAME_MISSING" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATUSERRORKEY_CUSTOM_DOMAIN_ALREADY_IN_USE StatusErrorKey = "CUSTOM_DOMAIN_ALREADY_IN_USE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATUSERRORKEY_PUBLIC_BETA_QUOTA_REACHED StatusErrorKey = "PUBLIC_BETA_QUOTA_REACHED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead STATUSERRORKEY_LOG_SINK_INSTANCE_UNAVAILABLE StatusErrorKey = "LOG_SINK_INSTANCE_UNAVAILABLE" - STATUSERRORKEY_EXTERNAL_QUOTA_REACHED StatusErrorKey = "EXTERNAL_QUOTA_REACHED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATUSERRORKEY_EXTERNAL_QUOTA_REACHED StatusErrorKey = "EXTERNAL_QUOTA_REACHED" ) // All allowed values of StatusError enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedStatusErrorKeyEnumValues = []StatusErrorKey{ "UNKNOWN", "CUSTOM_DOMAIN_CNAME_MISSING", @@ -90,6 +111,7 @@ var AllowedStatusErrorKeyEnumValues = []StatusErrorKey{ "EXTERNAL_QUOTA_REACHED", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *StatusErrorKey) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers @@ -117,6 +139,7 @@ func (v *StatusErrorKey) UnmarshalJSON(src []byte) error { // NewStatusErrorKeyFromValue returns a pointer to a valid StatusErrorKey // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewStatusErrorKeyFromValue(v StatusErrorKey) (*StatusErrorKey, error) { ev := StatusErrorKey(v) if ev.IsValid() { @@ -127,6 +150,7 @@ func NewStatusErrorKeyFromValue(v StatusErrorKey) (*StatusErrorKey, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v StatusErrorKey) IsValid() bool { for _, existing := range AllowedStatusErrorKeyEnumValues { if existing == v { @@ -137,50 +161,65 @@ func (v StatusErrorKey) IsValid() bool { } // Ptr returns reference to KeyKey value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v StatusErrorKey) Ptr() *StatusErrorKey { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableStatusErrorKey struct { value *StatusErrorKey isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStatusErrorKey) Get() *StatusErrorKey { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStatusErrorKey) Set(val *StatusErrorKey) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStatusErrorKey) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStatusErrorKey) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableStatusErrorKey(val *StatusErrorKey) *NullableStatusErrorKey { return &NullableStatusErrorKey{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStatusErrorKey) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStatusErrorKey) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetKeyAttributeType = *StatusErrorKey + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetKeyArgType = StatusErrorKey + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusErrorGetKeyRetType = StatusErrorKey +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getStatusErrorGetKeyAttributeTypeOk(arg StatusErrorGetKeyAttributeType) (ret StatusErrorGetKeyRetType, ok bool) { if arg == nil { return ret, false @@ -188,11 +227,13 @@ func getStatusErrorGetKeyAttributeTypeOk(arg StatusErrorGetKeyAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setStatusErrorGetKeyAttributeType(arg *StatusErrorGetKeyAttributeType, val StatusErrorGetKeyRetType) { *arg = &val } // StatusError struct for StatusError +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StatusError struct { // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. De StatusErrorGetDeAttributeType `json:"de,omitempty"` @@ -204,12 +245,14 @@ type StatusError struct { Key StatusErrorGetKeyAttributeType `json:"key" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _StatusError StatusError // NewStatusError instantiates a new StatusError 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewStatusError(en StatusErrorGetEnArgType, key StatusErrorGetKeyArgType) *StatusError { this := StatusError{} setStatusErrorGetEnAttributeType(&this.En, en) @@ -220,12 +263,14 @@ func NewStatusError(en StatusErrorGetEnArgType, key StatusErrorGetKeyArgType) *S // NewStatusErrorWithDefaults instantiates a new StatusError 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewStatusErrorWithDefaults() *StatusError { this := StatusError{} return &this } // GetDe returns the De field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) GetDe() (res StatusErrorGetDeRetType) { res, _ = o.GetDeOk() return @@ -233,22 +278,26 @@ func (o *StatusError) GetDe() (res StatusErrorGetDeRetType) { // GetDeOk returns a tuple with the De field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) GetDeOk() (ret StatusErrorGetDeRetType, ok bool) { return getStatusErrorGetDeAttributeTypeOk(o.De) } // HasDe returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) HasDe() bool { _, ok := o.GetDeOk() return ok } // SetDe gets a reference to the given string and assigns it to the De field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) SetDe(v StatusErrorGetDeRetType) { setStatusErrorGetDeAttributeType(&o.De, v) } // GetEn returns the En field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) GetEn() (ret StatusErrorGetEnRetType) { ret, _ = o.GetEnOk() return ret @@ -256,16 +305,19 @@ func (o *StatusError) GetEn() (ret StatusErrorGetEnRetType) { // GetEnOk returns a tuple with the En field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) GetEnOk() (ret StatusErrorGetEnRetType, ok bool) { return getStatusErrorGetEnAttributeTypeOk(o.En) } // SetEn sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) SetEn(v StatusErrorGetEnRetType) { setStatusErrorGetEnAttributeType(&o.En, v) } // GetKey returns the Key field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) GetKey() (ret StatusErrorGetKeyRetType) { ret, _ = o.GetKeyOk() return ret @@ -273,15 +325,18 @@ func (o *StatusError) GetKey() (ret StatusErrorGetKeyRetType) { // GetKeyOk returns a tuple with the Key field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) GetKeyOk() (ret StatusErrorGetKeyRetType, ok bool) { return getStatusErrorGetKeyAttributeTypeOk(o.Key) } // SetKey sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *StatusError) SetKey(v StatusErrorGetKeyRetType) { setStatusErrorGetKeyAttributeType(&o.Key, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o StatusError) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getStatusErrorGetDeAttributeTypeOk(o.De); ok { @@ -296,37 +351,45 @@ func (o StatusError) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableStatusError struct { value *StatusError isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStatusError) Get() *StatusError { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStatusError) Set(val *StatusError) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStatusError) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStatusError) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableStatusError(val *StatusError) *NullableStatusError { return &NullableStatusError{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStatusError) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStatusError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_config.go b/services/cdn/model_waf_config.go index edb54eaf8..fd2a9302d 100644 --- a/services/cdn/model_waf_config.go +++ b/services/cdn/model_waf_config.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &WafConfig{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedHttpMethodsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedHttpMethodsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedHttpMethodsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetAllowedHttpMethodsAttributeTypeOk(arg WafConfigGetAllowedHttpMethodsAttributeType) (ret WafConfigGetAllowedHttpMethodsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getWafConfigGetAllowedHttpMethodsAttributeTypeOk(arg WafConfigGetAllowedHtt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetAllowedHttpMethodsAttributeType(arg *WafConfigGetAllowedHttpMethodsAttributeType, val WafConfigGetAllowedHttpMethodsRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setWafConfigGetAllowedHttpMethodsAttributeType(arg *WafConfigGetAllowedHttp */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedHttpVersionsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedHttpVersionsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedHttpVersionsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetAllowedHttpVersionsAttributeTypeOk(arg WafConfigGetAllowedHttpVersionsAttributeType) (ret WafConfigGetAllowedHttpVersionsRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getWafConfigGetAllowedHttpVersionsAttributeTypeOk(arg WafConfigGetAllowedHt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetAllowedHttpVersionsAttributeType(arg *WafConfigGetAllowedHttpVersionsAttributeType, val WafConfigGetAllowedHttpVersionsRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setWafConfigGetAllowedHttpVersionsAttributeType(arg *WafConfigGetAllowedHtt */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedRequestContentTypesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedRequestContentTypesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetAllowedRequestContentTypesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetAllowedRequestContentTypesAttributeTypeOk(arg WafConfigGetAllowedRequestContentTypesAttributeType) (ret WafConfigGetAllowedRequestContentTypesRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getWafConfigGetAllowedRequestContentTypesAttributeTypeOk(arg WafConfigGetAl return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetAllowedRequestContentTypesAttributeType(arg *WafConfigGetAllowedRequestContentTypesAttributeType, val WafConfigGetAllowedRequestContentTypesRetType) { *arg = &val } @@ -82,10 +104,16 @@ func setWafConfigGetAllowedRequestContentTypesAttributeType(arg *WafConfigGetAll */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleCollectionIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleCollectionIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleCollectionIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetDisabledRuleCollectionIdsAttributeTypeOk(arg WafConfigGetDisabledRuleCollectionIdsAttributeType) (ret WafConfigGetDisabledRuleCollectionIdsRetType, ok bool) { if arg == nil { return ret, false @@ -93,6 +121,7 @@ func getWafConfigGetDisabledRuleCollectionIdsAttributeTypeOk(arg WafConfigGetDis return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetDisabledRuleCollectionIdsAttributeType(arg *WafConfigGetDisabledRuleCollectionIdsAttributeType, val WafConfigGetDisabledRuleCollectionIdsRetType) { *arg = &val } @@ -102,10 +131,16 @@ func setWafConfigGetDisabledRuleCollectionIdsAttributeType(arg *WafConfigGetDisa */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleGroupIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleGroupIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleGroupIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetDisabledRuleGroupIdsAttributeTypeOk(arg WafConfigGetDisabledRuleGroupIdsAttributeType) (ret WafConfigGetDisabledRuleGroupIdsRetType, ok bool) { if arg == nil { return ret, false @@ -113,6 +148,7 @@ func getWafConfigGetDisabledRuleGroupIdsAttributeTypeOk(arg WafConfigGetDisabled return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetDisabledRuleGroupIdsAttributeType(arg *WafConfigGetDisabledRuleGroupIdsAttributeType, val WafConfigGetDisabledRuleGroupIdsRetType) { *arg = &val } @@ -122,10 +158,16 @@ func setWafConfigGetDisabledRuleGroupIdsAttributeType(arg *WafConfigGetDisabledR */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetDisabledRuleIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetDisabledRuleIdsAttributeTypeOk(arg WafConfigGetDisabledRuleIdsAttributeType) (ret WafConfigGetDisabledRuleIdsRetType, ok bool) { if arg == nil { return ret, false @@ -133,6 +175,7 @@ func getWafConfigGetDisabledRuleIdsAttributeTypeOk(arg WafConfigGetDisabledRuleI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetDisabledRuleIdsAttributeType(arg *WafConfigGetDisabledRuleIdsAttributeType, val WafConfigGetDisabledRuleIdsRetType) { *arg = &val } @@ -142,10 +185,16 @@ func setWafConfigGetDisabledRuleIdsAttributeType(arg *WafConfigGetDisabledRuleId */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleCollectionIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleCollectionIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleCollectionIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetEnabledRuleCollectionIdsAttributeTypeOk(arg WafConfigGetEnabledRuleCollectionIdsAttributeType) (ret WafConfigGetEnabledRuleCollectionIdsRetType, ok bool) { if arg == nil { return ret, false @@ -153,6 +202,7 @@ func getWafConfigGetEnabledRuleCollectionIdsAttributeTypeOk(arg WafConfigGetEnab return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetEnabledRuleCollectionIdsAttributeType(arg *WafConfigGetEnabledRuleCollectionIdsAttributeType, val WafConfigGetEnabledRuleCollectionIdsRetType) { *arg = &val } @@ -162,10 +212,16 @@ func setWafConfigGetEnabledRuleCollectionIdsAttributeType(arg *WafConfigGetEnabl */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleGroupIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleGroupIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleGroupIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetEnabledRuleGroupIdsAttributeTypeOk(arg WafConfigGetEnabledRuleGroupIdsAttributeType) (ret WafConfigGetEnabledRuleGroupIdsRetType, ok bool) { if arg == nil { return ret, false @@ -173,6 +229,7 @@ func getWafConfigGetEnabledRuleGroupIdsAttributeTypeOk(arg WafConfigGetEnabledRu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetEnabledRuleGroupIdsAttributeType(arg *WafConfigGetEnabledRuleGroupIdsAttributeType, val WafConfigGetEnabledRuleGroupIdsRetType) { *arg = &val } @@ -182,10 +239,16 @@ func setWafConfigGetEnabledRuleGroupIdsAttributeType(arg *WafConfigGetEnabledRul */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetEnabledRuleIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetEnabledRuleIdsAttributeTypeOk(arg WafConfigGetEnabledRuleIdsAttributeType) (ret WafConfigGetEnabledRuleIdsRetType, ok bool) { if arg == nil { return ret, false @@ -193,6 +256,7 @@ func getWafConfigGetEnabledRuleIdsAttributeTypeOk(arg WafConfigGetEnabledRuleIds return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetEnabledRuleIdsAttributeType(arg *WafConfigGetEnabledRuleIdsAttributeType, val WafConfigGetEnabledRuleIdsRetType) { *arg = &val } @@ -202,10 +266,16 @@ func setWafConfigGetEnabledRuleIdsAttributeType(arg *WafConfigGetEnabledRuleIdsA */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleCollectionIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleCollectionIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleCollectionIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetLogOnlyRuleCollectionIdsAttributeTypeOk(arg WafConfigGetLogOnlyRuleCollectionIdsAttributeType) (ret WafConfigGetLogOnlyRuleCollectionIdsRetType, ok bool) { if arg == nil { return ret, false @@ -213,6 +283,7 @@ func getWafConfigGetLogOnlyRuleCollectionIdsAttributeTypeOk(arg WafConfigGetLogO return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetLogOnlyRuleCollectionIdsAttributeType(arg *WafConfigGetLogOnlyRuleCollectionIdsAttributeType, val WafConfigGetLogOnlyRuleCollectionIdsRetType) { *arg = &val } @@ -222,10 +293,16 @@ func setWafConfigGetLogOnlyRuleCollectionIdsAttributeType(arg *WafConfigGetLogOn */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleGroupIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleGroupIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleGroupIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetLogOnlyRuleGroupIdsAttributeTypeOk(arg WafConfigGetLogOnlyRuleGroupIdsAttributeType) (ret WafConfigGetLogOnlyRuleGroupIdsRetType, ok bool) { if arg == nil { return ret, false @@ -233,6 +310,7 @@ func getWafConfigGetLogOnlyRuleGroupIdsAttributeTypeOk(arg WafConfigGetLogOnlyRu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetLogOnlyRuleGroupIdsAttributeType(arg *WafConfigGetLogOnlyRuleGroupIdsAttributeType, val WafConfigGetLogOnlyRuleGroupIdsRetType) { *arg = &val } @@ -242,10 +320,16 @@ func setWafConfigGetLogOnlyRuleGroupIdsAttributeType(arg *WafConfigGetLogOnlyRul */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetLogOnlyRuleIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetLogOnlyRuleIdsAttributeTypeOk(arg WafConfigGetLogOnlyRuleIdsAttributeType) (ret WafConfigGetLogOnlyRuleIdsRetType, ok bool) { if arg == nil { return ret, false @@ -253,6 +337,7 @@ func getWafConfigGetLogOnlyRuleIdsAttributeTypeOk(arg WafConfigGetLogOnlyRuleIds return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetLogOnlyRuleIdsAttributeType(arg *WafConfigGetLogOnlyRuleIdsAttributeType, val WafConfigGetLogOnlyRuleIdsRetType) { *arg = &val } @@ -262,10 +347,16 @@ func setWafConfigGetLogOnlyRuleIdsAttributeType(arg *WafConfigGetLogOnlyRuleIdsA */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetModeAttributeType = *WafMode + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetModeArgType = WafMode + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetModeRetType = WafMode +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetModeAttributeTypeOk(arg WafConfigGetModeAttributeType) (ret WafConfigGetModeRetType, ok bool) { if arg == nil { return ret, false @@ -273,6 +364,7 @@ func getWafConfigGetModeAttributeTypeOk(arg WafConfigGetModeAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetModeAttributeType(arg *WafConfigGetModeAttributeType, val WafConfigGetModeRetType) { *arg = &val } @@ -282,10 +374,16 @@ func setWafConfigGetModeAttributeType(arg *WafConfigGetModeAttributeType, val Wa */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetParanoiaLevelAttributeType = *WafParanoiaLevel + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetParanoiaLevelArgType = WafParanoiaLevel + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetParanoiaLevelRetType = WafParanoiaLevel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetParanoiaLevelAttributeTypeOk(arg WafConfigGetParanoiaLevelAttributeType) (ret WafConfigGetParanoiaLevelRetType, ok bool) { if arg == nil { return ret, false @@ -293,6 +391,7 @@ func getWafConfigGetParanoiaLevelAttributeTypeOk(arg WafConfigGetParanoiaLevelAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetParanoiaLevelAttributeType(arg *WafConfigGetParanoiaLevelAttributeType, val WafConfigGetParanoiaLevelRetType) { *arg = &val } @@ -302,10 +401,16 @@ func setWafConfigGetParanoiaLevelAttributeType(arg *WafConfigGetParanoiaLevelAtt */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetTypeAttributeType = *WafType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetTypeArgType = WafType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigGetTypeRetType = WafType +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigGetTypeAttributeTypeOk(arg WafConfigGetTypeAttributeType) (ret WafConfigGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -313,11 +418,13 @@ func getWafConfigGetTypeAttributeTypeOk(arg WafConfigGetTypeAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigGetTypeAttributeType(arg *WafConfigGetTypeAttributeType, val WafConfigGetTypeRetType) { *arg = &val } // WafConfig Configuration of the WAF of a distribution A WAF Config always contains a WAF Mode and Type. If a WAF was never enabled, most of the properties are not present. To **enable** the WAF for your Distribution, you must set the `mode` to `ENABLED` or `LOG_ONLY`. This causes the other properties to be populated. ## Rules There are 9 properties used to control which Rules are enabled, disabled or set to Log-Only. These properties can be grouped in 3 groups of 3. Each of these groups varies in specificity: Rules are more specific than Rule Groups, which in turn are more specific than Collections. More specific definitions override more generic definitions. ### Collections - `enabledRuleCollectionIds` - `disabledRuleCollectionIds` - `logOnlyRuleCollectionIds` These are the least specific selectors. As of 2025, only two collections exist: - `@builtin/crs/response`, containing all Rules regarding Responses - `@builtin/crs/request`, containing all Rules regarding Requests More collections may be added in the future ### Rule Groups - `enabledRuleGroupIds` - `disabledRuleGroupIds` - `logOnlyRuleGroupIds` These are more specific than Collections and will override their selector. You can find all available Rule Groups by calling the `ListWafCollections` Operation. ### Rules - `enabledRuleIds` - `disabledRuleIds` - `logOnlyRuleGds` Being the most specific selectors, these will override both Collection and Rule Group selectors. You can find all available Rule Groups by calling the `ListWafCollections` Operation. ### TIP: Review resolved config If you call `GetDistribution` with `?withWafStatus=true`, you get back a resolved WAF Rules Config which contains a `waf` property which you can inspect to see why a Rule is either enabled, disabled or logOnly. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfig struct { // This whitelist restricts which HTTP methods the distribution accepts. Requests using non-whitelisted methods are blocked by the WAF before reaching the origin. Common methods: `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS`, `CONNECT`, `TRACE` Validation ensures: 1. At least one method is allowed 2. No duplicate methods (e.g., `GET` appearing twice) 3. Each method is valid per HTTP standards AllowedHttpMethods WafConfigGetAllowedHttpMethodsAttributeType `json:"allowedHttpMethods,omitempty"` @@ -350,12 +457,14 @@ type WafConfig struct { Type WafConfigGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafConfig WafConfig // NewWafConfig instantiates a new WafConfig 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafConfig(enabledRuleIds WafConfigGetEnabledRuleIdsArgType, mode WafConfigGetModeArgType, types WafConfigGetTypeArgType) *WafConfig { this := WafConfig{} setWafConfigGetEnabledRuleIdsAttributeType(&this.EnabledRuleIds, enabledRuleIds) @@ -367,12 +476,14 @@ func NewWafConfig(enabledRuleIds WafConfigGetEnabledRuleIdsArgType, mode WafConf // NewWafConfigWithDefaults instantiates a new WafConfig 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafConfigWithDefaults() *WafConfig { this := WafConfig{} return &this } // GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetAllowedHttpMethods() (res WafConfigGetAllowedHttpMethodsRetType) { res, _ = o.GetAllowedHttpMethodsOk() return @@ -380,22 +491,26 @@ func (o *WafConfig) GetAllowedHttpMethods() (res WafConfigGetAllowedHttpMethodsR // GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetAllowedHttpMethodsOk() (ret WafConfigGetAllowedHttpMethodsRetType, ok bool) { return getWafConfigGetAllowedHttpMethodsAttributeTypeOk(o.AllowedHttpMethods) } // HasAllowedHttpMethods returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasAllowedHttpMethods() bool { _, ok := o.GetAllowedHttpMethodsOk() return ok } // SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetAllowedHttpMethods(v WafConfigGetAllowedHttpMethodsRetType) { setWafConfigGetAllowedHttpMethodsAttributeType(&o.AllowedHttpMethods, v) } // GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetAllowedHttpVersions() (res WafConfigGetAllowedHttpVersionsRetType) { res, _ = o.GetAllowedHttpVersionsOk() return @@ -403,22 +518,26 @@ func (o *WafConfig) GetAllowedHttpVersions() (res WafConfigGetAllowedHttpVersion // GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetAllowedHttpVersionsOk() (ret WafConfigGetAllowedHttpVersionsRetType, ok bool) { return getWafConfigGetAllowedHttpVersionsAttributeTypeOk(o.AllowedHttpVersions) } // HasAllowedHttpVersions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasAllowedHttpVersions() bool { _, ok := o.GetAllowedHttpVersionsOk() return ok } // SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetAllowedHttpVersions(v WafConfigGetAllowedHttpVersionsRetType) { setWafConfigGetAllowedHttpVersionsAttributeType(&o.AllowedHttpVersions, v) } // GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetAllowedRequestContentTypes() (res WafConfigGetAllowedRequestContentTypesRetType) { res, _ = o.GetAllowedRequestContentTypesOk() return @@ -426,22 +545,26 @@ func (o *WafConfig) GetAllowedRequestContentTypes() (res WafConfigGetAllowedRequ // GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetAllowedRequestContentTypesOk() (ret WafConfigGetAllowedRequestContentTypesRetType, ok bool) { return getWafConfigGetAllowedRequestContentTypesAttributeTypeOk(o.AllowedRequestContentTypes) } // HasAllowedRequestContentTypes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasAllowedRequestContentTypes() bool { _, ok := o.GetAllowedRequestContentTypesOk() return ok } // SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetAllowedRequestContentTypes(v WafConfigGetAllowedRequestContentTypesRetType) { setWafConfigGetAllowedRequestContentTypesAttributeType(&o.AllowedRequestContentTypes, v) } // GetDisabledRuleCollectionIds returns the DisabledRuleCollectionIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetDisabledRuleCollectionIds() (res WafConfigGetDisabledRuleCollectionIdsRetType) { res, _ = o.GetDisabledRuleCollectionIdsOk() return @@ -449,22 +572,26 @@ func (o *WafConfig) GetDisabledRuleCollectionIds() (res WafConfigGetDisabledRule // GetDisabledRuleCollectionIdsOk returns a tuple with the DisabledRuleCollectionIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetDisabledRuleCollectionIdsOk() (ret WafConfigGetDisabledRuleCollectionIdsRetType, ok bool) { return getWafConfigGetDisabledRuleCollectionIdsAttributeTypeOk(o.DisabledRuleCollectionIds) } // HasDisabledRuleCollectionIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasDisabledRuleCollectionIds() bool { _, ok := o.GetDisabledRuleCollectionIdsOk() return ok } // SetDisabledRuleCollectionIds gets a reference to the given []string and assigns it to the DisabledRuleCollectionIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetDisabledRuleCollectionIds(v WafConfigGetDisabledRuleCollectionIdsRetType) { setWafConfigGetDisabledRuleCollectionIdsAttributeType(&o.DisabledRuleCollectionIds, v) } // GetDisabledRuleGroupIds returns the DisabledRuleGroupIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetDisabledRuleGroupIds() (res WafConfigGetDisabledRuleGroupIdsRetType) { res, _ = o.GetDisabledRuleGroupIdsOk() return @@ -472,22 +599,26 @@ func (o *WafConfig) GetDisabledRuleGroupIds() (res WafConfigGetDisabledRuleGroup // GetDisabledRuleGroupIdsOk returns a tuple with the DisabledRuleGroupIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetDisabledRuleGroupIdsOk() (ret WafConfigGetDisabledRuleGroupIdsRetType, ok bool) { return getWafConfigGetDisabledRuleGroupIdsAttributeTypeOk(o.DisabledRuleGroupIds) } // HasDisabledRuleGroupIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasDisabledRuleGroupIds() bool { _, ok := o.GetDisabledRuleGroupIdsOk() return ok } // SetDisabledRuleGroupIds gets a reference to the given []string and assigns it to the DisabledRuleGroupIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetDisabledRuleGroupIds(v WafConfigGetDisabledRuleGroupIdsRetType) { setWafConfigGetDisabledRuleGroupIdsAttributeType(&o.DisabledRuleGroupIds, v) } // GetDisabledRuleIds returns the DisabledRuleIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetDisabledRuleIds() (res WafConfigGetDisabledRuleIdsRetType) { res, _ = o.GetDisabledRuleIdsOk() return @@ -495,22 +626,26 @@ func (o *WafConfig) GetDisabledRuleIds() (res WafConfigGetDisabledRuleIdsRetType // GetDisabledRuleIdsOk returns a tuple with the DisabledRuleIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetDisabledRuleIdsOk() (ret WafConfigGetDisabledRuleIdsRetType, ok bool) { return getWafConfigGetDisabledRuleIdsAttributeTypeOk(o.DisabledRuleIds) } // HasDisabledRuleIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasDisabledRuleIds() bool { _, ok := o.GetDisabledRuleIdsOk() return ok } // SetDisabledRuleIds gets a reference to the given []string and assigns it to the DisabledRuleIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetDisabledRuleIds(v WafConfigGetDisabledRuleIdsRetType) { setWafConfigGetDisabledRuleIdsAttributeType(&o.DisabledRuleIds, v) } // GetEnabledRuleCollectionIds returns the EnabledRuleCollectionIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetEnabledRuleCollectionIds() (res WafConfigGetEnabledRuleCollectionIdsRetType) { res, _ = o.GetEnabledRuleCollectionIdsOk() return @@ -518,22 +653,26 @@ func (o *WafConfig) GetEnabledRuleCollectionIds() (res WafConfigGetEnabledRuleCo // GetEnabledRuleCollectionIdsOk returns a tuple with the EnabledRuleCollectionIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetEnabledRuleCollectionIdsOk() (ret WafConfigGetEnabledRuleCollectionIdsRetType, ok bool) { return getWafConfigGetEnabledRuleCollectionIdsAttributeTypeOk(o.EnabledRuleCollectionIds) } // HasEnabledRuleCollectionIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasEnabledRuleCollectionIds() bool { _, ok := o.GetEnabledRuleCollectionIdsOk() return ok } // SetEnabledRuleCollectionIds gets a reference to the given []string and assigns it to the EnabledRuleCollectionIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetEnabledRuleCollectionIds(v WafConfigGetEnabledRuleCollectionIdsRetType) { setWafConfigGetEnabledRuleCollectionIdsAttributeType(&o.EnabledRuleCollectionIds, v) } // GetEnabledRuleGroupIds returns the EnabledRuleGroupIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetEnabledRuleGroupIds() (res WafConfigGetEnabledRuleGroupIdsRetType) { res, _ = o.GetEnabledRuleGroupIdsOk() return @@ -541,22 +680,26 @@ func (o *WafConfig) GetEnabledRuleGroupIds() (res WafConfigGetEnabledRuleGroupId // GetEnabledRuleGroupIdsOk returns a tuple with the EnabledRuleGroupIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetEnabledRuleGroupIdsOk() (ret WafConfigGetEnabledRuleGroupIdsRetType, ok bool) { return getWafConfigGetEnabledRuleGroupIdsAttributeTypeOk(o.EnabledRuleGroupIds) } // HasEnabledRuleGroupIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasEnabledRuleGroupIds() bool { _, ok := o.GetEnabledRuleGroupIdsOk() return ok } // SetEnabledRuleGroupIds gets a reference to the given []string and assigns it to the EnabledRuleGroupIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetEnabledRuleGroupIds(v WafConfigGetEnabledRuleGroupIdsRetType) { setWafConfigGetEnabledRuleGroupIdsAttributeType(&o.EnabledRuleGroupIds, v) } // GetEnabledRuleIds returns the EnabledRuleIds field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetEnabledRuleIds() (ret WafConfigGetEnabledRuleIdsRetType) { ret, _ = o.GetEnabledRuleIdsOk() return ret @@ -564,16 +707,19 @@ func (o *WafConfig) GetEnabledRuleIds() (ret WafConfigGetEnabledRuleIdsRetType) // GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetEnabledRuleIdsOk() (ret WafConfigGetEnabledRuleIdsRetType, ok bool) { return getWafConfigGetEnabledRuleIdsAttributeTypeOk(o.EnabledRuleIds) } // SetEnabledRuleIds sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetEnabledRuleIds(v WafConfigGetEnabledRuleIdsRetType) { setWafConfigGetEnabledRuleIdsAttributeType(&o.EnabledRuleIds, v) } // GetLogOnlyRuleCollectionIds returns the LogOnlyRuleCollectionIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetLogOnlyRuleCollectionIds() (res WafConfigGetLogOnlyRuleCollectionIdsRetType) { res, _ = o.GetLogOnlyRuleCollectionIdsOk() return @@ -581,22 +727,26 @@ func (o *WafConfig) GetLogOnlyRuleCollectionIds() (res WafConfigGetLogOnlyRuleCo // GetLogOnlyRuleCollectionIdsOk returns a tuple with the LogOnlyRuleCollectionIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetLogOnlyRuleCollectionIdsOk() (ret WafConfigGetLogOnlyRuleCollectionIdsRetType, ok bool) { return getWafConfigGetLogOnlyRuleCollectionIdsAttributeTypeOk(o.LogOnlyRuleCollectionIds) } // HasLogOnlyRuleCollectionIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasLogOnlyRuleCollectionIds() bool { _, ok := o.GetLogOnlyRuleCollectionIdsOk() return ok } // SetLogOnlyRuleCollectionIds gets a reference to the given []string and assigns it to the LogOnlyRuleCollectionIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetLogOnlyRuleCollectionIds(v WafConfigGetLogOnlyRuleCollectionIdsRetType) { setWafConfigGetLogOnlyRuleCollectionIdsAttributeType(&o.LogOnlyRuleCollectionIds, v) } // GetLogOnlyRuleGroupIds returns the LogOnlyRuleGroupIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetLogOnlyRuleGroupIds() (res WafConfigGetLogOnlyRuleGroupIdsRetType) { res, _ = o.GetLogOnlyRuleGroupIdsOk() return @@ -604,22 +754,26 @@ func (o *WafConfig) GetLogOnlyRuleGroupIds() (res WafConfigGetLogOnlyRuleGroupId // GetLogOnlyRuleGroupIdsOk returns a tuple with the LogOnlyRuleGroupIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetLogOnlyRuleGroupIdsOk() (ret WafConfigGetLogOnlyRuleGroupIdsRetType, ok bool) { return getWafConfigGetLogOnlyRuleGroupIdsAttributeTypeOk(o.LogOnlyRuleGroupIds) } // HasLogOnlyRuleGroupIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasLogOnlyRuleGroupIds() bool { _, ok := o.GetLogOnlyRuleGroupIdsOk() return ok } // SetLogOnlyRuleGroupIds gets a reference to the given []string and assigns it to the LogOnlyRuleGroupIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetLogOnlyRuleGroupIds(v WafConfigGetLogOnlyRuleGroupIdsRetType) { setWafConfigGetLogOnlyRuleGroupIdsAttributeType(&o.LogOnlyRuleGroupIds, v) } // GetLogOnlyRuleIds returns the LogOnlyRuleIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetLogOnlyRuleIds() (res WafConfigGetLogOnlyRuleIdsRetType) { res, _ = o.GetLogOnlyRuleIdsOk() return @@ -627,22 +781,26 @@ func (o *WafConfig) GetLogOnlyRuleIds() (res WafConfigGetLogOnlyRuleIdsRetType) // GetLogOnlyRuleIdsOk returns a tuple with the LogOnlyRuleIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetLogOnlyRuleIdsOk() (ret WafConfigGetLogOnlyRuleIdsRetType, ok bool) { return getWafConfigGetLogOnlyRuleIdsAttributeTypeOk(o.LogOnlyRuleIds) } // HasLogOnlyRuleIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasLogOnlyRuleIds() bool { _, ok := o.GetLogOnlyRuleIdsOk() return ok } // SetLogOnlyRuleIds gets a reference to the given []string and assigns it to the LogOnlyRuleIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetLogOnlyRuleIds(v WafConfigGetLogOnlyRuleIdsRetType) { setWafConfigGetLogOnlyRuleIdsAttributeType(&o.LogOnlyRuleIds, v) } // GetMode returns the Mode field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetMode() (ret WafConfigGetModeRetType) { ret, _ = o.GetModeOk() return ret @@ -650,16 +808,19 @@ func (o *WafConfig) GetMode() (ret WafConfigGetModeRetType) { // GetModeOk returns a tuple with the Mode field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetModeOk() (ret WafConfigGetModeRetType, ok bool) { return getWafConfigGetModeAttributeTypeOk(o.Mode) } // SetMode sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetMode(v WafConfigGetModeRetType) { setWafConfigGetModeAttributeType(&o.Mode, v) } // GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetParanoiaLevel() (res WafConfigGetParanoiaLevelRetType) { res, _ = o.GetParanoiaLevelOk() return @@ -667,22 +828,26 @@ func (o *WafConfig) GetParanoiaLevel() (res WafConfigGetParanoiaLevelRetType) { // GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetParanoiaLevelOk() (ret WafConfigGetParanoiaLevelRetType, ok bool) { return getWafConfigGetParanoiaLevelAttributeTypeOk(o.ParanoiaLevel) } // HasParanoiaLevel returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) HasParanoiaLevel() bool { _, ok := o.GetParanoiaLevelOk() return ok } // SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetParanoiaLevel(v WafConfigGetParanoiaLevelRetType) { setWafConfigGetParanoiaLevelAttributeType(&o.ParanoiaLevel, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetType() (ret WafConfigGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -690,15 +855,18 @@ func (o *WafConfig) GetType() (ret WafConfigGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) GetTypeOk() (ret WafConfigGetTypeRetType, ok bool) { return getWafConfigGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfig) SetType(v WafConfigGetTypeRetType) { setWafConfigGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafConfigGetAllowedHttpMethodsAttributeTypeOk(o.AllowedHttpMethods); ok { @@ -749,37 +917,45 @@ func (o WafConfig) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafConfig struct { value *WafConfig isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafConfig) Get() *WafConfig { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafConfig) Set(val *WafConfig) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafConfig) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafConfig) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafConfig(val *WafConfig) *NullableWafConfig { return &NullableWafConfig{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafConfig) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafConfig) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_config_patch.go b/services/cdn/model_waf_config_patch.go index 255ce1352..2ffc0e07b 100644 --- a/services/cdn/model_waf_config_patch.go +++ b/services/cdn/model_waf_config_patch.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &WafConfigPatch{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedHttpMethodsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedHttpMethodsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedHttpMethodsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetAllowedHttpMethodsAttributeTypeOk(arg WafConfigPatchGetAllowedHttpMethodsAttributeType) (ret WafConfigPatchGetAllowedHttpMethodsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getWafConfigPatchGetAllowedHttpMethodsAttributeTypeOk(arg WafConfigPatchGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetAllowedHttpMethodsAttributeType(arg *WafConfigPatchGetAllowedHttpMethodsAttributeType, val WafConfigPatchGetAllowedHttpMethodsRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setWafConfigPatchGetAllowedHttpMethodsAttributeType(arg *WafConfigPatchGetA */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedHttpVersionsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedHttpVersionsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedHttpVersionsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetAllowedHttpVersionsAttributeTypeOk(arg WafConfigPatchGetAllowedHttpVersionsAttributeType) (ret WafConfigPatchGetAllowedHttpVersionsRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getWafConfigPatchGetAllowedHttpVersionsAttributeTypeOk(arg WafConfigPatchGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetAllowedHttpVersionsAttributeType(arg *WafConfigPatchGetAllowedHttpVersionsAttributeType, val WafConfigPatchGetAllowedHttpVersionsRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setWafConfigPatchGetAllowedHttpVersionsAttributeType(arg *WafConfigPatchGet */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedRequestContentTypesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedRequestContentTypesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetAllowedRequestContentTypesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetAllowedRequestContentTypesAttributeTypeOk(arg WafConfigPatchGetAllowedRequestContentTypesAttributeType) (ret WafConfigPatchGetAllowedRequestContentTypesRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getWafConfigPatchGetAllowedRequestContentTypesAttributeTypeOk(arg WafConfig return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetAllowedRequestContentTypesAttributeType(arg *WafConfigPatchGetAllowedRequestContentTypesAttributeType, val WafConfigPatchGetAllowedRequestContentTypesRetType) { *arg = &val } @@ -82,10 +104,16 @@ func setWafConfigPatchGetAllowedRequestContentTypesAttributeType(arg *WafConfigP */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleCollectionIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleCollectionIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleCollectionIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetDisabledRuleCollectionIdsAttributeTypeOk(arg WafConfigPatchGetDisabledRuleCollectionIdsAttributeType) (ret WafConfigPatchGetDisabledRuleCollectionIdsRetType, ok bool) { if arg == nil { return ret, false @@ -93,6 +121,7 @@ func getWafConfigPatchGetDisabledRuleCollectionIdsAttributeTypeOk(arg WafConfigP return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetDisabledRuleCollectionIdsAttributeType(arg *WafConfigPatchGetDisabledRuleCollectionIdsAttributeType, val WafConfigPatchGetDisabledRuleCollectionIdsRetType) { *arg = &val } @@ -102,10 +131,16 @@ func setWafConfigPatchGetDisabledRuleCollectionIdsAttributeType(arg *WafConfigPa */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleGroupIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleGroupIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleGroupIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetDisabledRuleGroupIdsAttributeTypeOk(arg WafConfigPatchGetDisabledRuleGroupIdsAttributeType) (ret WafConfigPatchGetDisabledRuleGroupIdsRetType, ok bool) { if arg == nil { return ret, false @@ -113,6 +148,7 @@ func getWafConfigPatchGetDisabledRuleGroupIdsAttributeTypeOk(arg WafConfigPatchG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetDisabledRuleGroupIdsAttributeType(arg *WafConfigPatchGetDisabledRuleGroupIdsAttributeType, val WafConfigPatchGetDisabledRuleGroupIdsRetType) { *arg = &val } @@ -122,10 +158,16 @@ func setWafConfigPatchGetDisabledRuleGroupIdsAttributeType(arg *WafConfigPatchGe */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetDisabledRuleIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetDisabledRuleIdsAttributeTypeOk(arg WafConfigPatchGetDisabledRuleIdsAttributeType) (ret WafConfigPatchGetDisabledRuleIdsRetType, ok bool) { if arg == nil { return ret, false @@ -133,6 +175,7 @@ func getWafConfigPatchGetDisabledRuleIdsAttributeTypeOk(arg WafConfigPatchGetDis return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetDisabledRuleIdsAttributeType(arg *WafConfigPatchGetDisabledRuleIdsAttributeType, val WafConfigPatchGetDisabledRuleIdsRetType) { *arg = &val } @@ -142,10 +185,16 @@ func setWafConfigPatchGetDisabledRuleIdsAttributeType(arg *WafConfigPatchGetDisa */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleCollectionIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleCollectionIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleCollectionIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetEnabledRuleCollectionIdsAttributeTypeOk(arg WafConfigPatchGetEnabledRuleCollectionIdsAttributeType) (ret WafConfigPatchGetEnabledRuleCollectionIdsRetType, ok bool) { if arg == nil { return ret, false @@ -153,6 +202,7 @@ func getWafConfigPatchGetEnabledRuleCollectionIdsAttributeTypeOk(arg WafConfigPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetEnabledRuleCollectionIdsAttributeType(arg *WafConfigPatchGetEnabledRuleCollectionIdsAttributeType, val WafConfigPatchGetEnabledRuleCollectionIdsRetType) { *arg = &val } @@ -162,10 +212,16 @@ func setWafConfigPatchGetEnabledRuleCollectionIdsAttributeType(arg *WafConfigPat */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleGroupIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleGroupIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleGroupIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetEnabledRuleGroupIdsAttributeTypeOk(arg WafConfigPatchGetEnabledRuleGroupIdsAttributeType) (ret WafConfigPatchGetEnabledRuleGroupIdsRetType, ok bool) { if arg == nil { return ret, false @@ -173,6 +229,7 @@ func getWafConfigPatchGetEnabledRuleGroupIdsAttributeTypeOk(arg WafConfigPatchGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetEnabledRuleGroupIdsAttributeType(arg *WafConfigPatchGetEnabledRuleGroupIdsAttributeType, val WafConfigPatchGetEnabledRuleGroupIdsRetType) { *arg = &val } @@ -182,10 +239,16 @@ func setWafConfigPatchGetEnabledRuleGroupIdsAttributeType(arg *WafConfigPatchGet */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetEnabledRuleIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetEnabledRuleIdsAttributeTypeOk(arg WafConfigPatchGetEnabledRuleIdsAttributeType) (ret WafConfigPatchGetEnabledRuleIdsRetType, ok bool) { if arg == nil { return ret, false @@ -193,6 +256,7 @@ func getWafConfigPatchGetEnabledRuleIdsAttributeTypeOk(arg WafConfigPatchGetEnab return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetEnabledRuleIdsAttributeType(arg *WafConfigPatchGetEnabledRuleIdsAttributeType, val WafConfigPatchGetEnabledRuleIdsRetType) { *arg = &val } @@ -202,10 +266,16 @@ func setWafConfigPatchGetEnabledRuleIdsAttributeType(arg *WafConfigPatchGetEnabl */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleCollectionIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleCollectionIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleCollectionIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetLogOnlyRuleCollectionIdsAttributeTypeOk(arg WafConfigPatchGetLogOnlyRuleCollectionIdsAttributeType) (ret WafConfigPatchGetLogOnlyRuleCollectionIdsRetType, ok bool) { if arg == nil { return ret, false @@ -213,6 +283,7 @@ func getWafConfigPatchGetLogOnlyRuleCollectionIdsAttributeTypeOk(arg WafConfigPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetLogOnlyRuleCollectionIdsAttributeType(arg *WafConfigPatchGetLogOnlyRuleCollectionIdsAttributeType, val WafConfigPatchGetLogOnlyRuleCollectionIdsRetType) { *arg = &val } @@ -222,10 +293,16 @@ func setWafConfigPatchGetLogOnlyRuleCollectionIdsAttributeType(arg *WafConfigPat */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleGroupIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleGroupIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleGroupIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetLogOnlyRuleGroupIdsAttributeTypeOk(arg WafConfigPatchGetLogOnlyRuleGroupIdsAttributeType) (ret WafConfigPatchGetLogOnlyRuleGroupIdsRetType, ok bool) { if arg == nil { return ret, false @@ -233,6 +310,7 @@ func getWafConfigPatchGetLogOnlyRuleGroupIdsAttributeTypeOk(arg WafConfigPatchGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetLogOnlyRuleGroupIdsAttributeType(arg *WafConfigPatchGetLogOnlyRuleGroupIdsAttributeType, val WafConfigPatchGetLogOnlyRuleGroupIdsRetType) { *arg = &val } @@ -242,10 +320,16 @@ func setWafConfigPatchGetLogOnlyRuleGroupIdsAttributeType(arg *WafConfigPatchGet */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetLogOnlyRuleIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetLogOnlyRuleIdsAttributeTypeOk(arg WafConfigPatchGetLogOnlyRuleIdsAttributeType) (ret WafConfigPatchGetLogOnlyRuleIdsRetType, ok bool) { if arg == nil { return ret, false @@ -253,6 +337,7 @@ func getWafConfigPatchGetLogOnlyRuleIdsAttributeTypeOk(arg WafConfigPatchGetLogO return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetLogOnlyRuleIdsAttributeType(arg *WafConfigPatchGetLogOnlyRuleIdsAttributeType, val WafConfigPatchGetLogOnlyRuleIdsRetType) { *arg = &val } @@ -262,10 +347,16 @@ func setWafConfigPatchGetLogOnlyRuleIdsAttributeType(arg *WafConfigPatchGetLogOn */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetModeAttributeType = *WafMode + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetModeArgType = WafMode + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetModeRetType = WafMode +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetModeAttributeTypeOk(arg WafConfigPatchGetModeAttributeType) (ret WafConfigPatchGetModeRetType, ok bool) { if arg == nil { return ret, false @@ -273,6 +364,7 @@ func getWafConfigPatchGetModeAttributeTypeOk(arg WafConfigPatchGetModeAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetModeAttributeType(arg *WafConfigPatchGetModeAttributeType, val WafConfigPatchGetModeRetType) { *arg = &val } @@ -282,10 +374,16 @@ func setWafConfigPatchGetModeAttributeType(arg *WafConfigPatchGetModeAttributeTy */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetParanoiaLevelAttributeType = *WafParanoiaLevel + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetParanoiaLevelArgType = WafParanoiaLevel + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetParanoiaLevelRetType = WafParanoiaLevel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetParanoiaLevelAttributeTypeOk(arg WafConfigPatchGetParanoiaLevelAttributeType) (ret WafConfigPatchGetParanoiaLevelRetType, ok bool) { if arg == nil { return ret, false @@ -293,6 +391,7 @@ func getWafConfigPatchGetParanoiaLevelAttributeTypeOk(arg WafConfigPatchGetParan return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetParanoiaLevelAttributeType(arg *WafConfigPatchGetParanoiaLevelAttributeType, val WafConfigPatchGetParanoiaLevelRetType) { *arg = &val } @@ -302,10 +401,16 @@ func setWafConfigPatchGetParanoiaLevelAttributeType(arg *WafConfigPatchGetParano */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetTypeAttributeType = *WafType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetTypeArgType = WafType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatchGetTypeRetType = WafType +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafConfigPatchGetTypeAttributeTypeOk(arg WafConfigPatchGetTypeAttributeType) (ret WafConfigPatchGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -313,11 +418,13 @@ func getWafConfigPatchGetTypeAttributeTypeOk(arg WafConfigPatchGetTypeAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafConfigPatchGetTypeAttributeType(arg *WafConfigPatchGetTypeAttributeType, val WafConfigPatchGetTypeRetType) { *arg = &val } // WafConfigPatch Modify the WAF Configuration ## WAF Rules You can modify the set of enabled, disabled and log-only Rules by modifying these 9 properties: - enabledRuleIds - disabledRuleIds - logOnlyRuleIds - enabledRuleGroupIds - disabledRuleGroupIds - logOnlyRuleGroupIds - enabledRuleCollectionIds - disabledRuleCollectionIds - logOnlyRuleCollectionIds Please inquire the `WafConfig` Description on how the effective configuration is determined. For patching, if an ID is already used in one of the properties, it will be removed (and effectively moved) to the new property. If patching multiple properties with the same ID (e.g. writing `@builtin/crs/response` to `logOnlyRuleCollectionIds` and `enabledRuleCollectionIds`), the request will be rejected with a 400. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafConfigPatch struct { AllowedHttpMethods WafConfigPatchGetAllowedHttpMethodsAttributeType `json:"allowedHttpMethods,omitempty"` AllowedHttpVersions WafConfigPatchGetAllowedHttpVersionsAttributeType `json:"allowedHttpVersions,omitempty"` @@ -349,6 +456,7 @@ type WafConfigPatch struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafConfigPatch() *WafConfigPatch { this := WafConfigPatch{} return &this @@ -357,12 +465,14 @@ func NewWafConfigPatch() *WafConfigPatch { // NewWafConfigPatchWithDefaults instantiates a new WafConfigPatch 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafConfigPatchWithDefaults() *WafConfigPatch { this := WafConfigPatch{} return &this } // GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetAllowedHttpMethods() (res WafConfigPatchGetAllowedHttpMethodsRetType) { res, _ = o.GetAllowedHttpMethodsOk() return @@ -370,22 +480,26 @@ func (o *WafConfigPatch) GetAllowedHttpMethods() (res WafConfigPatchGetAllowedHt // GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetAllowedHttpMethodsOk() (ret WafConfigPatchGetAllowedHttpMethodsRetType, ok bool) { return getWafConfigPatchGetAllowedHttpMethodsAttributeTypeOk(o.AllowedHttpMethods) } // HasAllowedHttpMethods returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasAllowedHttpMethods() bool { _, ok := o.GetAllowedHttpMethodsOk() return ok } // SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetAllowedHttpMethods(v WafConfigPatchGetAllowedHttpMethodsRetType) { setWafConfigPatchGetAllowedHttpMethodsAttributeType(&o.AllowedHttpMethods, v) } // GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetAllowedHttpVersions() (res WafConfigPatchGetAllowedHttpVersionsRetType) { res, _ = o.GetAllowedHttpVersionsOk() return @@ -393,22 +507,26 @@ func (o *WafConfigPatch) GetAllowedHttpVersions() (res WafConfigPatchGetAllowedH // GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetAllowedHttpVersionsOk() (ret WafConfigPatchGetAllowedHttpVersionsRetType, ok bool) { return getWafConfigPatchGetAllowedHttpVersionsAttributeTypeOk(o.AllowedHttpVersions) } // HasAllowedHttpVersions returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasAllowedHttpVersions() bool { _, ok := o.GetAllowedHttpVersionsOk() return ok } // SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetAllowedHttpVersions(v WafConfigPatchGetAllowedHttpVersionsRetType) { setWafConfigPatchGetAllowedHttpVersionsAttributeType(&o.AllowedHttpVersions, v) } // GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetAllowedRequestContentTypes() (res WafConfigPatchGetAllowedRequestContentTypesRetType) { res, _ = o.GetAllowedRequestContentTypesOk() return @@ -416,22 +534,26 @@ func (o *WafConfigPatch) GetAllowedRequestContentTypes() (res WafConfigPatchGetA // GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetAllowedRequestContentTypesOk() (ret WafConfigPatchGetAllowedRequestContentTypesRetType, ok bool) { return getWafConfigPatchGetAllowedRequestContentTypesAttributeTypeOk(o.AllowedRequestContentTypes) } // HasAllowedRequestContentTypes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasAllowedRequestContentTypes() bool { _, ok := o.GetAllowedRequestContentTypesOk() return ok } // SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetAllowedRequestContentTypes(v WafConfigPatchGetAllowedRequestContentTypesRetType) { setWafConfigPatchGetAllowedRequestContentTypesAttributeType(&o.AllowedRequestContentTypes, v) } // GetDisabledRuleCollectionIds returns the DisabledRuleCollectionIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetDisabledRuleCollectionIds() (res WafConfigPatchGetDisabledRuleCollectionIdsRetType) { res, _ = o.GetDisabledRuleCollectionIdsOk() return @@ -439,22 +561,26 @@ func (o *WafConfigPatch) GetDisabledRuleCollectionIds() (res WafConfigPatchGetDi // GetDisabledRuleCollectionIdsOk returns a tuple with the DisabledRuleCollectionIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetDisabledRuleCollectionIdsOk() (ret WafConfigPatchGetDisabledRuleCollectionIdsRetType, ok bool) { return getWafConfigPatchGetDisabledRuleCollectionIdsAttributeTypeOk(o.DisabledRuleCollectionIds) } // HasDisabledRuleCollectionIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasDisabledRuleCollectionIds() bool { _, ok := o.GetDisabledRuleCollectionIdsOk() return ok } // SetDisabledRuleCollectionIds gets a reference to the given []string and assigns it to the DisabledRuleCollectionIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetDisabledRuleCollectionIds(v WafConfigPatchGetDisabledRuleCollectionIdsRetType) { setWafConfigPatchGetDisabledRuleCollectionIdsAttributeType(&o.DisabledRuleCollectionIds, v) } // GetDisabledRuleGroupIds returns the DisabledRuleGroupIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetDisabledRuleGroupIds() (res WafConfigPatchGetDisabledRuleGroupIdsRetType) { res, _ = o.GetDisabledRuleGroupIdsOk() return @@ -462,22 +588,26 @@ func (o *WafConfigPatch) GetDisabledRuleGroupIds() (res WafConfigPatchGetDisable // GetDisabledRuleGroupIdsOk returns a tuple with the DisabledRuleGroupIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetDisabledRuleGroupIdsOk() (ret WafConfigPatchGetDisabledRuleGroupIdsRetType, ok bool) { return getWafConfigPatchGetDisabledRuleGroupIdsAttributeTypeOk(o.DisabledRuleGroupIds) } // HasDisabledRuleGroupIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasDisabledRuleGroupIds() bool { _, ok := o.GetDisabledRuleGroupIdsOk() return ok } // SetDisabledRuleGroupIds gets a reference to the given []string and assigns it to the DisabledRuleGroupIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetDisabledRuleGroupIds(v WafConfigPatchGetDisabledRuleGroupIdsRetType) { setWafConfigPatchGetDisabledRuleGroupIdsAttributeType(&o.DisabledRuleGroupIds, v) } // GetDisabledRuleIds returns the DisabledRuleIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetDisabledRuleIds() (res WafConfigPatchGetDisabledRuleIdsRetType) { res, _ = o.GetDisabledRuleIdsOk() return @@ -485,22 +615,26 @@ func (o *WafConfigPatch) GetDisabledRuleIds() (res WafConfigPatchGetDisabledRule // GetDisabledRuleIdsOk returns a tuple with the DisabledRuleIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetDisabledRuleIdsOk() (ret WafConfigPatchGetDisabledRuleIdsRetType, ok bool) { return getWafConfigPatchGetDisabledRuleIdsAttributeTypeOk(o.DisabledRuleIds) } // HasDisabledRuleIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasDisabledRuleIds() bool { _, ok := o.GetDisabledRuleIdsOk() return ok } // SetDisabledRuleIds gets a reference to the given []string and assigns it to the DisabledRuleIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetDisabledRuleIds(v WafConfigPatchGetDisabledRuleIdsRetType) { setWafConfigPatchGetDisabledRuleIdsAttributeType(&o.DisabledRuleIds, v) } // GetEnabledRuleCollectionIds returns the EnabledRuleCollectionIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetEnabledRuleCollectionIds() (res WafConfigPatchGetEnabledRuleCollectionIdsRetType) { res, _ = o.GetEnabledRuleCollectionIdsOk() return @@ -508,22 +642,26 @@ func (o *WafConfigPatch) GetEnabledRuleCollectionIds() (res WafConfigPatchGetEna // GetEnabledRuleCollectionIdsOk returns a tuple with the EnabledRuleCollectionIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetEnabledRuleCollectionIdsOk() (ret WafConfigPatchGetEnabledRuleCollectionIdsRetType, ok bool) { return getWafConfigPatchGetEnabledRuleCollectionIdsAttributeTypeOk(o.EnabledRuleCollectionIds) } // HasEnabledRuleCollectionIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasEnabledRuleCollectionIds() bool { _, ok := o.GetEnabledRuleCollectionIdsOk() return ok } // SetEnabledRuleCollectionIds gets a reference to the given []string and assigns it to the EnabledRuleCollectionIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetEnabledRuleCollectionIds(v WafConfigPatchGetEnabledRuleCollectionIdsRetType) { setWafConfigPatchGetEnabledRuleCollectionIdsAttributeType(&o.EnabledRuleCollectionIds, v) } // GetEnabledRuleGroupIds returns the EnabledRuleGroupIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetEnabledRuleGroupIds() (res WafConfigPatchGetEnabledRuleGroupIdsRetType) { res, _ = o.GetEnabledRuleGroupIdsOk() return @@ -531,22 +669,26 @@ func (o *WafConfigPatch) GetEnabledRuleGroupIds() (res WafConfigPatchGetEnabledR // GetEnabledRuleGroupIdsOk returns a tuple with the EnabledRuleGroupIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetEnabledRuleGroupIdsOk() (ret WafConfigPatchGetEnabledRuleGroupIdsRetType, ok bool) { return getWafConfigPatchGetEnabledRuleGroupIdsAttributeTypeOk(o.EnabledRuleGroupIds) } // HasEnabledRuleGroupIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasEnabledRuleGroupIds() bool { _, ok := o.GetEnabledRuleGroupIdsOk() return ok } // SetEnabledRuleGroupIds gets a reference to the given []string and assigns it to the EnabledRuleGroupIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetEnabledRuleGroupIds(v WafConfigPatchGetEnabledRuleGroupIdsRetType) { setWafConfigPatchGetEnabledRuleGroupIdsAttributeType(&o.EnabledRuleGroupIds, v) } // GetEnabledRuleIds returns the EnabledRuleIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetEnabledRuleIds() (res WafConfigPatchGetEnabledRuleIdsRetType) { res, _ = o.GetEnabledRuleIdsOk() return @@ -554,22 +696,26 @@ func (o *WafConfigPatch) GetEnabledRuleIds() (res WafConfigPatchGetEnabledRuleId // GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetEnabledRuleIdsOk() (ret WafConfigPatchGetEnabledRuleIdsRetType, ok bool) { return getWafConfigPatchGetEnabledRuleIdsAttributeTypeOk(o.EnabledRuleIds) } // HasEnabledRuleIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasEnabledRuleIds() bool { _, ok := o.GetEnabledRuleIdsOk() return ok } // SetEnabledRuleIds gets a reference to the given []string and assigns it to the EnabledRuleIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetEnabledRuleIds(v WafConfigPatchGetEnabledRuleIdsRetType) { setWafConfigPatchGetEnabledRuleIdsAttributeType(&o.EnabledRuleIds, v) } // GetLogOnlyRuleCollectionIds returns the LogOnlyRuleCollectionIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetLogOnlyRuleCollectionIds() (res WafConfigPatchGetLogOnlyRuleCollectionIdsRetType) { res, _ = o.GetLogOnlyRuleCollectionIdsOk() return @@ -577,22 +723,26 @@ func (o *WafConfigPatch) GetLogOnlyRuleCollectionIds() (res WafConfigPatchGetLog // GetLogOnlyRuleCollectionIdsOk returns a tuple with the LogOnlyRuleCollectionIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetLogOnlyRuleCollectionIdsOk() (ret WafConfigPatchGetLogOnlyRuleCollectionIdsRetType, ok bool) { return getWafConfigPatchGetLogOnlyRuleCollectionIdsAttributeTypeOk(o.LogOnlyRuleCollectionIds) } // HasLogOnlyRuleCollectionIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasLogOnlyRuleCollectionIds() bool { _, ok := o.GetLogOnlyRuleCollectionIdsOk() return ok } // SetLogOnlyRuleCollectionIds gets a reference to the given []string and assigns it to the LogOnlyRuleCollectionIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetLogOnlyRuleCollectionIds(v WafConfigPatchGetLogOnlyRuleCollectionIdsRetType) { setWafConfigPatchGetLogOnlyRuleCollectionIdsAttributeType(&o.LogOnlyRuleCollectionIds, v) } // GetLogOnlyRuleGroupIds returns the LogOnlyRuleGroupIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetLogOnlyRuleGroupIds() (res WafConfigPatchGetLogOnlyRuleGroupIdsRetType) { res, _ = o.GetLogOnlyRuleGroupIdsOk() return @@ -600,22 +750,26 @@ func (o *WafConfigPatch) GetLogOnlyRuleGroupIds() (res WafConfigPatchGetLogOnlyR // GetLogOnlyRuleGroupIdsOk returns a tuple with the LogOnlyRuleGroupIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetLogOnlyRuleGroupIdsOk() (ret WafConfigPatchGetLogOnlyRuleGroupIdsRetType, ok bool) { return getWafConfigPatchGetLogOnlyRuleGroupIdsAttributeTypeOk(o.LogOnlyRuleGroupIds) } // HasLogOnlyRuleGroupIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasLogOnlyRuleGroupIds() bool { _, ok := o.GetLogOnlyRuleGroupIdsOk() return ok } // SetLogOnlyRuleGroupIds gets a reference to the given []string and assigns it to the LogOnlyRuleGroupIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetLogOnlyRuleGroupIds(v WafConfigPatchGetLogOnlyRuleGroupIdsRetType) { setWafConfigPatchGetLogOnlyRuleGroupIdsAttributeType(&o.LogOnlyRuleGroupIds, v) } // GetLogOnlyRuleIds returns the LogOnlyRuleIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetLogOnlyRuleIds() (res WafConfigPatchGetLogOnlyRuleIdsRetType) { res, _ = o.GetLogOnlyRuleIdsOk() return @@ -623,22 +777,26 @@ func (o *WafConfigPatch) GetLogOnlyRuleIds() (res WafConfigPatchGetLogOnlyRuleId // GetLogOnlyRuleIdsOk returns a tuple with the LogOnlyRuleIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetLogOnlyRuleIdsOk() (ret WafConfigPatchGetLogOnlyRuleIdsRetType, ok bool) { return getWafConfigPatchGetLogOnlyRuleIdsAttributeTypeOk(o.LogOnlyRuleIds) } // HasLogOnlyRuleIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasLogOnlyRuleIds() bool { _, ok := o.GetLogOnlyRuleIdsOk() return ok } // SetLogOnlyRuleIds gets a reference to the given []string and assigns it to the LogOnlyRuleIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetLogOnlyRuleIds(v WafConfigPatchGetLogOnlyRuleIdsRetType) { setWafConfigPatchGetLogOnlyRuleIdsAttributeType(&o.LogOnlyRuleIds, v) } // GetMode returns the Mode field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetMode() (res WafConfigPatchGetModeRetType) { res, _ = o.GetModeOk() return @@ -646,22 +804,26 @@ func (o *WafConfigPatch) GetMode() (res WafConfigPatchGetModeRetType) { // GetModeOk returns a tuple with the Mode field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetModeOk() (ret WafConfigPatchGetModeRetType, ok bool) { return getWafConfigPatchGetModeAttributeTypeOk(o.Mode) } // HasMode returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasMode() bool { _, ok := o.GetModeOk() return ok } // SetMode gets a reference to the given WafMode and assigns it to the Mode field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetMode(v WafConfigPatchGetModeRetType) { setWafConfigPatchGetModeAttributeType(&o.Mode, v) } // GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetParanoiaLevel() (res WafConfigPatchGetParanoiaLevelRetType) { res, _ = o.GetParanoiaLevelOk() return @@ -669,22 +831,26 @@ func (o *WafConfigPatch) GetParanoiaLevel() (res WafConfigPatchGetParanoiaLevelR // GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetParanoiaLevelOk() (ret WafConfigPatchGetParanoiaLevelRetType, ok bool) { return getWafConfigPatchGetParanoiaLevelAttributeTypeOk(o.ParanoiaLevel) } // HasParanoiaLevel returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasParanoiaLevel() bool { _, ok := o.GetParanoiaLevelOk() return ok } // SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetParanoiaLevel(v WafConfigPatchGetParanoiaLevelRetType) { setWafConfigPatchGetParanoiaLevelAttributeType(&o.ParanoiaLevel, v) } // GetType returns the Type field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetType() (res WafConfigPatchGetTypeRetType) { res, _ = o.GetTypeOk() return @@ -692,21 +858,25 @@ func (o *WafConfigPatch) GetType() (res WafConfigPatchGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) GetTypeOk() (ret WafConfigPatchGetTypeRetType, ok bool) { return getWafConfigPatchGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) HasType() bool { _, ok := o.GetTypeOk() return ok } // SetType gets a reference to the given WafType and assigns it to the Type field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafConfigPatch) SetType(v WafConfigPatchGetTypeRetType) { setWafConfigPatchGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafConfigPatch) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafConfigPatchGetAllowedHttpMethodsAttributeTypeOk(o.AllowedHttpMethods); ok { @@ -757,37 +927,45 @@ func (o WafConfigPatch) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafConfigPatch struct { value *WafConfigPatch isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafConfigPatch) Get() *WafConfigPatch { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafConfigPatch) Set(val *WafConfigPatch) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafConfigPatch) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafConfigPatch) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafConfigPatch(val *WafConfigPatch) *NullableWafConfigPatch { return &NullableWafConfigPatch{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafConfigPatch) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafConfigPatch) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_mode.go b/services/cdn/model_waf_mode.go index aa0831298..5211a35fb 100644 --- a/services/cdn/model_waf_mode.go +++ b/services/cdn/model_waf_mode.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,22 +17,28 @@ import ( ) // WafMode - `ENABLED`: The WAF actively inspects and blocks malicious requests. - `DISABLED`: The WAF is completely off. No inspection occurs. - `LOG_ONLY`: The WAF inspects requests and logs matches but never blocks. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafMode string // List of WafMode const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFMODE_DISABLED WafMode = "DISABLED" - WAFMODE_ENABLED WafMode = "ENABLED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + WAFMODE_ENABLED WafMode = "ENABLED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFMODE_LOG_ONLY WafMode = "LOG_ONLY" ) // All allowed values of WafMode enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedWafModeEnumValues = []WafMode{ "DISABLED", "ENABLED", "LOG_ONLY", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *WafMode) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -56,6 +63,7 @@ func (v *WafMode) UnmarshalJSON(src []byte) error { // NewWafModeFromValue returns a pointer to a valid WafMode // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafModeFromValue(v string) (*WafMode, error) { ev := WafMode(v) if ev.IsValid() { @@ -66,6 +74,7 @@ func NewWafModeFromValue(v string) (*WafMode, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v WafMode) IsValid() bool { for _, existing := range AllowedWafModeEnumValues { if existing == v { @@ -76,41 +85,50 @@ func (v WafMode) IsValid() bool { } // Ptr returns reference to WafMode value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v WafMode) Ptr() *WafMode { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafMode struct { value *WafMode isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafMode) Get() *WafMode { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafMode) Set(val *WafMode) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafMode) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafMode) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafMode(val *WafMode) *NullableWafMode { return &NullableWafMode{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafMode) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafMode) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_paranoia_level.go b/services/cdn/model_waf_paranoia_level.go index 3fcbee8df..dbd07141d 100644 --- a/services/cdn/model_waf_paranoia_level.go +++ b/services/cdn/model_waf_paranoia_level.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,17 +17,23 @@ import ( ) // WafParanoiaLevel The paranoia level defines how aggressively the WAF should action on requests. It ranges from `L1` (least strict, lowest chance of false positives) to `L4` (most strict, highest chance of false positives). A higher paranoia level is more effective at catching attacks but can also block legitimate traffic. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafParanoiaLevel string // List of WafParanoiaLevel const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFPARANOIALEVEL_L1 WafParanoiaLevel = "L1" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFPARANOIALEVEL_L2 WafParanoiaLevel = "L2" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFPARANOIALEVEL_L3 WafParanoiaLevel = "L3" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFPARANOIALEVEL_L4 WafParanoiaLevel = "L4" ) // All allowed values of WafParanoiaLevel enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedWafParanoiaLevelEnumValues = []WafParanoiaLevel{ "L1", "L2", @@ -34,6 +41,7 @@ var AllowedWafParanoiaLevelEnumValues = []WafParanoiaLevel{ "L4", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *WafParanoiaLevel) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -58,6 +66,7 @@ func (v *WafParanoiaLevel) UnmarshalJSON(src []byte) error { // NewWafParanoiaLevelFromValue returns a pointer to a valid WafParanoiaLevel // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafParanoiaLevelFromValue(v string) (*WafParanoiaLevel, error) { ev := WafParanoiaLevel(v) if ev.IsValid() { @@ -68,6 +77,7 @@ func NewWafParanoiaLevelFromValue(v string) (*WafParanoiaLevel, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v WafParanoiaLevel) IsValid() bool { for _, existing := range AllowedWafParanoiaLevelEnumValues { if existing == v { @@ -78,41 +88,50 @@ func (v WafParanoiaLevel) IsValid() bool { } // Ptr returns reference to WafParanoiaLevel value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v WafParanoiaLevel) Ptr() *WafParanoiaLevel { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafParanoiaLevel struct { value *WafParanoiaLevel isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafParanoiaLevel) Get() *WafParanoiaLevel { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafParanoiaLevel) Set(val *WafParanoiaLevel) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafParanoiaLevel) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafParanoiaLevel) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafParanoiaLevel(val *WafParanoiaLevel) *NullableWafParanoiaLevel { return &NullableWafParanoiaLevel{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafParanoiaLevel) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafParanoiaLevel) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_rule.go b/services/cdn/model_waf_rule.go index faa854c8c..98e43f6f6 100644 --- a/services/cdn/model_waf_rule.go +++ b/services/cdn/model_waf_rule.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &WafRule{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetCodeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleGetCodeAttributeTypeOk(arg WafRuleGetCodeAttributeType) (ret WafRuleGetCodeRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getWafRuleGetCodeAttributeTypeOk(arg WafRuleGetCodeAttributeType) (ret WafR return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleGetCodeAttributeType(arg *WafRuleGetCodeAttributeType, val WafRuleGetCodeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetCodeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetCodeRetType = string /* @@ -43,10 +50,16 @@ type WafRuleGetCodeRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetDescriptionAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetDescriptionArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetDescriptionRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleGetDescriptionAttributeTypeOk(arg WafRuleGetDescriptionAttributeType) (ret WafRuleGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getWafRuleGetDescriptionAttributeTypeOk(arg WafRuleGetDescriptionAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleGetDescriptionAttributeType(arg *WafRuleGetDescriptionAttributeType, val WafRuleGetDescriptionRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setWafRuleGetDescriptionAttributeType(arg *WafRuleGetDescriptionAttributeTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleGetIdAttributeTypeOk(arg WafRuleGetIdAttributeType) (ret WafRuleGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getWafRuleGetIdAttributeTypeOk(arg WafRuleGetIdAttributeType) (ret WafRuleG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleGetIdAttributeType(arg *WafRuleGetIdAttributeType, val WafRuleGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGetIdRetType = string // WafRule struct for WafRule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRule struct { // Optional CoreRuleSet rule Id in case this is a CRS rule Code WafRuleGetCodeAttributeType `json:"code,omitempty"` @@ -90,12 +111,14 @@ type WafRule struct { Id WafRuleGetIdAttributeType `json:"id" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafRule WafRule // NewWafRule instantiates a new WafRule 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafRule(description WafRuleGetDescriptionArgType, id WafRuleGetIdArgType) *WafRule { this := WafRule{} setWafRuleGetDescriptionAttributeType(&this.Description, description) @@ -106,12 +129,14 @@ func NewWafRule(description WafRuleGetDescriptionArgType, id WafRuleGetIdArgType // NewWafRuleWithDefaults instantiates a new WafRule 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafRuleWithDefaults() *WafRule { this := WafRule{} return &this } // GetCode returns the Code field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) GetCode() (res WafRuleGetCodeRetType) { res, _ = o.GetCodeOk() return @@ -119,22 +144,26 @@ func (o *WafRule) GetCode() (res WafRuleGetCodeRetType) { // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) GetCodeOk() (ret WafRuleGetCodeRetType, ok bool) { return getWafRuleGetCodeAttributeTypeOk(o.Code) } // HasCode returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) HasCode() bool { _, ok := o.GetCodeOk() return ok } // SetCode gets a reference to the given string and assigns it to the Code field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) SetCode(v WafRuleGetCodeRetType) { setWafRuleGetCodeAttributeType(&o.Code, v) } // GetDescription returns the Description field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) GetDescription() (ret WafRuleGetDescriptionRetType) { ret, _ = o.GetDescriptionOk() return ret @@ -142,16 +171,19 @@ func (o *WafRule) GetDescription() (ret WafRuleGetDescriptionRetType) { // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) GetDescriptionOk() (ret WafRuleGetDescriptionRetType, ok bool) { return getWafRuleGetDescriptionAttributeTypeOk(o.Description) } // SetDescription sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) SetDescription(v WafRuleGetDescriptionRetType) { setWafRuleGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) GetId() (ret WafRuleGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -159,15 +191,18 @@ func (o *WafRule) GetId() (ret WafRuleGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) GetIdOk() (ret WafRuleGetIdRetType, ok bool) { return getWafRuleGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRule) SetId(v WafRuleGetIdRetType) { setWafRuleGetIdAttributeType(&o.Id, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafRule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafRuleGetCodeAttributeTypeOk(o.Code); ok { @@ -182,37 +217,45 @@ func (o WafRule) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafRule struct { value *WafRule isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRule) Get() *WafRule { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRule) Set(val *WafRule) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRule) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRule) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafRule(val *WafRule) *NullableWafRule { return &NullableWafRule{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRule) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRule) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_rule_action.go b/services/cdn/model_waf_rule_action.go index 0c65fc190..3a3a74dd2 100644 --- a/services/cdn/model_waf_rule_action.go +++ b/services/cdn/model_waf_rule_action.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,22 +17,28 @@ import ( ) // WAFRuleAction The action a WAF rule can take based on a request +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFRuleAction string // List of WAFRuleAction const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFRULEACTION_BLOCKED WAFRuleAction = "BLOCKED" - WAFRULEACTION_LOGGED WAFRuleAction = "LOGGED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + WAFRULEACTION_LOGGED WAFRuleAction = "LOGGED" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFRULEACTION_ALLOWED WAFRuleAction = "ALLOWED" ) // All allowed values of WAFRuleAction enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedWAFRuleActionEnumValues = []WAFRuleAction{ "BLOCKED", "LOGGED", "ALLOWED", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *WAFRuleAction) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -56,6 +63,7 @@ func (v *WAFRuleAction) UnmarshalJSON(src []byte) error { // NewWAFRuleActionFromValue returns a pointer to a valid WAFRuleAction // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWAFRuleActionFromValue(v string) (*WAFRuleAction, error) { ev := WAFRuleAction(v) if ev.IsValid() { @@ -66,6 +74,7 @@ func NewWAFRuleActionFromValue(v string) (*WAFRuleAction, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v WAFRuleAction) IsValid() bool { for _, existing := range AllowedWAFRuleActionEnumValues { if existing == v { @@ -76,41 +85,50 @@ func (v WAFRuleAction) IsValid() bool { } // Ptr returns reference to WAFRuleAction value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v WAFRuleAction) Ptr() *WAFRuleAction { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWAFRuleAction struct { value *WAFRuleAction isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWAFRuleAction) Get() *WAFRuleAction { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWAFRuleAction) Set(val *WAFRuleAction) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWAFRuleAction) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWAFRuleAction) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWAFRuleAction(val *WAFRuleAction) *NullableWAFRuleAction { return &NullableWAFRuleAction{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWAFRuleAction) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWAFRuleAction) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_rule_collection.go b/services/cdn/model_waf_rule_collection.go index f5a76d08b..16702b207 100644 --- a/services/cdn/model_waf_rule_collection.go +++ b/services/cdn/model_waf_rule_collection.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &WafRuleCollection{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetGroupsAttributeType = *[]WafRuleGroup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetGroupsArgType = []WafRuleGroup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetGroupsRetType = []WafRuleGroup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleCollectionGetGroupsAttributeTypeOk(arg WafRuleCollectionGetGroupsAttributeType) (ret WafRuleCollectionGetGroupsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getWafRuleCollectionGetGroupsAttributeTypeOk(arg WafRuleCollectionGetGroups return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleCollectionGetGroupsAttributeType(arg *WafRuleCollectionGetGroupsAttributeType, val WafRuleCollectionGetGroupsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setWafRuleCollectionGetGroupsAttributeType(arg *WafRuleCollectionGetGroupsA */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleCollectionGetIdAttributeTypeOk(arg WafRuleCollectionGetIdAttributeType) (ret WafRuleCollectionGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getWafRuleCollectionGetIdAttributeTypeOk(arg WafRuleCollectionGetIdAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleCollectionGetIdAttributeType(arg *WafRuleCollectionGetIdAttributeType, val WafRuleCollectionGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetIdRetType = string /* @@ -63,10 +77,16 @@ type WafRuleCollectionGetIdRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetNameAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetNameArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollectionGetNameRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleCollectionGetNameAttributeTypeOk(arg WafRuleCollectionGetNameAttributeType) (ret WafRuleCollectionGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +94,13 @@ func getWafRuleCollectionGetNameAttributeTypeOk(arg WafRuleCollectionGetNameAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleCollectionGetNameAttributeType(arg *WafRuleCollectionGetNameAttributeType, val WafRuleCollectionGetNameRetType) { *arg = &val } // WafRuleCollection struct for WafRuleCollection +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleCollection struct { // REQUIRED Groups WafRuleCollectionGetGroupsAttributeType `json:"groups" required:"true"` @@ -89,12 +111,14 @@ type WafRuleCollection struct { Name WafRuleCollectionGetNameAttributeType `json:"name" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafRuleCollection WafRuleCollection // NewWafRuleCollection instantiates a new WafRuleCollection 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafRuleCollection(groups WafRuleCollectionGetGroupsArgType, id WafRuleCollectionGetIdArgType, name WafRuleCollectionGetNameArgType) *WafRuleCollection { this := WafRuleCollection{} setWafRuleCollectionGetGroupsAttributeType(&this.Groups, groups) @@ -106,12 +130,14 @@ func NewWafRuleCollection(groups WafRuleCollectionGetGroupsArgType, id WafRuleCo // NewWafRuleCollectionWithDefaults instantiates a new WafRuleCollection 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafRuleCollectionWithDefaults() *WafRuleCollection { this := WafRuleCollection{} return &this } // GetGroups returns the Groups field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) GetGroups() (ret WafRuleCollectionGetGroupsRetType) { ret, _ = o.GetGroupsOk() return ret @@ -119,16 +145,19 @@ func (o *WafRuleCollection) GetGroups() (ret WafRuleCollectionGetGroupsRetType) // GetGroupsOk returns a tuple with the Groups field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) GetGroupsOk() (ret WafRuleCollectionGetGroupsRetType, ok bool) { return getWafRuleCollectionGetGroupsAttributeTypeOk(o.Groups) } // SetGroups sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) SetGroups(v WafRuleCollectionGetGroupsRetType) { setWafRuleCollectionGetGroupsAttributeType(&o.Groups, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) GetId() (ret WafRuleCollectionGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -136,16 +165,19 @@ func (o *WafRuleCollection) GetId() (ret WafRuleCollectionGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) GetIdOk() (ret WafRuleCollectionGetIdRetType, ok bool) { return getWafRuleCollectionGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) SetId(v WafRuleCollectionGetIdRetType) { setWafRuleCollectionGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) GetName() (ret WafRuleCollectionGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -153,15 +185,18 @@ func (o *WafRuleCollection) GetName() (ret WafRuleCollectionGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) GetNameOk() (ret WafRuleCollectionGetNameRetType, ok bool) { return getWafRuleCollectionGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleCollection) SetName(v WafRuleCollectionGetNameRetType) { setWafRuleCollectionGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafRuleCollection) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafRuleCollectionGetGroupsAttributeTypeOk(o.Groups); ok { @@ -176,37 +211,45 @@ func (o WafRuleCollection) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafRuleCollection struct { value *WafRuleCollection isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRuleCollection) Get() *WafRuleCollection { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRuleCollection) Set(val *WafRuleCollection) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRuleCollection) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRuleCollection) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafRuleCollection(val *WafRuleCollection) *NullableWafRuleCollection { return &NullableWafRuleCollection{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRuleCollection) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRuleCollection) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_rule_group.go b/services/cdn/model_waf_rule_group.go index 7b1141be5..d1b1b8b0a 100644 --- a/services/cdn/model_waf_rule_group.go +++ b/services/cdn/model_waf_rule_group.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &WafRuleGroup{} */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetDescriptionAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetDescriptionArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetDescriptionRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleGroupGetDescriptionAttributeTypeOk(arg WafRuleGroupGetDescriptionAttributeType) (ret WafRuleGroupGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getWafRuleGroupGetDescriptionAttributeTypeOk(arg WafRuleGroupGetDescription return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleGroupGetDescriptionAttributeType(arg *WafRuleGroupGetDescriptionAttributeType, val WafRuleGroupGetDescriptionRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setWafRuleGroupGetDescriptionAttributeType(arg *WafRuleGroupGetDescriptionA */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetNameAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetNameArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetNameRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleGroupGetNameAttributeTypeOk(arg WafRuleGroupGetNameAttributeType) (ret WafRuleGroupGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getWafRuleGroupGetNameAttributeTypeOk(arg WafRuleGroupGetNameAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleGroupGetNameAttributeType(arg *WafRuleGroupGetNameAttributeType, val WafRuleGroupGetNameRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setWafRuleGroupGetNameAttributeType(arg *WafRuleGroupGetNameAttributeType, */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetRulesAttributeType = *[]WafRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetRulesArgType = []WafRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroupGetRulesRetType = []WafRule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafRuleGroupGetRulesAttributeTypeOk(arg WafRuleGroupGetRulesAttributeType) (ret WafRuleGroupGetRulesRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +94,13 @@ func getWafRuleGroupGetRulesAttributeTypeOk(arg WafRuleGroupGetRulesAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafRuleGroupGetRulesAttributeType(arg *WafRuleGroupGetRulesAttributeType, val WafRuleGroupGetRulesRetType) { *arg = &val } // WafRuleGroup struct for WafRuleGroup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafRuleGroup struct { // LocalizedString is a map from language to string value // REQUIRED @@ -89,12 +112,14 @@ type WafRuleGroup struct { Rules WafRuleGroupGetRulesAttributeType `json:"rules" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafRuleGroup WafRuleGroup // NewWafRuleGroup instantiates a new WafRuleGroup 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafRuleGroup(description WafRuleGroupGetDescriptionArgType, name WafRuleGroupGetNameArgType, rules WafRuleGroupGetRulesArgType) *WafRuleGroup { this := WafRuleGroup{} setWafRuleGroupGetDescriptionAttributeType(&this.Description, description) @@ -106,12 +131,14 @@ func NewWafRuleGroup(description WafRuleGroupGetDescriptionArgType, name WafRule // NewWafRuleGroupWithDefaults instantiates a new WafRuleGroup 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafRuleGroupWithDefaults() *WafRuleGroup { this := WafRuleGroup{} return &this } // GetDescription returns the Description field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) GetDescription() (ret WafRuleGroupGetDescriptionRetType) { ret, _ = o.GetDescriptionOk() return ret @@ -119,16 +146,19 @@ func (o *WafRuleGroup) GetDescription() (ret WafRuleGroupGetDescriptionRetType) // GetDescriptionOk returns a tuple with the Description field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) GetDescriptionOk() (ret WafRuleGroupGetDescriptionRetType, ok bool) { return getWafRuleGroupGetDescriptionAttributeTypeOk(o.Description) } // SetDescription sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) SetDescription(v WafRuleGroupGetDescriptionRetType) { setWafRuleGroupGetDescriptionAttributeType(&o.Description, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) GetName() (ret WafRuleGroupGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -136,16 +166,19 @@ func (o *WafRuleGroup) GetName() (ret WafRuleGroupGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) GetNameOk() (ret WafRuleGroupGetNameRetType, ok bool) { return getWafRuleGroupGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) SetName(v WafRuleGroupGetNameRetType) { setWafRuleGroupGetNameAttributeType(&o.Name, v) } // GetRules returns the Rules field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) GetRules() (ret WafRuleGroupGetRulesRetType) { ret, _ = o.GetRulesOk() return ret @@ -153,15 +186,18 @@ func (o *WafRuleGroup) GetRules() (ret WafRuleGroupGetRulesRetType) { // GetRulesOk returns a tuple with the Rules field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) GetRulesOk() (ret WafRuleGroupGetRulesRetType, ok bool) { return getWafRuleGroupGetRulesAttributeTypeOk(o.Rules) } // SetRules sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafRuleGroup) SetRules(v WafRuleGroupGetRulesRetType) { setWafRuleGroupGetRulesAttributeType(&o.Rules, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafRuleGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafRuleGroupGetDescriptionAttributeTypeOk(o.Description); ok { @@ -176,37 +212,45 @@ func (o WafRuleGroup) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafRuleGroup struct { value *WafRuleGroup isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRuleGroup) Get() *WafRuleGroup { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRuleGroup) Set(val *WafRuleGroup) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRuleGroup) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRuleGroup) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafRuleGroup(val *WafRuleGroup) *NullableWafRuleGroup { return &NullableWafRuleGroup{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafRuleGroup) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafRuleGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_status_rule_block.go b/services/cdn/model_waf_status_rule_block.go index 0c45fb1a0..c1fb1c44c 100644 --- a/services/cdn/model_waf_status_rule_block.go +++ b/services/cdn/model_waf_status_rule_block.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &WafStatusRuleBlock{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockGetIdAttributeTypeOk(arg WafStatusRuleBlockGetIdAttributeType) (ret WafStatusRuleBlockGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getWafStatusRuleBlockGetIdAttributeTypeOk(arg WafStatusRuleBlockGetIdAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockGetIdAttributeType(arg *WafStatusRuleBlockGetIdAttributeType, val WafStatusRuleBlockGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockGetIdRetType = string /* @@ -43,10 +50,16 @@ type WafStatusRuleBlockGetIdRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockGetReasonAttributeType = *WafStatusRuleBlockReason + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockGetReasonArgType = WafStatusRuleBlockReason + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockGetReasonRetType = WafStatusRuleBlockReason +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockGetReasonAttributeTypeOk(arg WafStatusRuleBlockGetReasonAttributeType) (ret WafStatusRuleBlockGetReasonRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getWafStatusRuleBlockGetReasonAttributeTypeOk(arg WafStatusRuleBlockGetReas return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockGetReasonAttributeType(arg *WafStatusRuleBlockGetReasonAttributeType, val WafStatusRuleBlockGetReasonRetType) { *arg = &val } // WafStatusRuleBlock struct for WafStatusRuleBlock +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlock struct { // Specifies the Id of the Rule. // REQUIRED @@ -67,12 +82,14 @@ type WafStatusRuleBlock struct { Reason WafStatusRuleBlockGetReasonAttributeType `json:"reason" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafStatusRuleBlock WafStatusRuleBlock // NewWafStatusRuleBlock instantiates a new WafStatusRuleBlock 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlock(id WafStatusRuleBlockGetIdArgType, reason WafStatusRuleBlockGetReasonArgType) *WafStatusRuleBlock { this := WafStatusRuleBlock{} setWafStatusRuleBlockGetIdAttributeType(&this.Id, id) @@ -83,12 +100,14 @@ func NewWafStatusRuleBlock(id WafStatusRuleBlockGetIdArgType, reason WafStatusRu // NewWafStatusRuleBlockWithDefaults instantiates a new WafStatusRuleBlock 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockWithDefaults() *WafStatusRuleBlock { this := WafStatusRuleBlock{} return &this } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlock) GetId() (ret WafStatusRuleBlockGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -96,16 +115,19 @@ func (o *WafStatusRuleBlock) GetId() (ret WafStatusRuleBlockGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlock) GetIdOk() (ret WafStatusRuleBlockGetIdRetType, ok bool) { return getWafStatusRuleBlockGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlock) SetId(v WafStatusRuleBlockGetIdRetType) { setWafStatusRuleBlockGetIdAttributeType(&o.Id, v) } // GetReason returns the Reason field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlock) GetReason() (ret WafStatusRuleBlockGetReasonRetType) { ret, _ = o.GetReasonOk() return ret @@ -113,15 +135,18 @@ func (o *WafStatusRuleBlock) GetReason() (ret WafStatusRuleBlockGetReasonRetType // GetReasonOk returns a tuple with the Reason field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlock) GetReasonOk() (ret WafStatusRuleBlockGetReasonRetType, ok bool) { return getWafStatusRuleBlockGetReasonAttributeTypeOk(o.Reason) } // SetReason sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlock) SetReason(v WafStatusRuleBlockGetReasonRetType) { setWafStatusRuleBlockGetReasonAttributeType(&o.Reason, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafStatusRuleBlock) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafStatusRuleBlockGetIdAttributeTypeOk(o.Id); ok { @@ -133,37 +158,45 @@ func (o WafStatusRuleBlock) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafStatusRuleBlock struct { value *WafStatusRuleBlock isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlock) Get() *WafStatusRuleBlock { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlock) Set(val *WafStatusRuleBlock) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlock) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlock) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafStatusRuleBlock(val *WafStatusRuleBlock) *NullableWafStatusRuleBlock { return &NullableWafStatusRuleBlock{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlock) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlock) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_status_rule_block_reason.go b/services/cdn/model_waf_status_rule_block_reason.go index 0108e7443..b5450799c 100644 --- a/services/cdn/model_waf_status_rule_block_reason.go +++ b/services/cdn/model_waf_status_rule_block_reason.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,6 +17,7 @@ import ( ) // WafStatusRuleBlockReason - Defines the Reason why a Rule is in the specified state (set to be enabled, disabled or logOnly). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReason struct { WafStatusRuleBlockReasonDirectlyDefined *WafStatusRuleBlockReasonDirectlyDefined WafStatusRuleBlockReasonInheritedFromCollection *WafStatusRuleBlockReasonInheritedFromCollection @@ -25,6 +27,7 @@ type WafStatusRuleBlockReason struct { } // WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonDirectlyDefined wrapped in WafStatusRuleBlockReason +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonDirectlyDefined) WafStatusRuleBlockReason { return WafStatusRuleBlockReason{ WafStatusRuleBlockReasonDirectlyDefined: v, @@ -32,6 +35,7 @@ func WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason(v *WafSta } // WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInheritedFromCollection wrapped in WafStatusRuleBlockReason +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInheritedFromCollection) WafStatusRuleBlockReason { return WafStatusRuleBlockReason{ WafStatusRuleBlockReasonInheritedFromCollection: v, @@ -39,6 +43,7 @@ func WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason(v } // WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInheritedFromGroup wrapped in WafStatusRuleBlockReason +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInheritedFromGroup) WafStatusRuleBlockReason { return WafStatusRuleBlockReason{ WafStatusRuleBlockReasonInheritedFromGroup: v, @@ -46,6 +51,7 @@ func WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason(v *Waf } // WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInvalidWafType wrapped in WafStatusRuleBlockReason +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInvalidWafType) WafStatusRuleBlockReason { return WafStatusRuleBlockReason{ WafStatusRuleBlockReasonInvalidWafType: v, @@ -53,6 +59,7 @@ func WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason(v *WafStat } // WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonNeverDefined wrapped in WafStatusRuleBlockReason +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonNeverDefined) WafStatusRuleBlockReason { return WafStatusRuleBlockReason{ WafStatusRuleBlockReasonNeverDefined: v, @@ -60,6 +67,7 @@ func WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason(v *WafStatus } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *WafStatusRuleBlockReason) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -194,6 +202,7 @@ func (dst *WafStatusRuleBlockReason) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src WafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.WafStatusRuleBlockReasonDirectlyDefined != nil { return json.Marshal(&src.WafStatusRuleBlockReasonDirectlyDefined) } @@ -218,6 +227,7 @@ func (src WafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *WafStatusRuleBlockReason) GetActualInstance() interface{} { if obj == nil { return nil @@ -246,37 +256,45 @@ func (obj *WafStatusRuleBlockReason) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafStatusRuleBlockReason struct { value *WafStatusRuleBlockReason isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReason) Get() *WafStatusRuleBlockReason { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReason) Set(val *WafStatusRuleBlockReason) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReason) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReason) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafStatusRuleBlockReason(val *WafStatusRuleBlockReason) *NullableWafStatusRuleBlockReason { return &NullableWafStatusRuleBlockReason{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReason) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_status_rule_block_reason_directly_defined.go b/services/cdn/model_waf_status_rule_block_reason_directly_defined.go index 94dbe8995..8b0e611c5 100644 --- a/services/cdn/model_waf_status_rule_block_reason_directly_defined.go +++ b/services/cdn/model_waf_status_rule_block_reason_directly_defined.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &WafStatusRuleBlockReasonDirectlyDefined{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeTypeOk(arg WafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeType) (ret WafStatusRuleBlockReasonDirectlyDefinedGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,26 +34,33 @@ func getWafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeTypeOk(arg WafSta return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeType(arg *WafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeType, val WafStatusRuleBlockReasonDirectlyDefinedGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonDirectlyDefinedGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonDirectlyDefinedGetTypeRetType = string // WafStatusRuleBlockReasonDirectlyDefined struct for WafStatusRuleBlockReasonDirectlyDefined +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonDirectlyDefined struct { // This is always `directlyDefined` // REQUIRED Type WafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafStatusRuleBlockReasonDirectlyDefined WafStatusRuleBlockReasonDirectlyDefined // NewWafStatusRuleBlockReasonDirectlyDefined instantiates a new WafStatusRuleBlockReasonDirectlyDefined 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonDirectlyDefined(types WafStatusRuleBlockReasonDirectlyDefinedGetTypeArgType) *WafStatusRuleBlockReasonDirectlyDefined { this := WafStatusRuleBlockReasonDirectlyDefined{} setWafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeType(&this.Type, types) @@ -60,12 +70,14 @@ func NewWafStatusRuleBlockReasonDirectlyDefined(types WafStatusRuleBlockReasonDi // NewWafStatusRuleBlockReasonDirectlyDefinedWithDefaults instantiates a new WafStatusRuleBlockReasonDirectlyDefined 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonDirectlyDefinedWithDefaults() *WafStatusRuleBlockReasonDirectlyDefined { this := WafStatusRuleBlockReasonDirectlyDefined{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonDirectlyDefined) GetType() (ret WafStatusRuleBlockReasonDirectlyDefinedGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -73,15 +85,18 @@ func (o *WafStatusRuleBlockReasonDirectlyDefined) GetType() (ret WafStatusRuleBl // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonDirectlyDefined) GetTypeOk() (ret WafStatusRuleBlockReasonDirectlyDefinedGetTypeRetType, ok bool) { return getWafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonDirectlyDefined) SetType(v WafStatusRuleBlockReasonDirectlyDefinedGetTypeRetType) { setWafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafStatusRuleBlockReasonDirectlyDefined) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafStatusRuleBlockReasonDirectlyDefinedGetTypeAttributeTypeOk(o.Type); ok { @@ -90,37 +105,45 @@ func (o WafStatusRuleBlockReasonDirectlyDefined) ToMap() (map[string]interface{} return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafStatusRuleBlockReasonDirectlyDefined struct { value *WafStatusRuleBlockReasonDirectlyDefined isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonDirectlyDefined) Get() *WafStatusRuleBlockReasonDirectlyDefined { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) Set(val *WafStatusRuleBlockReasonDirectlyDefined) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonDirectlyDefined) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafStatusRuleBlockReasonDirectlyDefined(val *WafStatusRuleBlockReasonDirectlyDefined) *NullableWafStatusRuleBlockReasonDirectlyDefined { return &NullableWafStatusRuleBlockReasonDirectlyDefined{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonDirectlyDefined) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_status_rule_block_reason_inherited_from_collection.go b/services/cdn/model_waf_status_rule_block_reason_inherited_from_collection.go index 63df54ba1..3919c1360 100644 --- a/services/cdn/model_waf_status_rule_block_reason_inherited_from_collection.go +++ b/services/cdn/model_waf_status_rule_block_reason_inherited_from_collection.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &WafStatusRuleBlockReasonInheritedFromCollection{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeTypeOk(arg WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeType) (ret WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getWafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeType(arg *WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeType, val WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdRetType = string /* @@ -43,8 +50,10 @@ type WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdRetType = str */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeTypeOk(arg WafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeType) (ret WafStatusRuleBlockReasonInheritedFromCollectionGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getWafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeTypeOk(ar return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeType(arg *WafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeType, val WafStatusRuleBlockReasonInheritedFromCollectionGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromCollectionGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromCollectionGetTypeRetType = string // WafStatusRuleBlockReasonInheritedFromCollection struct for WafStatusRuleBlockReasonInheritedFromCollection +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromCollection struct { // The Collection that caused this rule to be in its current state. // REQUIRED @@ -69,12 +83,14 @@ type WafStatusRuleBlockReasonInheritedFromCollection struct { Type WafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafStatusRuleBlockReasonInheritedFromCollection WafStatusRuleBlockReasonInheritedFromCollection // NewWafStatusRuleBlockReasonInheritedFromCollection instantiates a new WafStatusRuleBlockReasonInheritedFromCollection 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonInheritedFromCollection(collectionId WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdArgType, types WafStatusRuleBlockReasonInheritedFromCollectionGetTypeArgType) *WafStatusRuleBlockReasonInheritedFromCollection { this := WafStatusRuleBlockReasonInheritedFromCollection{} setWafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeType(&this.CollectionId, collectionId) @@ -85,12 +101,14 @@ func NewWafStatusRuleBlockReasonInheritedFromCollection(collectionId WafStatusRu // NewWafStatusRuleBlockReasonInheritedFromCollectionWithDefaults instantiates a new WafStatusRuleBlockReasonInheritedFromCollection 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonInheritedFromCollectionWithDefaults() *WafStatusRuleBlockReasonInheritedFromCollection { this := WafStatusRuleBlockReasonInheritedFromCollection{} return &this } // GetCollectionId returns the CollectionId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionId() (ret WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdRetType) { ret, _ = o.GetCollectionIdOk() return ret @@ -98,16 +116,19 @@ func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionId() (ret // GetCollectionIdOk returns a tuple with the CollectionId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionIdOk() (ret WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdRetType, ok bool) { return getWafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeTypeOk(o.CollectionId) } // SetCollectionId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromCollection) SetCollectionId(v WafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdRetType) { setWafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeType(&o.CollectionId, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetType() (ret WafStatusRuleBlockReasonInheritedFromCollectionGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -115,15 +136,18 @@ func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetType() (ret WafStat // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetTypeOk() (ret WafStatusRuleBlockReasonInheritedFromCollectionGetTypeRetType, ok bool) { return getWafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromCollection) SetType(v WafStatusRuleBlockReasonInheritedFromCollectionGetTypeRetType) { setWafStatusRuleBlockReasonInheritedFromCollectionGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafStatusRuleBlockReasonInheritedFromCollection) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafStatusRuleBlockReasonInheritedFromCollectionGetCollectionIdAttributeTypeOk(o.CollectionId); ok { @@ -135,37 +159,45 @@ func (o WafStatusRuleBlockReasonInheritedFromCollection) ToMap() (map[string]int return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafStatusRuleBlockReasonInheritedFromCollection struct { value *WafStatusRuleBlockReasonInheritedFromCollection isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) Get() *WafStatusRuleBlockReasonInheritedFromCollection { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) Set(val *WafStatusRuleBlockReasonInheritedFromCollection) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafStatusRuleBlockReasonInheritedFromCollection(val *WafStatusRuleBlockReasonInheritedFromCollection) *NullableWafStatusRuleBlockReasonInheritedFromCollection { return &NullableWafStatusRuleBlockReasonInheritedFromCollection{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_status_rule_block_reason_inherited_from_group.go b/services/cdn/model_waf_status_rule_block_reason_inherited_from_group.go index f18ac6958..eb1f3b6fa 100644 --- a/services/cdn/model_waf_status_rule_block_reason_inherited_from_group.go +++ b/services/cdn/model_waf_status_rule_block_reason_inherited_from_group.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &WafStatusRuleBlockReasonInheritedFromGroup{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeTypeOk(arg WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeType) (ret WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getWafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeTypeOk(arg return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeType(arg *WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeType, val WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdRetType = string /* @@ -43,8 +50,10 @@ type WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeTypeOk(arg WafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeType) (ret WafStatusRuleBlockReasonInheritedFromGroupGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getWafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeTypeOk(arg Waf return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeType(arg *WafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeType, val WafStatusRuleBlockReasonInheritedFromGroupGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromGroupGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromGroupGetTypeRetType = string // WafStatusRuleBlockReasonInheritedFromGroup struct for WafStatusRuleBlockReasonInheritedFromGroup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInheritedFromGroup struct { // The Group that caused this rule to be in its current state. // REQUIRED @@ -69,12 +83,14 @@ type WafStatusRuleBlockReasonInheritedFromGroup struct { Type WafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafStatusRuleBlockReasonInheritedFromGroup WafStatusRuleBlockReasonInheritedFromGroup // NewWafStatusRuleBlockReasonInheritedFromGroup instantiates a new WafStatusRuleBlockReasonInheritedFromGroup 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonInheritedFromGroup(groupId WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdArgType, types WafStatusRuleBlockReasonInheritedFromGroupGetTypeArgType) *WafStatusRuleBlockReasonInheritedFromGroup { this := WafStatusRuleBlockReasonInheritedFromGroup{} setWafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeType(&this.GroupId, groupId) @@ -85,12 +101,14 @@ func NewWafStatusRuleBlockReasonInheritedFromGroup(groupId WafStatusRuleBlockRea // NewWafStatusRuleBlockReasonInheritedFromGroupWithDefaults instantiates a new WafStatusRuleBlockReasonInheritedFromGroup 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonInheritedFromGroupWithDefaults() *WafStatusRuleBlockReasonInheritedFromGroup { this := WafStatusRuleBlockReasonInheritedFromGroup{} return &this } // GetGroupId returns the GroupId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupId() (ret WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdRetType) { ret, _ = o.GetGroupIdOk() return ret @@ -98,16 +116,19 @@ func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupId() (ret WafStatus // GetGroupIdOk returns a tuple with the GroupId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupIdOk() (ret WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdRetType, ok bool) { return getWafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeTypeOk(o.GroupId) } // SetGroupId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromGroup) SetGroupId(v WafStatusRuleBlockReasonInheritedFromGroupGetGroupIdRetType) { setWafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeType(&o.GroupId, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetType() (ret WafStatusRuleBlockReasonInheritedFromGroupGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -115,15 +136,18 @@ func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetType() (ret WafStatusRul // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetTypeOk() (ret WafStatusRuleBlockReasonInheritedFromGroupGetTypeRetType, ok bool) { return getWafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInheritedFromGroup) SetType(v WafStatusRuleBlockReasonInheritedFromGroupGetTypeRetType) { setWafStatusRuleBlockReasonInheritedFromGroupGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafStatusRuleBlockReasonInheritedFromGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafStatusRuleBlockReasonInheritedFromGroupGetGroupIdAttributeTypeOk(o.GroupId); ok { @@ -135,37 +159,45 @@ func (o WafStatusRuleBlockReasonInheritedFromGroup) ToMap() (map[string]interfac return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafStatusRuleBlockReasonInheritedFromGroup struct { value *WafStatusRuleBlockReasonInheritedFromGroup isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) Get() *WafStatusRuleBlockReasonInheritedFromGroup { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) Set(val *WafStatusRuleBlockReasonInheritedFromGroup) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafStatusRuleBlockReasonInheritedFromGroup(val *WafStatusRuleBlockReasonInheritedFromGroup) *NullableWafStatusRuleBlockReasonInheritedFromGroup { return &NullableWafStatusRuleBlockReasonInheritedFromGroup{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_status_rule_block_reason_invalid_waf_type.go b/services/cdn/model_waf_status_rule_block_reason_invalid_waf_type.go index e8767ed89..03e5c800f 100644 --- a/services/cdn/model_waf_status_rule_block_reason_invalid_waf_type.go +++ b/services/cdn/model_waf_status_rule_block_reason_invalid_waf_type.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &WafStatusRuleBlockReasonInvalidWafType{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeType = *[]WafType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesArgType = []WafType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesRetType = []WafType +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeTypeOk(arg WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeType) (ret WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getWafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeTypeOk( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeType(arg *WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeType, val WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setWafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeType(ar */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeTypeOk(arg WafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeType) (ret WafStatusRuleBlockReasonInvalidWafTypeGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getWafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeTypeOk(arg WafStat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeType(arg *WafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeType, val WafStatusRuleBlockReasonInvalidWafTypeGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInvalidWafTypeGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInvalidWafTypeGetTypeRetType = string // WafStatusRuleBlockReasonInvalidWafType struct for WafStatusRuleBlockReasonInvalidWafType +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonInvalidWafType struct { // A list containing all WAF Types which can use this Rule. You must patch you WAF to one of these WAF Types to make use of this rule. Rules show up with this state if they would have been enabled or logOnly otherwise. // REQUIRED @@ -68,12 +83,14 @@ type WafStatusRuleBlockReasonInvalidWafType struct { Type WafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafStatusRuleBlockReasonInvalidWafType WafStatusRuleBlockReasonInvalidWafType // NewWafStatusRuleBlockReasonInvalidWafType instantiates a new WafStatusRuleBlockReasonInvalidWafType 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonInvalidWafType(allowedWafTypes WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesArgType, types WafStatusRuleBlockReasonInvalidWafTypeGetTypeArgType) *WafStatusRuleBlockReasonInvalidWafType { this := WafStatusRuleBlockReasonInvalidWafType{} setWafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeType(&this.AllowedWafTypes, allowedWafTypes) @@ -84,12 +101,14 @@ func NewWafStatusRuleBlockReasonInvalidWafType(allowedWafTypes WafStatusRuleBloc // NewWafStatusRuleBlockReasonInvalidWafTypeWithDefaults instantiates a new WafStatusRuleBlockReasonInvalidWafType 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonInvalidWafTypeWithDefaults() *WafStatusRuleBlockReasonInvalidWafType { this := WafStatusRuleBlockReasonInvalidWafType{} return &this } // GetAllowedWafTypes returns the AllowedWafTypes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypes() (ret WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesRetType) { ret, _ = o.GetAllowedWafTypesOk() return ret @@ -97,16 +116,19 @@ func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypes() (ret WafSt // GetAllowedWafTypesOk returns a tuple with the AllowedWafTypes field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypesOk() (ret WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesRetType, ok bool) { return getWafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeTypeOk(o.AllowedWafTypes) } // SetAllowedWafTypes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInvalidWafType) SetAllowedWafTypes(v WafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesRetType) { setWafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeType(&o.AllowedWafTypes, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInvalidWafType) GetType() (ret WafStatusRuleBlockReasonInvalidWafTypeGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -114,15 +136,18 @@ func (o *WafStatusRuleBlockReasonInvalidWafType) GetType() (ret WafStatusRuleBlo // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInvalidWafType) GetTypeOk() (ret WafStatusRuleBlockReasonInvalidWafTypeGetTypeRetType, ok bool) { return getWafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonInvalidWafType) SetType(v WafStatusRuleBlockReasonInvalidWafTypeGetTypeRetType) { setWafStatusRuleBlockReasonInvalidWafTypeGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafStatusRuleBlockReasonInvalidWafType) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafStatusRuleBlockReasonInvalidWafTypeGetAllowedWafTypesAttributeTypeOk(o.AllowedWafTypes); ok { @@ -134,37 +159,45 @@ func (o WafStatusRuleBlockReasonInvalidWafType) ToMap() (map[string]interface{}, return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafStatusRuleBlockReasonInvalidWafType struct { value *WafStatusRuleBlockReasonInvalidWafType isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInvalidWafType) Get() *WafStatusRuleBlockReasonInvalidWafType { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInvalidWafType) Set(val *WafStatusRuleBlockReasonInvalidWafType) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInvalidWafType) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInvalidWafType) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafStatusRuleBlockReasonInvalidWafType(val *WafStatusRuleBlockReasonInvalidWafType) *NullableWafStatusRuleBlockReasonInvalidWafType { return &NullableWafStatusRuleBlockReasonInvalidWafType{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonInvalidWafType) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonInvalidWafType) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_status_rule_block_reason_never_defined.go b/services/cdn/model_waf_status_rule_block_reason_never_defined.go index f6f195b95..3c7052d11 100644 --- a/services/cdn/model_waf_status_rule_block_reason_never_defined.go +++ b/services/cdn/model_waf_status_rule_block_reason_never_defined.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &WafStatusRuleBlockReasonNeverDefined{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonNeverDefinedGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWafStatusRuleBlockReasonNeverDefinedGetTypeAttributeTypeOk(arg WafStatusRuleBlockReasonNeverDefinedGetTypeAttributeType) (ret WafStatusRuleBlockReasonNeverDefinedGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,26 +34,33 @@ func getWafStatusRuleBlockReasonNeverDefinedGetTypeAttributeTypeOk(arg WafStatus return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWafStatusRuleBlockReasonNeverDefinedGetTypeAttributeType(arg *WafStatusRuleBlockReasonNeverDefinedGetTypeAttributeType, val WafStatusRuleBlockReasonNeverDefinedGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonNeverDefinedGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonNeverDefinedGetTypeRetType = string // WafStatusRuleBlockReasonNeverDefined This object only ever shows up in the disabled rules section. If rules are never defined (e.g. no collection, rule group, or the rule itself is ever mentioned), they are implicitly disabled +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafStatusRuleBlockReasonNeverDefined struct { // This is always `neverDefined` // REQUIRED Type WafStatusRuleBlockReasonNeverDefinedGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WafStatusRuleBlockReasonNeverDefined WafStatusRuleBlockReasonNeverDefined // NewWafStatusRuleBlockReasonNeverDefined instantiates a new WafStatusRuleBlockReasonNeverDefined 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonNeverDefined(types WafStatusRuleBlockReasonNeverDefinedGetTypeArgType) *WafStatusRuleBlockReasonNeverDefined { this := WafStatusRuleBlockReasonNeverDefined{} setWafStatusRuleBlockReasonNeverDefinedGetTypeAttributeType(&this.Type, types) @@ -60,12 +70,14 @@ func NewWafStatusRuleBlockReasonNeverDefined(types WafStatusRuleBlockReasonNever // NewWafStatusRuleBlockReasonNeverDefinedWithDefaults instantiates a new WafStatusRuleBlockReasonNeverDefined 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafStatusRuleBlockReasonNeverDefinedWithDefaults() *WafStatusRuleBlockReasonNeverDefined { this := WafStatusRuleBlockReasonNeverDefined{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonNeverDefined) GetType() (ret WafStatusRuleBlockReasonNeverDefinedGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -73,15 +85,18 @@ func (o *WafStatusRuleBlockReasonNeverDefined) GetType() (ret WafStatusRuleBlock // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonNeverDefined) GetTypeOk() (ret WafStatusRuleBlockReasonNeverDefinedGetTypeRetType, ok bool) { return getWafStatusRuleBlockReasonNeverDefinedGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WafStatusRuleBlockReasonNeverDefined) SetType(v WafStatusRuleBlockReasonNeverDefinedGetTypeRetType) { setWafStatusRuleBlockReasonNeverDefinedGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WafStatusRuleBlockReasonNeverDefined) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWafStatusRuleBlockReasonNeverDefinedGetTypeAttributeTypeOk(o.Type); ok { @@ -90,37 +105,45 @@ func (o WafStatusRuleBlockReasonNeverDefined) ToMap() (map[string]interface{}, e return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafStatusRuleBlockReasonNeverDefined struct { value *WafStatusRuleBlockReasonNeverDefined isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonNeverDefined) Get() *WafStatusRuleBlockReasonNeverDefined { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonNeverDefined) Set(val *WafStatusRuleBlockReasonNeverDefined) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonNeverDefined) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonNeverDefined) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafStatusRuleBlockReasonNeverDefined(val *WafStatusRuleBlockReasonNeverDefined) *NullableWafStatusRuleBlockReasonNeverDefined { return &NullableWafStatusRuleBlockReasonNeverDefined{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafStatusRuleBlockReasonNeverDefined) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafStatusRuleBlockReasonNeverDefined) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_type.go b/services/cdn/model_waf_type.go index 9bf4663e1..87bba915f 100644 --- a/services/cdn/model_waf_type.go +++ b/services/cdn/model_waf_type.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -16,20 +17,25 @@ import ( ) // WafType Enable or disable the Premium WAF. Do note that enabling the Premium WAF will cause additional fees. Some features are gated behind the Premium WAF, like additional, **premium-only rules** and the ability to create **custom rules** (not yet implemented) +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WafType string // List of WafType const ( - WAFTYPE_FREE WafType = "FREE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + WAFTYPE_FREE WafType = "FREE" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead WAFTYPE_PREMIUM WafType = "PREMIUM" ) // All allowed values of WafType enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedWafTypeEnumValues = []WafType{ "FREE", "PREMIUM", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *WafType) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -54,6 +60,7 @@ func (v *WafType) UnmarshalJSON(src []byte) error { // NewWafTypeFromValue returns a pointer to a valid WafType // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWafTypeFromValue(v string) (*WafType, error) { ev := WafType(v) if ev.IsValid() { @@ -64,6 +71,7 @@ func NewWafTypeFromValue(v string) (*WafType, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v WafType) IsValid() bool { for _, existing := range AllowedWafTypeEnumValues { if existing == v { @@ -74,41 +82,50 @@ func (v WafType) IsValid() bool { } // Ptr returns reference to WafType value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v WafType) Ptr() *WafType { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWafType struct { value *WafType isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafType) Get() *WafType { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafType) Set(val *WafType) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafType) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafType) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWafType(val *WafType) *NullableWafType { return &NullableWafType{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWafType) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWafType) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/model_waf_violation.go b/services/cdn/model_waf_violation.go index 5a2d7cb95..ee78fc7a7 100644 --- a/services/cdn/model_waf_violation.go +++ b/services/cdn/model_waf_violation.go @@ -8,6 +8,7 @@ API version: 1.0.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package cdn import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &WAFViolation{} */ // isEnumRef +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetActionAttributeType = *WAFRuleAction + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetActionArgType = WAFRuleAction + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetActionRetType = WAFRuleAction +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWAFViolationGetActionAttributeTypeOk(arg WAFViolationGetActionAttributeType) (ret WAFViolationGetActionRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getWAFViolationGetActionAttributeTypeOk(arg WAFViolationGetActionAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWAFViolationGetActionAttributeType(arg *WAFViolationGetActionAttributeType, val WAFViolationGetActionRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setWAFViolationGetActionAttributeType(arg *WAFViolationGetActionAttributeTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetAsnAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWAFViolationGetAsnAttributeTypeOk(arg WAFViolationGetAsnAttributeType) (ret WAFViolationGetAsnRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getWAFViolationGetAsnAttributeTypeOk(arg WAFViolationGetAsnAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWAFViolationGetAsnAttributeType(arg *WAFViolationGetAsnAttributeType, val WAFViolationGetAsnRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetAsnArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetAsnRetType = string /* @@ -63,8 +77,10 @@ type WAFViolationGetAsnRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWAFViolationGetMessageAttributeTypeOk(arg WAFViolationGetMessageAttributeType) (ret WAFViolationGetMessageRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getWAFViolationGetMessageAttributeTypeOk(arg WAFViolationGetMessageAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWAFViolationGetMessageAttributeType(arg *WAFViolationGetMessageAttributeType, val WAFViolationGetMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetMessageRetType = string /* @@ -84,8 +104,10 @@ type WAFViolationGetMessageRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetMethodAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWAFViolationGetMethodAttributeTypeOk(arg WAFViolationGetMethodAttributeType) (ret WAFViolationGetMethodRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +115,15 @@ func getWAFViolationGetMethodAttributeTypeOk(arg WAFViolationGetMethodAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWAFViolationGetMethodAttributeType(arg *WAFViolationGetMethodAttributeType, val WAFViolationGetMethodRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetMethodArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetMethodRetType = string /* @@ -105,10 +131,16 @@ type WAFViolationGetMethodRetType = string */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetRequestHeadersAttributeType = *map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetRequestHeadersArgType = map[string]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetRequestHeadersRetType = map[string]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWAFViolationGetRequestHeadersAttributeTypeOk(arg WAFViolationGetRequestHeadersAttributeType) (ret WAFViolationGetRequestHeadersRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +148,7 @@ func getWAFViolationGetRequestHeadersAttributeTypeOk(arg WAFViolationGetRequestH return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWAFViolationGetRequestHeadersAttributeType(arg *WAFViolationGetRequestHeadersAttributeType, val WAFViolationGetRequestHeadersRetType) { *arg = &val } @@ -125,8 +158,10 @@ func setWAFViolationGetRequestHeadersAttributeType(arg *WAFViolationGetRequestHe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetRuleIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getWAFViolationGetRuleIdAttributeTypeOk(arg WAFViolationGetRuleIdAttributeType) (ret WAFViolationGetRuleIdRetType, ok bool) { if arg == nil { return ret, false @@ -134,14 +169,19 @@ func getWAFViolationGetRuleIdAttributeTypeOk(arg WAFViolationGetRuleIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setWAFViolationGetRuleIdAttributeType(arg *WAFViolationGetRuleIdAttributeType, val WAFViolationGetRuleIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetRuleIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolationGetRuleIdRetType = string // WAFViolation Information about a violated WAF rule in case the WAF is enabled and a rule was triggered (either in BLOCK or LOG_ONLY mode) +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type WAFViolation struct { // REQUIRED Action WAFViolationGetActionAttributeType `json:"action" required:"true"` @@ -161,12 +201,14 @@ type WAFViolation struct { RuleId WAFViolationGetRuleIdAttributeType `json:"ruleId" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _WAFViolation WAFViolation // NewWAFViolation instantiates a new WAFViolation 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWAFViolation(action WAFViolationGetActionArgType, asn WAFViolationGetAsnArgType, message WAFViolationGetMessageArgType, method WAFViolationGetMethodArgType, requestHeaders WAFViolationGetRequestHeadersArgType, ruleId WAFViolationGetRuleIdArgType) *WAFViolation { this := WAFViolation{} setWAFViolationGetActionAttributeType(&this.Action, action) @@ -181,12 +223,14 @@ func NewWAFViolation(action WAFViolationGetActionArgType, asn WAFViolationGetAsn // NewWAFViolationWithDefaults instantiates a new WAFViolation 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewWAFViolationWithDefaults() *WAFViolation { this := WAFViolation{} return &this } // GetAction returns the Action field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetAction() (ret WAFViolationGetActionRetType) { ret, _ = o.GetActionOk() return ret @@ -194,16 +238,19 @@ func (o *WAFViolation) GetAction() (ret WAFViolationGetActionRetType) { // GetActionOk returns a tuple with the Action field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetActionOk() (ret WAFViolationGetActionRetType, ok bool) { return getWAFViolationGetActionAttributeTypeOk(o.Action) } // SetAction sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) SetAction(v WAFViolationGetActionRetType) { setWAFViolationGetActionAttributeType(&o.Action, v) } // GetAsn returns the Asn field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetAsn() (ret WAFViolationGetAsnRetType) { ret, _ = o.GetAsnOk() return ret @@ -211,16 +258,19 @@ func (o *WAFViolation) GetAsn() (ret WAFViolationGetAsnRetType) { // GetAsnOk returns a tuple with the Asn field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetAsnOk() (ret WAFViolationGetAsnRetType, ok bool) { return getWAFViolationGetAsnAttributeTypeOk(o.Asn) } // SetAsn sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) SetAsn(v WAFViolationGetAsnRetType) { setWAFViolationGetAsnAttributeType(&o.Asn, v) } // GetMessage returns the Message field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetMessage() (ret WAFViolationGetMessageRetType) { ret, _ = o.GetMessageOk() return ret @@ -228,16 +278,19 @@ func (o *WAFViolation) GetMessage() (ret WAFViolationGetMessageRetType) { // GetMessageOk returns a tuple with the Message field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetMessageOk() (ret WAFViolationGetMessageRetType, ok bool) { return getWAFViolationGetMessageAttributeTypeOk(o.Message) } // SetMessage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) SetMessage(v WAFViolationGetMessageRetType) { setWAFViolationGetMessageAttributeType(&o.Message, v) } // GetMethod returns the Method field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetMethod() (ret WAFViolationGetMethodRetType) { ret, _ = o.GetMethodOk() return ret @@ -245,16 +298,19 @@ func (o *WAFViolation) GetMethod() (ret WAFViolationGetMethodRetType) { // GetMethodOk returns a tuple with the Method field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetMethodOk() (ret WAFViolationGetMethodRetType, ok bool) { return getWAFViolationGetMethodAttributeTypeOk(o.Method) } // SetMethod sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) SetMethod(v WAFViolationGetMethodRetType) { setWAFViolationGetMethodAttributeType(&o.Method, v) } // GetRequestHeaders returns the RequestHeaders field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetRequestHeaders() (ret WAFViolationGetRequestHeadersRetType) { ret, _ = o.GetRequestHeadersOk() return ret @@ -262,16 +318,19 @@ func (o *WAFViolation) GetRequestHeaders() (ret WAFViolationGetRequestHeadersRet // GetRequestHeadersOk returns a tuple with the RequestHeaders field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetRequestHeadersOk() (ret WAFViolationGetRequestHeadersRetType, ok bool) { return getWAFViolationGetRequestHeadersAttributeTypeOk(o.RequestHeaders) } // SetRequestHeaders sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) SetRequestHeaders(v WAFViolationGetRequestHeadersRetType) { setWAFViolationGetRequestHeadersAttributeType(&o.RequestHeaders, v) } // GetRuleId returns the RuleId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetRuleId() (ret WAFViolationGetRuleIdRetType) { ret, _ = o.GetRuleIdOk() return ret @@ -279,15 +338,18 @@ func (o *WAFViolation) GetRuleId() (ret WAFViolationGetRuleIdRetType) { // GetRuleIdOk returns a tuple with the RuleId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) GetRuleIdOk() (ret WAFViolationGetRuleIdRetType, ok bool) { return getWAFViolationGetRuleIdAttributeTypeOk(o.RuleId) } // SetRuleId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *WAFViolation) SetRuleId(v WAFViolationGetRuleIdRetType) { setWAFViolationGetRuleIdAttributeType(&o.RuleId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o WAFViolation) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getWAFViolationGetActionAttributeTypeOk(o.Action); ok { @@ -311,37 +373,45 @@ func (o WAFViolation) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableWAFViolation struct { value *WAFViolation isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWAFViolation) Get() *WAFViolation { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWAFViolation) Set(val *WAFViolation) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWAFViolation) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWAFViolation) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableWAFViolation(val *WAFViolation) *NullableWAFViolation { return &NullableWAFViolation{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableWAFViolation) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableWAFViolation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/cdn/oas_commit b/services/cdn/oas_commit index 867163a2a..bf3189995 100644 --- a/services/cdn/oas_commit +++ b/services/cdn/oas_commit @@ -1 +1 @@ -63c68f45675657d8e16a43ac9fbc216ac3a899ee +3e9c109388be83b40c16d8cb5ab146aa314eb6e8 diff --git a/services/cdn/utils.go b/services/cdn/utils.go index 142227da2..9968dd90b 100644 --- a/services/cdn/utils.go +++ b/services/cdn/utils.go @@ -18,341 +18,419 @@ import ( ) // PtrBool is a helper routine that returns a pointer to given boolean value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrBool(v bool) *bool { return &v } // PtrInt is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt(v int) *int { return &v } // PtrInt32 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt32(v int32) *int32 { return &v } // PtrInt64 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt64(v int64) *int64 { return &v } // PtrFloat32 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat32(v float32) *float32 { return &v } // PtrFloat64 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat64(v float64) *float64 { return &v } // PtrString is a helper routine that returns a pointer to given string value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrTime(v time.Time) *time.Time { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableValue[T any] struct { value *T isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) Get() *T { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Set(val *T) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBool struct { value *bool isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) Get() *bool { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Set(val *bool) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBool(val *bool) *NullableBool { return &NullableBool{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt struct { value *int isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) Get() *int { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Set(val *int) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt(val *int) *NullableInt { return &NullableInt{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt32 struct { value *int32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) Get() *int32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Set(val *int32) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt32(val *int32) *NullableInt32 { return &NullableInt32{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt64 struct { value *int64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) Get() *int64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Set(val *int64) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt64(val *int64) *NullableInt64 { return &NullableInt64{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat32 struct { value *float32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) Get() *float32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Set(val *float32) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFloat32(val *float32) *NullableFloat32 { return &NullableFloat32{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat64 struct { value *float64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) Get() *float64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Set(val *float64) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFloat64(val *float64) *NullableFloat64 { return &NullableFloat64{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableString struct { value *string isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) Get() *string { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Set(val *string) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableString(val *string) *NullableString { return &NullableString{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableTime struct { value *time.Time isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) Get() *time.Time { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Set(val *time.Time) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableTime(val *time.Time) *NullableTime { return &NullableTime{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) MarshalJSON() ([]byte, error) { return v.value.MarshalJSON() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } // IsNil checks if an input is nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func IsNil(i interface{}) bool { if i == nil { return true @@ -369,13 +447,16 @@ func IsNil(i interface{}) bool { return false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MappedNullable interface { ToMap() (map[string]interface{}, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // randString returns a random string with a specified length. It panics if n <= 0. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func randString(n int) string { b := make([]byte, n) for i := range b { diff --git a/services/cdn/v1api/api_default.go b/services/cdn/v1api/api_default.go new file mode 100644 index 000000000..395d4b863 --- /dev/null +++ b/services/cdn/v1api/api_default.go @@ -0,0 +1,3150 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateDistribution Create new distribution + + CreateDistribution will create a new CDN distribution + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiCreateDistributionRequest + */ + CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest + + // CreateDistributionExecute executes the request + // @return CreateDistributionResponse + CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) + + /* + DeleteCustomDomain Delete a custom domain + + Removes a custom domain + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiDeleteCustomDomainRequest + */ + DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest + + // DeleteCustomDomainExecute executes the request + // @return DeleteCustomDomainResponse + DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) + + /* + DeleteDistribution Delete distribution + + DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiDeleteDistributionRequest + */ + DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest + + // DeleteDistributionExecute executes the request + // @return DeleteDistributionResponse + DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) + + /* + FindCachePaths Return Paths that were purged + + This returns paths that are present in the cache purging history. + Only substrings of the provided input are returned. + The response is sorted in descending order by the most recent purge. + + So, assuming you have have the following purged for a distribution + - `/test/1` at `2025-01-01` + - `/test/2` at `2025-01-02` + - `/someOtherPath/1` at `2025-01-03` + - `/test/1` at `2025-01-04` + - `/test/3` at `2025-01-05`, + this would return the following paths, in the following order, assuming `/te` was the search parameter: + - `/test/3` + - `/test/1` + - `/test/2` + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiFindCachePathsRequest + */ + FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest + + // FindCachePathsExecute executes the request + // @return FindCachePathsResponse + FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) + + /* + GetCacheInfo Get Infos about the Caching State + + Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. + + If (and only if) you provide the path query parameter, the history will also contain granular cache purges. + The request will not fail if no data about a path is found. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetCacheInfoRequest + */ + GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest + + // GetCacheInfoExecute executes the request + // @return GetCacheInfoResponse + GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) + + /* + GetCustomDomain Retrieve a specific custom domain + + Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiGetCustomDomainRequest + */ + GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest + + // GetCustomDomainExecute executes the request + // @return GetCustomDomainResponse + GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) + + /* + GetDistribution Get distribution by Id + + This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetDistributionRequest + */ + GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest + + // GetDistributionExecute executes the request + // @return GetDistributionResponse + GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) + + /* + GetLogs Retrieve distribution logs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId Your CDN distribution Id + @return ApiGetLogsRequest + */ + GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest + + // GetLogsExecute executes the request + // @return GetLogsResponse + GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) + + /* + GetLogsSearchFilters Get relevant search filters for this distribution based on user input. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID. + @param distributionId Your CDN distribution ID. + @return ApiGetLogsSearchFiltersRequest + */ + GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest + + // GetLogsSearchFiltersExecute executes the request + // @return GetLogsSearchFiltersResponse + GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) + + /* + GetStatistics Retrieve the statistics of a distribution + + Returns the statistics of the distribution in the given + time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. + In case no statistics for a time interval exist, no record is returned. + The time range for which statistics should be returned can be configured using query parameters. + + Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. + + **Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. + + The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. + Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetStatisticsRequest + */ + GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest + + // GetStatisticsExecute executes the request + // @return GetStatisticsResponse + GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) + + /* + ListDistributions List all distributions belonging to a specific project + + ListDistributions returns a list of all CDN distributions associated with + a given project, ordered by their distribution Id. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiListDistributionsRequest + */ + ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest + + // ListDistributionsExecute executes the request + // @return ListDistributionsResponse + ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) + + /* + ListWafCollections List all WAF rule collections of the project + + Returns all WAF rule collections available to the project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiListWafCollectionsRequest + */ + ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest + + // ListWafCollectionsExecute executes the request + // @return ListWafCollectionsResponse + ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) + + /* + PatchDistribution Update existing distribution + + Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiPatchDistributionRequest + */ + PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest + + // PatchDistributionExecute executes the request + // @return PatchDistributionResponse + PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) + + /* + PurgeCache Clear distribution cache + + Clear the cache for this distribution. + All content, regardless of its staleness, will get refetched from the host. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiPurgeCacheRequest + */ + PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest + + // PurgeCacheExecute executes the request + // @return map[string]interface{} + PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) + + /* + PutCustomDomain Create or update a custom domain + + Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiPutCustomDomainRequest + */ + PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest + + // PutCustomDomainExecute executes the request + // @return PutCustomDomainResponse + PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createDistributionPayload *CreateDistributionPayload +} + +func (r ApiCreateDistributionRequest) CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest { + r.createDistributionPayload = &createDistributionPayload + return r +} + +func (r ApiCreateDistributionRequest) Execute() (*CreateDistributionResponse, error) { + return r.ApiService.CreateDistributionExecute(r) +} + +/* +CreateDistribution Create new distribution + +CreateDistribution will create a new CDN distribution + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiCreateDistributionRequest +*/ +func (a *DefaultAPIService) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { + return ApiCreateDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return CreateDistributionResponse +func (a *DefaultAPIService) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDistributionPayload == nil { + return localVarReturnValue, reportError("createDistributionPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createDistributionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string + intentId *string +} + +func (r ApiDeleteCustomDomainRequest) IntentId(intentId string) ApiDeleteCustomDomainRequest { + r.intentId = &intentId + return r +} + +func (r ApiDeleteCustomDomainRequest) Execute() (*DeleteCustomDomainResponse, error) { + return r.ApiService.DeleteCustomDomainExecute(r) +} + +/* +DeleteCustomDomain Delete a custom domain + +# Removes a custom domain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiDeleteCustomDomainRequest +*/ +func (a *DefaultAPIService) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { + return ApiDeleteCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return DeleteCustomDomainResponse +func (a *DefaultAPIService) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + if r.intentId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + intentId *string +} + +// While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. +func (r ApiDeleteDistributionRequest) IntentId(intentId string) ApiDeleteDistributionRequest { + r.intentId = &intentId + return r +} + +func (r ApiDeleteDistributionRequest) Execute() (*DeleteDistributionResponse, error) { + return r.ApiService.DeleteDistributionExecute(r) +} + +/* +DeleteDistribution Delete distribution + +DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiDeleteDistributionRequest +*/ +func (a *DefaultAPIService) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { + return ApiDeleteDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return DeleteDistributionResponse +func (a *DefaultAPIService) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.intentId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiFindCachePathsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + path *string +} + +// A substring of the search query. +func (r ApiFindCachePathsRequest) Path(path string) ApiFindCachePathsRequest { + r.path = &path + return r +} + +func (r ApiFindCachePathsRequest) Execute() (*FindCachePathsResponse, error) { + return r.ApiService.FindCachePathsExecute(r) +} + +/* +FindCachePaths Return Paths that were purged + +This returns paths that are present in the cache purging history. +Only substrings of the provided input are returned. +The response is sorted in descending order by the most recent purge. + +So, assuming you have have the following purged for a distribution +- `/test/1` at `2025-01-01` +- `/test/2` at `2025-01-02` +- `/someOtherPath/1` at `2025-01-03` +- `/test/1` at `2025-01-04` +- `/test/3` at `2025-01-05`, +this would return the following paths, in the following order, assuming `/te` was the search parameter: +- `/test/3` +- `/test/1` +- `/test/2` + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiFindCachePathsRequest +*/ +func (a *DefaultAPIService) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { + return ApiFindCachePathsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return FindCachePathsResponse +func (a *DefaultAPIService) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindCachePathsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.FindCachePaths") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/cache/paths" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.path == nil { + return localVarReturnValue, reportError("path is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "path", r.path, "form", "") + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCacheInfoRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + purgePath *string +} + +func (r ApiGetCacheInfoRequest) PurgePath(purgePath string) ApiGetCacheInfoRequest { + r.purgePath = &purgePath + return r +} + +func (r ApiGetCacheInfoRequest) Execute() (*GetCacheInfoResponse, error) { + return r.ApiService.GetCacheInfoExecute(r) +} + +/* +GetCacheInfo Get Infos about the Caching State + +Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. + +If (and only if) you provide the path query parameter, the history will also contain granular cache purges. +The request will not fail if no data about a path is found. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetCacheInfoRequest +*/ +func (a *DefaultAPIService) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { + return ApiGetCacheInfoRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetCacheInfoResponse +func (a *DefaultAPIService) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCacheInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCacheInfo") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/cache" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.purgePath != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "purgePath", r.purgePath, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string +} + +func (r ApiGetCustomDomainRequest) Execute() (*GetCustomDomainResponse, error) { + return r.ApiService.GetCustomDomainExecute(r) +} + +/* +GetCustomDomain Retrieve a specific custom domain + +# Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiGetCustomDomainRequest +*/ +func (a *DefaultAPIService) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { + return ApiGetCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return GetCustomDomainResponse +func (a *DefaultAPIService) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + withWafStatus *bool +} + +// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. +func (r ApiGetDistributionRequest) WithWafStatus(withWafStatus bool) ApiGetDistributionRequest { + r.withWafStatus = &withWafStatus + return r +} + +func (r ApiGetDistributionRequest) Execute() (*GetDistributionResponse, error) { + return r.ApiService.GetDistributionExecute(r) +} + +/* +GetDistribution Get distribution by Id + +This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetDistributionRequest +*/ +func (a *DefaultAPIService) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { + return ApiGetDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetDistributionResponse +func (a *DefaultAPIService) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.withWafStatus != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") + r.withWafStatus = &defaultValue + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetLogsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + from *time.Time + to *time.Time + pageSize *int32 + pageIdentifier *string + sortBy *string + sortOrder *string + wafAction *WAFRuleAction + dataCenterRegion *string + requestCountryCode *string + statusCode *int32 + cacheHit *bool +} + +// the start of the time range for which logs should be returned +func (r ApiGetLogsRequest) From(from time.Time) ApiGetLogsRequest { + r.from = &from + return r +} + +// the end of the time range for which logs should be returned. If not specified, \"now\" is used. +func (r ApiGetLogsRequest) To(to time.Time) ApiGetLogsRequest { + r.to = &to + return r +} + +// Quantifies how many log entries should be returned on this page. Must be a natural number between 1 and 1000 (inclusive) +func (r ApiGetLogsRequest) PageSize(pageSize int32) ApiGetLogsRequest { + r.pageSize = &pageSize + return r +} + +// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. +func (r ApiGetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsRequest { + r.pageIdentifier = &pageIdentifier + return r +} + +// Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` +func (r ApiGetLogsRequest) SortBy(sortBy string) ApiGetLogsRequest { + r.sortBy = &sortBy + return r +} + +func (r ApiGetLogsRequest) SortOrder(sortOrder string) ApiGetLogsRequest { + r.sortOrder = &sortOrder + return r +} + +// If this is set then only log entries with the chosen WAF rule action/outcome are returned. Specifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where a WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged but the request not blocked +func (r ApiGetLogsRequest) WafAction(wafAction WAFRuleAction) ApiGetLogsRequest { + r.wafAction = &wafAction + return r +} + +// Filters by the CDN data center region that served the request. Can be combined with other filters +func (r ApiGetLogsRequest) DataCenterRegion(dataCenterRegion string) ApiGetLogsRequest { + r.dataCenterRegion = &dataCenterRegion + return r +} + +// Filters by the originating country of the user request. Can be combined with other filters +func (r ApiGetLogsRequest) RequestCountryCode(requestCountryCode string) ApiGetLogsRequest { + r.requestCountryCode = &requestCountryCode + return r +} + +// Filters by the HTTP status code returned to the client. Can be combined with other filters +func (r ApiGetLogsRequest) StatusCode(statusCode int32) ApiGetLogsRequest { + r.statusCode = &statusCode + return r +} + +// Filters based on whether the request was served from the CDN cache. Can be combined with other filters +func (r ApiGetLogsRequest) CacheHit(cacheHit bool) ApiGetLogsRequest { + r.cacheHit = &cacheHit + return r +} + +func (r ApiGetLogsRequest) Execute() (*GetLogsResponse, error) { + return r.ApiService.GetLogsExecute(r) +} + +/* +GetLogs Retrieve distribution logs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId Your CDN distribution Id + @return ApiGetLogsRequest +*/ +func (a *DefaultAPIService) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { + return ApiGetLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetLogsResponse +func (a *DefaultAPIService) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetLogsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/logs" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.from != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + } + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } else { + var defaultValue int32 = 20 + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") + r.pageSize = &defaultValue + } + if r.pageIdentifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } else { + var defaultValue string = "timestamp" + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") + r.sortBy = &defaultValue + } + if r.sortOrder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") + } + if r.wafAction != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "wafAction", r.wafAction, "form", "") + } + if r.dataCenterRegion != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "dataCenterRegion", r.dataCenterRegion, "form", "") + } + if r.requestCountryCode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "requestCountryCode", r.requestCountryCode, "form", "") + } + if r.statusCode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "statusCode", r.statusCode, "form", "") + } + if r.cacheHit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cacheHit", r.cacheHit, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetLogsSearchFiltersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + filter *string +} + +// Optional search string. Will search the **values** for the text input. +func (r ApiGetLogsSearchFiltersRequest) Filter(filter string) ApiGetLogsSearchFiltersRequest { + r.filter = &filter + return r +} + +func (r ApiGetLogsSearchFiltersRequest) Execute() (*GetLogsSearchFiltersResponse, error) { + return r.ApiService.GetLogsSearchFiltersExecute(r) +} + +/* +GetLogsSearchFilters Get relevant search filters for this distribution based on user input. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID. + @param distributionId Your CDN distribution ID. + @return ApiGetLogsSearchFiltersRequest +*/ +func (a *DefaultAPIService) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { + return ApiGetLogsSearchFiltersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetLogsSearchFiltersResponse +func (a *DefaultAPIService) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetLogsSearchFiltersResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogsSearchFilters") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/logs/searchFilters" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetStatisticsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + from *time.Time + to *time.Time + interval *string +} + +// the start of the time range for which statistics should be returned +func (r ApiGetStatisticsRequest) From(from time.Time) ApiGetStatisticsRequest { + r.from = &from + return r +} + +// the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. +func (r ApiGetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { + r.to = &to + return r +} + +// Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` +func (r ApiGetStatisticsRequest) Interval(interval string) ApiGetStatisticsRequest { + r.interval = &interval + return r +} + +func (r ApiGetStatisticsRequest) Execute() (*GetStatisticsResponse, error) { + return r.ApiService.GetStatisticsExecute(r) +} + +/* +GetStatistics Retrieve the statistics of a distribution + +Returns the statistics of the distribution in the given +time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. +In case no statistics for a time interval exist, no record is returned. +The time range for which statistics should be returned can be configured using query parameters. + +Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. + +**Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. + +The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. +Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetStatisticsRequest +*/ +func (a *DefaultAPIService) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { + return ApiGetStatisticsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetStatisticsResponse +func (a *DefaultAPIService) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetStatisticsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetStatistics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/statistics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.from == nil { + return localVarReturnValue, reportError("from is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.interval != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval", r.interval, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDistributionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + pageSize *int32 + withWafStatus *bool + pageIdentifier *string + sortBy *string + sortOrder *string +} + +// Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) +func (r ApiListDistributionsRequest) PageSize(pageSize int32) ApiListDistributionsRequest { + r.pageSize = &pageSize + return r +} + +// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. +func (r ApiListDistributionsRequest) WithWafStatus(withWafStatus bool) ApiListDistributionsRequest { + r.withWafStatus = &withWafStatus + return r +} + +// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. +func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiListDistributionsRequest { + r.pageIdentifier = &pageIdentifier + return r +} + +// The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. +func (r ApiListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { + r.sortBy = &sortBy + return r +} + +func (r ApiListDistributionsRequest) SortOrder(sortOrder string) ApiListDistributionsRequest { + r.sortOrder = &sortOrder + return r +} + +func (r ApiListDistributionsRequest) Execute() (*ListDistributionsResponse, error) { + return r.ApiService.ListDistributionsExecute(r) +} + +/* +ListDistributions List all distributions belonging to a specific project + +ListDistributions returns a list of all CDN distributions associated with +a given project, ordered by their distribution Id. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiListDistributionsRequest +*/ +func (a *DefaultAPIService) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { + return ApiListDistributionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListDistributionsResponse +func (a *DefaultAPIService) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListDistributionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDistributions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } else { + var defaultValue int32 = 20 + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") + r.pageSize = &defaultValue + } + if r.withWafStatus != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") + r.withWafStatus = &defaultValue + } + if r.pageIdentifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } else { + var defaultValue string = "createdAt" + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") + r.sortBy = &defaultValue + } + if r.sortOrder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListWafCollectionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListWafCollectionsRequest) Execute() (*ListWafCollectionsResponse, error) { + return r.ApiService.ListWafCollectionsExecute(r) +} + +/* +ListWafCollections List all WAF rule collections of the project + +Returns all WAF rule collections available to the project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiListWafCollectionsRequest +*/ +func (a *DefaultAPIService) ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest { + return ApiListWafCollectionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListWafCollectionsResponse +func (a *DefaultAPIService) ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListWafCollectionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListWafCollections") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/waf/collections" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPatchDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + patchDistributionPayload *PatchDistributionPayload +} + +func (r ApiPatchDistributionRequest) PatchDistributionPayload(patchDistributionPayload PatchDistributionPayload) ApiPatchDistributionRequest { + r.patchDistributionPayload = &patchDistributionPayload + return r +} + +func (r ApiPatchDistributionRequest) Execute() (*PatchDistributionResponse, error) { + return r.ApiService.PatchDistributionExecute(r) +} + +/* +PatchDistribution Update existing distribution + +Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiPatchDistributionRequest +*/ +func (a *DefaultAPIService) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { + return ApiPatchDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return PatchDistributionResponse +func (a *DefaultAPIService) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PatchDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchDistributionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPurgeCacheRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + purgeCachePayload *PurgeCachePayload +} + +func (r ApiPurgeCacheRequest) PurgeCachePayload(purgeCachePayload PurgeCachePayload) ApiPurgeCacheRequest { + r.purgeCachePayload = &purgeCachePayload + return r +} + +func (r ApiPurgeCacheRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.PurgeCacheExecute(r) +} + +/* +PurgeCache Clear distribution cache + +Clear the cache for this distribution. +All content, regardless of its staleness, will get refetched from the host. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiPurgeCacheRequest +*/ +func (a *DefaultAPIService) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { + return ApiPurgeCacheRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *DefaultAPIService) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PurgeCache") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/cache/purge" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.purgeCachePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPutCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string + putCustomDomainPayload *PutCustomDomainPayload +} + +func (r ApiPutCustomDomainRequest) PutCustomDomainPayload(putCustomDomainPayload PutCustomDomainPayload) ApiPutCustomDomainRequest { + r.putCustomDomainPayload = &putCustomDomainPayload + return r +} + +func (r ApiPutCustomDomainRequest) Execute() (*PutCustomDomainResponse, error) { + return r.ApiService.PutCustomDomainExecute(r) +} + +/* +PutCustomDomain Create or update a custom domain + +Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiPutCustomDomainRequest +*/ +func (a *DefaultAPIService) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { + return ApiPutCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return PutCustomDomainResponse +func (a *DefaultAPIService) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PutCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PutCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.putCustomDomainPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/cdn/v1api/api_default_mock.go b/services/cdn/v1api/api_default_mock.go new file mode 100644 index 000000000..77605f861 --- /dev/null +++ b/services/cdn/v1api/api_default_mock.go @@ -0,0 +1,338 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateDistributionExecuteMock can be populated to implement the behavior of the CreateDistributionExecute function of this mock + CreateDistributionExecuteMock *func(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) + // DeleteCustomDomainExecuteMock can be populated to implement the behavior of the DeleteCustomDomainExecute function of this mock + DeleteCustomDomainExecuteMock *func(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) + // DeleteDistributionExecuteMock can be populated to implement the behavior of the DeleteDistributionExecute function of this mock + DeleteDistributionExecuteMock *func(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) + // FindCachePathsExecuteMock can be populated to implement the behavior of the FindCachePathsExecute function of this mock + FindCachePathsExecuteMock *func(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) + // GetCacheInfoExecuteMock can be populated to implement the behavior of the GetCacheInfoExecute function of this mock + GetCacheInfoExecuteMock *func(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) + // GetCustomDomainExecuteMock can be populated to implement the behavior of the GetCustomDomainExecute function of this mock + GetCustomDomainExecuteMock *func(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) + // GetDistributionExecuteMock can be populated to implement the behavior of the GetDistributionExecute function of this mock + GetDistributionExecuteMock *func(r ApiGetDistributionRequest) (*GetDistributionResponse, error) + // GetLogsExecuteMock can be populated to implement the behavior of the GetLogsExecute function of this mock + GetLogsExecuteMock *func(r ApiGetLogsRequest) (*GetLogsResponse, error) + // GetLogsSearchFiltersExecuteMock can be populated to implement the behavior of the GetLogsSearchFiltersExecute function of this mock + GetLogsSearchFiltersExecuteMock *func(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) + // GetStatisticsExecuteMock can be populated to implement the behavior of the GetStatisticsExecute function of this mock + GetStatisticsExecuteMock *func(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) + // ListDistributionsExecuteMock can be populated to implement the behavior of the ListDistributionsExecute function of this mock + ListDistributionsExecuteMock *func(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) + // ListWafCollectionsExecuteMock can be populated to implement the behavior of the ListWafCollectionsExecute function of this mock + ListWafCollectionsExecuteMock *func(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) + // PatchDistributionExecuteMock can be populated to implement the behavior of the PatchDistributionExecute function of this mock + PatchDistributionExecuteMock *func(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) + // PurgeCacheExecuteMock can be populated to implement the behavior of the PurgeCacheExecute function of this mock + PurgeCacheExecuteMock *func(r ApiPurgeCacheRequest) (map[string]interface{}, error) + // PutCustomDomainExecuteMock can be populated to implement the behavior of the PutCustomDomainExecute function of this mock + PutCustomDomainExecuteMock *func(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) +} + +func (a DefaultAPIServiceMock) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { + return ApiCreateDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// CreateDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { + if a.CreateDistributionExecuteMock == nil { + var localVarReturnValue *CreateDistributionResponse + return localVarReturnValue, nil + } + + return (*a.CreateDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { + return ApiDeleteCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// DeleteCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { + if a.DeleteCustomDomainExecuteMock == nil { + var localVarReturnValue *DeleteCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.DeleteCustomDomainExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { + return ApiDeleteDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// DeleteDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { + if a.DeleteDistributionExecuteMock == nil { + var localVarReturnValue *DeleteDistributionResponse + return localVarReturnValue, nil + } + + return (*a.DeleteDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { + return ApiFindCachePathsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// FindCachePathsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the FindCachePathsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { + if a.FindCachePathsExecuteMock == nil { + var localVarReturnValue *FindCachePathsResponse + return localVarReturnValue, nil + } + + return (*a.FindCachePathsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { + return ApiGetCacheInfoRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetCacheInfoExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCacheInfoExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { + if a.GetCacheInfoExecuteMock == nil { + var localVarReturnValue *GetCacheInfoResponse + return localVarReturnValue, nil + } + + return (*a.GetCacheInfoExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { + return ApiGetCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// GetCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { + if a.GetCustomDomainExecuteMock == nil { + var localVarReturnValue *GetCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.GetCustomDomainExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { + return ApiGetDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { + if a.GetDistributionExecuteMock == nil { + var localVarReturnValue *GetDistributionResponse + return localVarReturnValue, nil + } + + return (*a.GetDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { + return ApiGetLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetLogsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { + if a.GetLogsExecuteMock == nil { + var localVarReturnValue *GetLogsResponse + return localVarReturnValue, nil + } + + return (*a.GetLogsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { + return ApiGetLogsSearchFiltersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetLogsSearchFiltersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsSearchFiltersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { + if a.GetLogsSearchFiltersExecuteMock == nil { + var localVarReturnValue *GetLogsSearchFiltersResponse + return localVarReturnValue, nil + } + + return (*a.GetLogsSearchFiltersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { + return ApiGetStatisticsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetStatisticsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetStatisticsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { + if a.GetStatisticsExecuteMock == nil { + var localVarReturnValue *GetStatisticsResponse + return localVarReturnValue, nil + } + + return (*a.GetStatisticsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { + return ApiListDistributionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListDistributionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDistributionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { + if a.ListDistributionsExecuteMock == nil { + var localVarReturnValue *ListDistributionsResponse + return localVarReturnValue, nil + } + + return (*a.ListDistributionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest { + return ApiListWafCollectionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListWafCollectionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListWafCollectionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) { + if a.ListWafCollectionsExecuteMock == nil { + var localVarReturnValue *ListWafCollectionsResponse + return localVarReturnValue, nil + } + + return (*a.ListWafCollectionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { + return ApiPatchDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// PatchDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { + if a.PatchDistributionExecuteMock == nil { + var localVarReturnValue *PatchDistributionResponse + return localVarReturnValue, nil + } + + return (*a.PatchDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { + return ApiPurgeCacheRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// PurgeCacheExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PurgeCacheExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { + if a.PurgeCacheExecuteMock == nil { + var localVarReturnValue map[string]interface{} + return localVarReturnValue, nil + } + + return (*a.PurgeCacheExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { + return ApiPutCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// PutCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PutCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { + if a.PutCustomDomainExecuteMock == nil { + var localVarReturnValue *PutCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.PutCustomDomainExecuteMock)(r) +} diff --git a/services/cdn/v1api/client.go b/services/cdn/v1api/client.go new file mode 100644 index 000000000..3fe0e2ac4 --- /dev/null +++ b/services/cdn/v1api/client.go @@ -0,0 +1,658 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the CDN API API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/cdn/v1api/configuration.go b/services/cdn/v1api/configuration.go new file mode 100644 index 000000000..b8c19f97a --- /dev/null +++ b/services/cdn/v1api/configuration.go @@ -0,0 +1,37 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/cdn", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://cdn.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/cdn/v1api/model_bucket_backend.go b/services/cdn/v1api/model_bucket_backend.go new file mode 100644 index 000000000..d38112115 --- /dev/null +++ b/services/cdn/v1api/model_bucket_backend.go @@ -0,0 +1,212 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BucketBackend type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketBackend{} + +// BucketBackend struct for BucketBackend +type BucketBackend struct { + BucketUrl string `json:"bucketUrl"` + Region string `json:"region"` + Type string `json:"type"` +} + +type _BucketBackend BucketBackend + +// NewBucketBackend instantiates a new BucketBackend 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 NewBucketBackend(bucketUrl string, region string, types string) *BucketBackend { + this := BucketBackend{} + this.BucketUrl = bucketUrl + this.Region = region + this.Type = types + return &this +} + +// NewBucketBackendWithDefaults instantiates a new BucketBackend 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 NewBucketBackendWithDefaults() *BucketBackend { + this := BucketBackend{} + return &this +} + +// GetBucketUrl returns the BucketUrl field value +func (o *BucketBackend) GetBucketUrl() string { + if o == nil { + var ret string + return ret + } + + return o.BucketUrl +} + +// GetBucketUrlOk returns a tuple with the BucketUrl field value +// and a boolean to check if the value has been set. +func (o *BucketBackend) GetBucketUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BucketUrl, true +} + +// SetBucketUrl sets field value +func (o *BucketBackend) SetBucketUrl(v string) { + o.BucketUrl = v +} + +// GetRegion returns the Region field value +func (o *BucketBackend) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *BucketBackend) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *BucketBackend) SetRegion(v string) { + o.Region = v +} + +// GetType returns the Type field value +func (o *BucketBackend) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BucketBackend) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BucketBackend) SetType(v string) { + o.Type = v +} + +func (o BucketBackend) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketBackend) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bucketUrl"] = o.BucketUrl + toSerialize["region"] = o.Region + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BucketBackend) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "bucketUrl", + "region", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBucketBackend := _BucketBackend{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketBackend) + + if err != nil { + return err + } + + *o = BucketBackend(varBucketBackend) + + return err +} + +type NullableBucketBackend struct { + value *BucketBackend + isSet bool +} + +func (v NullableBucketBackend) Get() *BucketBackend { + return v.value +} + +func (v *NullableBucketBackend) Set(val *BucketBackend) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackend(val *BucketBackend) *NullableBucketBackend { + return &NullableBucketBackend{value: val, isSet: true} +} + +func (v NullableBucketBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_bucket_backend_create.go b/services/cdn/v1api/model_bucket_backend_create.go new file mode 100644 index 000000000..953a7ac4b --- /dev/null +++ b/services/cdn/v1api/model_bucket_backend_create.go @@ -0,0 +1,240 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BucketBackendCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketBackendCreate{} + +// BucketBackendCreate struct for BucketBackendCreate +type BucketBackendCreate struct { + BucketUrl string `json:"bucketUrl"` + Credentials BucketCredentials `json:"credentials"` + Region string `json:"region"` + Type string `json:"type"` +} + +type _BucketBackendCreate BucketBackendCreate + +// NewBucketBackendCreate instantiates a new BucketBackendCreate 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 NewBucketBackendCreate(bucketUrl string, credentials BucketCredentials, region string, types string) *BucketBackendCreate { + this := BucketBackendCreate{} + this.BucketUrl = bucketUrl + this.Credentials = credentials + this.Region = region + this.Type = types + return &this +} + +// NewBucketBackendCreateWithDefaults instantiates a new BucketBackendCreate 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 NewBucketBackendCreateWithDefaults() *BucketBackendCreate { + this := BucketBackendCreate{} + return &this +} + +// GetBucketUrl returns the BucketUrl field value +func (o *BucketBackendCreate) GetBucketUrl() string { + if o == nil { + var ret string + return ret + } + + return o.BucketUrl +} + +// GetBucketUrlOk returns a tuple with the BucketUrl field value +// and a boolean to check if the value has been set. +func (o *BucketBackendCreate) GetBucketUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BucketUrl, true +} + +// SetBucketUrl sets field value +func (o *BucketBackendCreate) SetBucketUrl(v string) { + o.BucketUrl = v +} + +// GetCredentials returns the Credentials field value +func (o *BucketBackendCreate) GetCredentials() BucketCredentials { + if o == nil { + var ret BucketCredentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *BucketBackendCreate) GetCredentialsOk() (*BucketCredentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *BucketBackendCreate) SetCredentials(v BucketCredentials) { + o.Credentials = v +} + +// GetRegion returns the Region field value +func (o *BucketBackendCreate) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *BucketBackendCreate) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *BucketBackendCreate) SetRegion(v string) { + o.Region = v +} + +// GetType returns the Type field value +func (o *BucketBackendCreate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BucketBackendCreate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BucketBackendCreate) SetType(v string) { + o.Type = v +} + +func (o BucketBackendCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketBackendCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bucketUrl"] = o.BucketUrl + toSerialize["credentials"] = o.Credentials + toSerialize["region"] = o.Region + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BucketBackendCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "bucketUrl", + "credentials", + "region", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBucketBackendCreate := _BucketBackendCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketBackendCreate) + + if err != nil { + return err + } + + *o = BucketBackendCreate(varBucketBackendCreate) + + return err +} + +type NullableBucketBackendCreate struct { + value *BucketBackendCreate + isSet bool +} + +func (v NullableBucketBackendCreate) Get() *BucketBackendCreate { + return v.value +} + +func (v *NullableBucketBackendCreate) Set(val *BucketBackendCreate) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackendCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackendCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackendCreate(val *BucketBackendCreate) *NullableBucketBackendCreate { + return &NullableBucketBackendCreate{value: val, isSet: true} +} + +func (v NullableBucketBackendCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackendCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_bucket_backend_patch.go b/services/cdn/v1api/model_bucket_backend_patch.go new file mode 100644 index 000000000..240b2dc48 --- /dev/null +++ b/services/cdn/v1api/model_bucket_backend_patch.go @@ -0,0 +1,264 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BucketBackendPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketBackendPatch{} + +// BucketBackendPatch struct for BucketBackendPatch +type BucketBackendPatch struct { + BucketUrl *string `json:"bucketUrl,omitempty"` + Credentials *BucketCredentials `json:"credentials,omitempty"` + Region *string `json:"region,omitempty"` + Type string `json:"type"` +} + +type _BucketBackendPatch BucketBackendPatch + +// NewBucketBackendPatch instantiates a new BucketBackendPatch 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 NewBucketBackendPatch(types string) *BucketBackendPatch { + this := BucketBackendPatch{} + this.Type = types + return &this +} + +// NewBucketBackendPatchWithDefaults instantiates a new BucketBackendPatch 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 NewBucketBackendPatchWithDefaults() *BucketBackendPatch { + this := BucketBackendPatch{} + return &this +} + +// GetBucketUrl returns the BucketUrl field value if set, zero value otherwise. +func (o *BucketBackendPatch) GetBucketUrl() string { + if o == nil || IsNil(o.BucketUrl) { + var ret string + return ret + } + return *o.BucketUrl +} + +// GetBucketUrlOk returns a tuple with the BucketUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketBackendPatch) GetBucketUrlOk() (*string, bool) { + if o == nil || IsNil(o.BucketUrl) { + return nil, false + } + return o.BucketUrl, true +} + +// HasBucketUrl returns a boolean if a field has been set. +func (o *BucketBackendPatch) HasBucketUrl() bool { + if o != nil && !IsNil(o.BucketUrl) { + return true + } + + return false +} + +// SetBucketUrl gets a reference to the given string and assigns it to the BucketUrl field. +func (o *BucketBackendPatch) SetBucketUrl(v string) { + o.BucketUrl = &v +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *BucketBackendPatch) GetCredentials() BucketCredentials { + if o == nil || IsNil(o.Credentials) { + var ret BucketCredentials + return ret + } + return *o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketBackendPatch) GetCredentialsOk() (*BucketCredentials, bool) { + if o == nil || IsNil(o.Credentials) { + return nil, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *BucketBackendPatch) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given BucketCredentials and assigns it to the Credentials field. +func (o *BucketBackendPatch) SetCredentials(v BucketCredentials) { + o.Credentials = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *BucketBackendPatch) GetRegion() string { + if o == nil || IsNil(o.Region) { + 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 *BucketBackendPatch) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *BucketBackendPatch) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *BucketBackendPatch) SetRegion(v string) { + o.Region = &v +} + +// GetType returns the Type field value +func (o *BucketBackendPatch) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BucketBackendPatch) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BucketBackendPatch) SetType(v string) { + o.Type = v +} + +func (o BucketBackendPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketBackendPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BucketUrl) { + toSerialize["bucketUrl"] = o.BucketUrl + } + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BucketBackendPatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBucketBackendPatch := _BucketBackendPatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketBackendPatch) + + if err != nil { + return err + } + + *o = BucketBackendPatch(varBucketBackendPatch) + + return err +} + +type NullableBucketBackendPatch struct { + value *BucketBackendPatch + isSet bool +} + +func (v NullableBucketBackendPatch) Get() *BucketBackendPatch { + return v.value +} + +func (v *NullableBucketBackendPatch) Set(val *BucketBackendPatch) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackendPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackendPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackendPatch(val *BucketBackendPatch) *NullableBucketBackendPatch { + return &NullableBucketBackendPatch{value: val, isSet: true} +} + +func (v NullableBucketBackendPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackendPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_bucket_credentials.go b/services/cdn/v1api/model_bucket_credentials.go new file mode 100644 index 000000000..d8da028da --- /dev/null +++ b/services/cdn/v1api/model_bucket_credentials.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BucketCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketCredentials{} + +// BucketCredentials struct for BucketCredentials +type BucketCredentials struct { + AccessKeyId string `json:"accessKeyId"` + SecretAccessKey string `json:"secretAccessKey"` +} + +type _BucketCredentials BucketCredentials + +// NewBucketCredentials instantiates a new BucketCredentials 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 NewBucketCredentials(accessKeyId string, secretAccessKey string) *BucketCredentials { + this := BucketCredentials{} + this.AccessKeyId = accessKeyId + this.SecretAccessKey = secretAccessKey + return &this +} + +// NewBucketCredentialsWithDefaults instantiates a new BucketCredentials 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 NewBucketCredentialsWithDefaults() *BucketCredentials { + this := BucketCredentials{} + return &this +} + +// GetAccessKeyId returns the AccessKeyId field value +func (o *BucketCredentials) GetAccessKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.AccessKeyId +} + +// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value +// and a boolean to check if the value has been set. +func (o *BucketCredentials) GetAccessKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessKeyId, true +} + +// SetAccessKeyId sets field value +func (o *BucketCredentials) SetAccessKeyId(v string) { + o.AccessKeyId = v +} + +// GetSecretAccessKey returns the SecretAccessKey field value +func (o *BucketCredentials) GetSecretAccessKey() string { + if o == nil { + var ret string + return ret + } + + return o.SecretAccessKey +} + +// GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value +// and a boolean to check if the value has been set. +func (o *BucketCredentials) GetSecretAccessKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SecretAccessKey, true +} + +// SetSecretAccessKey sets field value +func (o *BucketCredentials) SetSecretAccessKey(v string) { + o.SecretAccessKey = v +} + +func (o BucketCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accessKeyId"] = o.AccessKeyId + toSerialize["secretAccessKey"] = o.SecretAccessKey + return toSerialize, nil +} + +func (o *BucketCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "accessKeyId", + "secretAccessKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBucketCredentials := _BucketCredentials{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketCredentials) + + if err != nil { + return err + } + + *o = BucketCredentials(varBucketCredentials) + + return err +} + +type NullableBucketCredentials struct { + value *BucketCredentials + isSet bool +} + +func (v NullableBucketCredentials) Get() *BucketCredentials { + return v.value +} + +func (v *NullableBucketCredentials) Set(val *BucketCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableBucketCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketCredentials(val *BucketCredentials) *NullableBucketCredentials { + return &NullableBucketCredentials{value: val, isSet: true} +} + +func (v NullableBucketCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_config.go b/services/cdn/v1api/model_config.go new file mode 100644 index 000000000..03aab463f --- /dev/null +++ b/services/cdn/v1api/model_config.go @@ -0,0 +1,474 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Config type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Config{} + +// Config struct for Config +type Config struct { + Backend ConfigBackend `json:"backend"` + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g. DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIps []string `json:"blockedIps"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` + LogSink *LokiLogSink `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *Optimizer `json:"optimizer,omitempty"` + Redirects *RedirectConfig `json:"redirects,omitempty"` + Regions []Region `json:"regions"` + Waf WafConfig `json:"waf"` +} + +type _Config Config + +// NewConfig instantiates a new Config 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 NewConfig(backend ConfigBackend, blockedCountries []string, blockedIps []string, regions []Region, waf WafConfig) *Config { + this := Config{} + this.Backend = backend + this.BlockedCountries = blockedCountries + this.BlockedIps = blockedIps + this.Regions = regions + this.Waf = waf + return &this +} + +// NewConfigWithDefaults instantiates a new Config 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 NewConfigWithDefaults() *Config { + this := Config{} + return &this +} + +// GetBackend returns the Backend field value +func (o *Config) GetBackend() ConfigBackend { + if o == nil { + var ret ConfigBackend + return ret + } + + return o.Backend +} + +// GetBackendOk returns a tuple with the Backend field value +// and a boolean to check if the value has been set. +func (o *Config) GetBackendOk() (*ConfigBackend, bool) { + if o == nil { + return nil, false + } + return &o.Backend, true +} + +// SetBackend sets field value +func (o *Config) SetBackend(v ConfigBackend) { + o.Backend = v +} + +// GetBlockedCountries returns the BlockedCountries field value +func (o *Config) GetBlockedCountries() []string { + if o == nil { + var ret []string + return ret + } + + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value +// and a boolean to check if the value has been set. +func (o *Config) GetBlockedCountriesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BlockedCountries, true +} + +// SetBlockedCountries sets field value +func (o *Config) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIps returns the BlockedIps field value +func (o *Config) GetBlockedIps() []string { + if o == nil { + var ret []string + return ret + } + + return o.BlockedIps +} + +// GetBlockedIpsOk returns a tuple with the BlockedIps field value +// and a boolean to check if the value has been set. +func (o *Config) GetBlockedIpsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BlockedIps, true +} + +// SetBlockedIps sets field value +func (o *Config) SetBlockedIps(v []string) { + o.BlockedIps = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Config) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration.Get()) { + var ret string + return ret + } + return *o.DefaultCacheDuration.Get() +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *Config) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *Config) HasDefaultCacheDuration() bool { + if o != nil && o.DefaultCacheDuration.IsSet() { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. +func (o *Config) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration.Set(&v) +} + +// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +func (o *Config) SetDefaultCacheDurationNil() { + o.DefaultCacheDuration.Set(nil) +} + +// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +func (o *Config) UnsetDefaultCacheDuration() { + o.DefaultCacheDuration.Unset() +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise. +func (o *Config) GetLogSink() LokiLogSink { + if o == nil || IsNil(o.LogSink) { + var ret LokiLogSink + return ret + } + return *o.LogSink +} + +// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Config) GetLogSinkOk() (*LokiLogSink, bool) { + if o == nil || IsNil(o.LogSink) { + return nil, false + } + return o.LogSink, true +} + +// HasLogSink returns a boolean if a field has been set. +func (o *Config) HasLogSink() bool { + if o != nil && !IsNil(o.LogSink) { + return true + } + + return false +} + +// SetLogSink gets a reference to the given LokiLogSink and assigns it to the LogSink field. +func (o *Config) SetLogSink(v LokiLogSink) { + o.LogSink = &v +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Config) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes.Get() +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *Config) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *Config) HasMonthlyLimitBytes() bool { + if o != nil && o.MonthlyLimitBytes.IsSet() { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. +func (o *Config) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes.Set(&v) +} + +// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +func (o *Config) SetMonthlyLimitBytesNil() { + o.MonthlyLimitBytes.Set(nil) +} + +// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +func (o *Config) UnsetMonthlyLimitBytes() { + o.MonthlyLimitBytes.Unset() +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *Config) GetOptimizer() Optimizer { + if o == nil || IsNil(o.Optimizer) { + var ret Optimizer + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Config) GetOptimizerOk() (*Optimizer, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *Config) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. +func (o *Config) SetOptimizer(v Optimizer) { + o.Optimizer = &v +} + +// GetRedirects returns the Redirects field value if set, zero value otherwise. +func (o *Config) GetRedirects() RedirectConfig { + if o == nil || IsNil(o.Redirects) { + var ret RedirectConfig + return ret + } + return *o.Redirects +} + +// GetRedirectsOk returns a tuple with the Redirects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Config) GetRedirectsOk() (*RedirectConfig, bool) { + if o == nil || IsNil(o.Redirects) { + return nil, false + } + return o.Redirects, true +} + +// HasRedirects returns a boolean if a field has been set. +func (o *Config) HasRedirects() bool { + if o != nil && !IsNil(o.Redirects) { + return true + } + + return false +} + +// SetRedirects gets a reference to the given RedirectConfig and assigns it to the Redirects field. +func (o *Config) SetRedirects(v RedirectConfig) { + o.Redirects = &v +} + +// GetRegions returns the Regions field value +func (o *Config) GetRegions() []Region { + if o == nil { + var ret []Region + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *Config) GetRegionsOk() ([]Region, bool) { + if o == nil { + return nil, false + } + return o.Regions, true +} + +// SetRegions sets field value +func (o *Config) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value +func (o *Config) GetWaf() WafConfig { + if o == nil { + var ret WafConfig + return ret + } + + return o.Waf +} + +// GetWafOk returns a tuple with the Waf field value +// and a boolean to check if the value has been set. +func (o *Config) GetWafOk() (*WafConfig, bool) { + if o == nil { + return nil, false + } + return &o.Waf, true +} + +// SetWaf sets field value +func (o *Config) SetWaf(v WafConfig) { + o.Waf = v +} + +func (o Config) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Config) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backend"] = o.Backend + toSerialize["blockedCountries"] = o.BlockedCountries + toSerialize["blockedIps"] = o.BlockedIps + if o.DefaultCacheDuration.IsSet() { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() + } + if !IsNil(o.LogSink) { + toSerialize["logSink"] = o.LogSink + } + if o.MonthlyLimitBytes.IsSet() { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + if !IsNil(o.Redirects) { + toSerialize["redirects"] = o.Redirects + } + toSerialize["regions"] = o.Regions + toSerialize["waf"] = o.Waf + return toSerialize, nil +} + +func (o *Config) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backend", + "blockedCountries", + "blockedIps", + "regions", + "waf", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConfig := _Config{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varConfig) + + if err != nil { + return err + } + + *o = Config(varConfig) + + return err +} + +type NullableConfig struct { + value *Config + isSet bool +} + +func (v NullableConfig) Get() *Config { + return v.value +} + +func (v *NullableConfig) Set(val *Config) { + v.value = val + v.isSet = true +} + +func (v NullableConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfig(val *Config) *NullableConfig { + return &NullableConfig{value: val, isSet: true} +} + +func (v NullableConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_config_backend.go b/services/cdn/v1api/model_config_backend.go new file mode 100644 index 000000000..3bf45639a --- /dev/null +++ b/services/cdn/v1api/model_config_backend.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ConfigBackend - struct for ConfigBackend +type ConfigBackend struct { + BucketBackend *BucketBackend + HttpBackend *HttpBackend +} + +// BucketBackendAsConfigBackend is a convenience function that returns BucketBackend wrapped in ConfigBackend +func BucketBackendAsConfigBackend(v *BucketBackend) ConfigBackend { + return ConfigBackend{ + BucketBackend: v, + } +} + +// HttpBackendAsConfigBackend is a convenience function that returns HttpBackend wrapped in ConfigBackend +func HttpBackendAsConfigBackend(v *HttpBackend) ConfigBackend { + return ConfigBackend{ + HttpBackend: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ConfigBackend) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'bucket' + if jsonDict["type"] == "bucket" { + // try to unmarshal JSON data into BucketBackend + err = json.Unmarshal(data, &dst.BucketBackend) + if err == nil { + return nil // data stored in dst.BucketBackend, return on the first match + } else { + dst.BucketBackend = nil + return fmt.Errorf("failed to unmarshal ConfigBackend as BucketBackend: %s", err.Error()) + } + } + + // check if the discriminator value is 'http' + if jsonDict["type"] == "http" { + // try to unmarshal JSON data into HttpBackend + err = json.Unmarshal(data, &dst.HttpBackend) + if err == nil { + return nil // data stored in dst.HttpBackend, return on the first match + } else { + dst.HttpBackend = nil + return fmt.Errorf("failed to unmarshal ConfigBackend as HttpBackend: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ConfigBackend) MarshalJSON() ([]byte, error) { + if src.BucketBackend != nil { + return json.Marshal(&src.BucketBackend) + } + + if src.HttpBackend != nil { + return json.Marshal(&src.HttpBackend) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ConfigBackend) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.BucketBackend != nil { + return obj.BucketBackend + } + + if obj.HttpBackend != nil { + return obj.HttpBackend + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ConfigBackend) GetActualInstanceValue() interface{} { + if obj.BucketBackend != nil { + return *obj.BucketBackend + } + + if obj.HttpBackend != nil { + return *obj.HttpBackend + } + + // all schemas are nil + return nil +} + +type NullableConfigBackend struct { + value *ConfigBackend + isSet bool +} + +func (v NullableConfigBackend) Get() *ConfigBackend { + return v.value +} + +func (v *NullableConfigBackend) Set(val *ConfigBackend) { + v.value = val + v.isSet = true +} + +func (v NullableConfigBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigBackend(val *ConfigBackend) *NullableConfigBackend { + return &NullableConfigBackend{value: val, isSet: true} +} + +func (v NullableConfigBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_config_patch.go b/services/cdn/v1api/model_config_patch.go new file mode 100644 index 000000000..398e9c756 --- /dev/null +++ b/services/cdn/v1api/model_config_patch.go @@ -0,0 +1,485 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ConfigPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigPatch{} + +// ConfigPatch struct for ConfigPatch +type ConfigPatch struct { + Backend *ConfigPatchBackend `json:"backend,omitempty"` + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries,omitempty"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIps []string `json:"blockedIps,omitempty"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` + LogSink NullableLokiLogSinkPatch `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *OptimizerPatch `json:"optimizer,omitempty"` + Redirects *RedirectConfig `json:"redirects,omitempty"` + Regions []Region `json:"regions,omitempty"` + Waf *WafConfigPatch `json:"waf,omitempty"` +} + +// NewConfigPatch instantiates a new ConfigPatch 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 NewConfigPatch() *ConfigPatch { + this := ConfigPatch{} + return &this +} + +// NewConfigPatchWithDefaults instantiates a new ConfigPatch 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 NewConfigPatchWithDefaults() *ConfigPatch { + this := ConfigPatch{} + return &this +} + +// GetBackend returns the Backend field value if set, zero value otherwise. +func (o *ConfigPatch) GetBackend() ConfigPatchBackend { + if o == nil || IsNil(o.Backend) { + var ret ConfigPatchBackend + return ret + } + return *o.Backend +} + +// GetBackendOk returns a tuple with the Backend field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBackendOk() (*ConfigPatchBackend, bool) { + if o == nil || IsNil(o.Backend) { + return nil, false + } + return o.Backend, true +} + +// HasBackend returns a boolean if a field has been set. +func (o *ConfigPatch) HasBackend() bool { + if o != nil && !IsNil(o.Backend) { + return true + } + + return false +} + +// SetBackend gets a reference to the given ConfigPatchBackend and assigns it to the Backend field. +func (o *ConfigPatch) SetBackend(v ConfigPatchBackend) { + o.Backend = &v +} + +// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +func (o *ConfigPatch) GetBlockedCountries() []string { + if o == nil || IsNil(o.BlockedCountries) { + var ret []string + return ret + } + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBlockedCountriesOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedCountries) { + return nil, false + } + return o.BlockedCountries, true +} + +// HasBlockedCountries returns a boolean if a field has been set. +func (o *ConfigPatch) HasBlockedCountries() bool { + if o != nil && !IsNil(o.BlockedCountries) { + return true + } + + return false +} + +// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. +func (o *ConfigPatch) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. +func (o *ConfigPatch) GetBlockedIps() []string { + if o == nil || IsNil(o.BlockedIps) { + var ret []string + return ret + } + return o.BlockedIps +} + +// GetBlockedIpsOk returns a tuple with the BlockedIps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBlockedIpsOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedIps) { + return nil, false + } + return o.BlockedIps, true +} + +// HasBlockedIps returns a boolean if a field has been set. +func (o *ConfigPatch) HasBlockedIps() bool { + if o != nil && !IsNil(o.BlockedIps) { + return true + } + + return false +} + +// SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. +func (o *ConfigPatch) SetBlockedIps(v []string) { + o.BlockedIps = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration.Get()) { + var ret string + return ret + } + return *o.DefaultCacheDuration.Get() +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *ConfigPatch) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *ConfigPatch) HasDefaultCacheDuration() bool { + if o != nil && o.DefaultCacheDuration.IsSet() { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. +func (o *ConfigPatch) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration.Set(&v) +} + +// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +func (o *ConfigPatch) SetDefaultCacheDurationNil() { + o.DefaultCacheDuration.Set(nil) +} + +// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +func (o *ConfigPatch) UnsetDefaultCacheDuration() { + o.DefaultCacheDuration.Unset() +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetLogSink() LokiLogSinkPatch { + if o == nil || IsNil(o.LogSink.Get()) { + var ret LokiLogSinkPatch + return ret + } + return *o.LogSink.Get() +} + +// GetLogSinkOk returns a tuple with the LogSink 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 *ConfigPatch) GetLogSinkOk() (*LokiLogSinkPatch, bool) { + if o == nil { + return nil, false + } + return o.LogSink.Get(), o.LogSink.IsSet() +} + +// HasLogSink returns a boolean if a field has been set. +func (o *ConfigPatch) HasLogSink() bool { + if o != nil && o.LogSink.IsSet() { + return true + } + + return false +} + +// SetLogSink gets a reference to the given NullableLokiLogSinkPatch and assigns it to the LogSink field. +func (o *ConfigPatch) SetLogSink(v LokiLogSinkPatch) { + o.LogSink.Set(&v) +} + +// SetLogSinkNil sets the value for LogSink to be an explicit nil +func (o *ConfigPatch) SetLogSinkNil() { + o.LogSink.Set(nil) +} + +// UnsetLogSink ensures that no value is present for LogSink, not even an explicit nil +func (o *ConfigPatch) UnsetLogSink() { + o.LogSink.Unset() +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes.Get() +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *ConfigPatch) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *ConfigPatch) HasMonthlyLimitBytes() bool { + if o != nil && o.MonthlyLimitBytes.IsSet() { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. +func (o *ConfigPatch) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes.Set(&v) +} + +// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +func (o *ConfigPatch) SetMonthlyLimitBytesNil() { + o.MonthlyLimitBytes.Set(nil) +} + +// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +func (o *ConfigPatch) UnsetMonthlyLimitBytes() { + o.MonthlyLimitBytes.Unset() +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *ConfigPatch) GetOptimizer() OptimizerPatch { + if o == nil || IsNil(o.Optimizer) { + var ret OptimizerPatch + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetOptimizerOk() (*OptimizerPatch, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *ConfigPatch) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given OptimizerPatch and assigns it to the Optimizer field. +func (o *ConfigPatch) SetOptimizer(v OptimizerPatch) { + o.Optimizer = &v +} + +// GetRedirects returns the Redirects field value if set, zero value otherwise. +func (o *ConfigPatch) GetRedirects() RedirectConfig { + if o == nil || IsNil(o.Redirects) { + var ret RedirectConfig + return ret + } + return *o.Redirects +} + +// GetRedirectsOk returns a tuple with the Redirects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetRedirectsOk() (*RedirectConfig, bool) { + if o == nil || IsNil(o.Redirects) { + return nil, false + } + return o.Redirects, true +} + +// HasRedirects returns a boolean if a field has been set. +func (o *ConfigPatch) HasRedirects() bool { + if o != nil && !IsNil(o.Redirects) { + return true + } + + return false +} + +// SetRedirects gets a reference to the given RedirectConfig and assigns it to the Redirects field. +func (o *ConfigPatch) SetRedirects(v RedirectConfig) { + o.Redirects = &v +} + +// GetRegions returns the Regions field value if set, zero value otherwise. +func (o *ConfigPatch) GetRegions() []Region { + if o == nil || IsNil(o.Regions) { + var ret []Region + return ret + } + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetRegionsOk() ([]Region, bool) { + if o == nil || IsNil(o.Regions) { + return nil, false + } + return o.Regions, true +} + +// HasRegions returns a boolean if a field has been set. +func (o *ConfigPatch) HasRegions() bool { + if o != nil && !IsNil(o.Regions) { + return true + } + + return false +} + +// SetRegions gets a reference to the given []Region and assigns it to the Regions field. +func (o *ConfigPatch) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *ConfigPatch) GetWaf() WafConfigPatch { + if o == nil || IsNil(o.Waf) { + var ret WafConfigPatch + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetWafOk() (*WafConfigPatch, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *ConfigPatch) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given WafConfigPatch and assigns it to the Waf field. +func (o *ConfigPatch) SetWaf(v WafConfigPatch) { + o.Waf = &v +} + +func (o ConfigPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Backend) { + toSerialize["backend"] = o.Backend + } + if !IsNil(o.BlockedCountries) { + toSerialize["blockedCountries"] = o.BlockedCountries + } + if !IsNil(o.BlockedIps) { + toSerialize["blockedIps"] = o.BlockedIps + } + if o.DefaultCacheDuration.IsSet() { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() + } + if o.LogSink.IsSet() { + toSerialize["logSink"] = o.LogSink.Get() + } + if o.MonthlyLimitBytes.IsSet() { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + if !IsNil(o.Redirects) { + toSerialize["redirects"] = o.Redirects + } + if !IsNil(o.Regions) { + toSerialize["regions"] = o.Regions + } + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +type NullableConfigPatch struct { + value *ConfigPatch + isSet bool +} + +func (v NullableConfigPatch) Get() *ConfigPatch { + return v.value +} + +func (v *NullableConfigPatch) Set(val *ConfigPatch) { + v.value = val + v.isSet = true +} + +func (v NullableConfigPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigPatch(val *ConfigPatch) *NullableConfigPatch { + return &NullableConfigPatch{value: val, isSet: true} +} + +func (v NullableConfigPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_config_patch_backend.go b/services/cdn/v1api/model_config_patch_backend.go new file mode 100644 index 000000000..75cba3c2b --- /dev/null +++ b/services/cdn/v1api/model_config_patch_backend.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ConfigPatchBackend - struct for ConfigPatchBackend +type ConfigPatchBackend struct { + BucketBackendPatch *BucketBackendPatch + HttpBackendPatch *HttpBackendPatch +} + +// BucketBackendPatchAsConfigPatchBackend is a convenience function that returns BucketBackendPatch wrapped in ConfigPatchBackend +func BucketBackendPatchAsConfigPatchBackend(v *BucketBackendPatch) ConfigPatchBackend { + return ConfigPatchBackend{ + BucketBackendPatch: v, + } +} + +// HttpBackendPatchAsConfigPatchBackend is a convenience function that returns HttpBackendPatch wrapped in ConfigPatchBackend +func HttpBackendPatchAsConfigPatchBackend(v *HttpBackendPatch) ConfigPatchBackend { + return ConfigPatchBackend{ + HttpBackendPatch: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ConfigPatchBackend) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'bucket' + if jsonDict["type"] == "bucket" { + // try to unmarshal JSON data into BucketBackendPatch + err = json.Unmarshal(data, &dst.BucketBackendPatch) + if err == nil { + return nil // data stored in dst.BucketBackendPatch, return on the first match + } else { + dst.BucketBackendPatch = nil + return fmt.Errorf("failed to unmarshal ConfigPatchBackend as BucketBackendPatch: %s", err.Error()) + } + } + + // check if the discriminator value is 'http' + if jsonDict["type"] == "http" { + // try to unmarshal JSON data into HttpBackendPatch + err = json.Unmarshal(data, &dst.HttpBackendPatch) + if err == nil { + return nil // data stored in dst.HttpBackendPatch, return on the first match + } else { + dst.HttpBackendPatch = nil + return fmt.Errorf("failed to unmarshal ConfigPatchBackend as HttpBackendPatch: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ConfigPatchBackend) MarshalJSON() ([]byte, error) { + if src.BucketBackendPatch != nil { + return json.Marshal(&src.BucketBackendPatch) + } + + if src.HttpBackendPatch != nil { + return json.Marshal(&src.HttpBackendPatch) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ConfigPatchBackend) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.BucketBackendPatch != nil { + return obj.BucketBackendPatch + } + + if obj.HttpBackendPatch != nil { + return obj.HttpBackendPatch + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ConfigPatchBackend) GetActualInstanceValue() interface{} { + if obj.BucketBackendPatch != nil { + return *obj.BucketBackendPatch + } + + if obj.HttpBackendPatch != nil { + return *obj.HttpBackendPatch + } + + // all schemas are nil + return nil +} + +type NullableConfigPatchBackend struct { + value *ConfigPatchBackend + isSet bool +} + +func (v NullableConfigPatchBackend) Get() *ConfigPatchBackend { + return v.value +} + +func (v *NullableConfigPatchBackend) Set(val *ConfigPatchBackend) { + v.value = val + v.isSet = true +} + +func (v NullableConfigPatchBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigPatchBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigPatchBackend(val *ConfigPatchBackend) *NullableConfigPatchBackend { + return &NullableConfigPatchBackend{value: val, isSet: true} +} + +func (v NullableConfigPatchBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigPatchBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_create_distribution_payload.go b/services/cdn/v1api/model_create_distribution_payload.go new file mode 100644 index 000000000..a8401c22d --- /dev/null +++ b/services/cdn/v1api/model_create_distribution_payload.go @@ -0,0 +1,514 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateDistributionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDistributionPayload{} + +// CreateDistributionPayload struct for CreateDistributionPayload +type CreateDistributionPayload struct { + Backend CreateDistributionPayloadBackend `json:"backend"` + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries,omitempty"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIps []string `json:"blockedIps,omitempty"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration *string `json:"defaultCacheDuration,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` + LogSink *LokiLogSinkCreate `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes *int64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *Optimizer `json:"optimizer,omitempty"` + Redirects *RedirectConfig `json:"redirects,omitempty"` + // Define in which regions you would like your content to be cached. + Regions []Region `json:"regions"` + Waf *WafConfig `json:"waf,omitempty"` +} + +type _CreateDistributionPayload CreateDistributionPayload + +// NewCreateDistributionPayload instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayload(backend CreateDistributionPayloadBackend, regions []Region) *CreateDistributionPayload { + this := CreateDistributionPayload{} + this.Backend = backend + this.Regions = regions + return &this +} + +// NewCreateDistributionPayloadWithDefaults instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayloadWithDefaults() *CreateDistributionPayload { + this := CreateDistributionPayload{} + return &this +} + +// GetBackend returns the Backend field value +func (o *CreateDistributionPayload) GetBackend() CreateDistributionPayloadBackend { + if o == nil { + var ret CreateDistributionPayloadBackend + return ret + } + + return o.Backend +} + +// GetBackendOk returns a tuple with the Backend field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetBackendOk() (*CreateDistributionPayloadBackend, bool) { + if o == nil { + return nil, false + } + return &o.Backend, true +} + +// SetBackend sets field value +func (o *CreateDistributionPayload) SetBackend(v CreateDistributionPayloadBackend) { + o.Backend = v +} + +// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetBlockedCountries() []string { + if o == nil || IsNil(o.BlockedCountries) { + var ret []string + return ret + } + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetBlockedCountriesOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedCountries) { + return nil, false + } + return o.BlockedCountries, true +} + +// HasBlockedCountries returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasBlockedCountries() bool { + if o != nil && !IsNil(o.BlockedCountries) { + return true + } + + return false +} + +// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. +func (o *CreateDistributionPayload) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetBlockedIps() []string { + if o == nil || IsNil(o.BlockedIps) { + var ret []string + return ret + } + return o.BlockedIps +} + +// GetBlockedIpsOk returns a tuple with the BlockedIps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetBlockedIpsOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedIps) { + return nil, false + } + return o.BlockedIps, true +} + +// HasBlockedIps returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasBlockedIps() bool { + if o != nil && !IsNil(o.BlockedIps) { + return true + } + + return false +} + +// SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. +func (o *CreateDistributionPayload) SetBlockedIps(v []string) { + o.BlockedIps = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration) { + var ret string + return ret + } + return *o.DefaultCacheDuration +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil || IsNil(o.DefaultCacheDuration) { + return nil, false + } + return o.DefaultCacheDuration, true +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasDefaultCacheDuration() bool { + if o != nil && !IsNil(o.DefaultCacheDuration) { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +func (o *CreateDistributionPayload) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *CreateDistributionPayload) SetIntentId(v string) { + o.IntentId = &v +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetLogSink() LokiLogSinkCreate { + if o == nil || IsNil(o.LogSink) { + var ret LokiLogSinkCreate + return ret + } + return *o.LogSink +} + +// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetLogSinkOk() (*LokiLogSinkCreate, bool) { + if o == nil || IsNil(o.LogSink) { + return nil, false + } + return o.LogSink, true +} + +// HasLogSink returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasLogSink() bool { + if o != nil && !IsNil(o.LogSink) { + return true + } + + return false +} + +// SetLogSink gets a reference to the given LokiLogSinkCreate and assigns it to the LogSink field. +func (o *CreateDistributionPayload) SetLogSink(v LokiLogSinkCreate) { + o.LogSink = &v +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil || IsNil(o.MonthlyLimitBytes) { + return nil, false + } + return o.MonthlyLimitBytes, true +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasMonthlyLimitBytes() bool { + if o != nil && !IsNil(o.MonthlyLimitBytes) { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. +func (o *CreateDistributionPayload) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes = &v +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetOptimizer() Optimizer { + if o == nil || IsNil(o.Optimizer) { + var ret Optimizer + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetOptimizerOk() (*Optimizer, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. +func (o *CreateDistributionPayload) SetOptimizer(v Optimizer) { + o.Optimizer = &v +} + +// GetRedirects returns the Redirects field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetRedirects() RedirectConfig { + if o == nil || IsNil(o.Redirects) { + var ret RedirectConfig + return ret + } + return *o.Redirects +} + +// GetRedirectsOk returns a tuple with the Redirects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetRedirectsOk() (*RedirectConfig, bool) { + if o == nil || IsNil(o.Redirects) { + return nil, false + } + return o.Redirects, true +} + +// HasRedirects returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasRedirects() bool { + if o != nil && !IsNil(o.Redirects) { + return true + } + + return false +} + +// SetRedirects gets a reference to the given RedirectConfig and assigns it to the Redirects field. +func (o *CreateDistributionPayload) SetRedirects(v RedirectConfig) { + o.Redirects = &v +} + +// GetRegions returns the Regions field value +func (o *CreateDistributionPayload) GetRegions() []Region { + if o == nil { + var ret []Region + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetRegionsOk() ([]Region, bool) { + if o == nil { + return nil, false + } + return o.Regions, true +} + +// SetRegions sets field value +func (o *CreateDistributionPayload) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetWaf() WafConfig { + if o == nil || IsNil(o.Waf) { + var ret WafConfig + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetWafOk() (*WafConfig, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given WafConfig and assigns it to the Waf field. +func (o *CreateDistributionPayload) SetWaf(v WafConfig) { + o.Waf = &v +} + +func (o CreateDistributionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backend"] = o.Backend + if !IsNil(o.BlockedCountries) { + toSerialize["blockedCountries"] = o.BlockedCountries + } + if !IsNil(o.BlockedIps) { + toSerialize["blockedIps"] = o.BlockedIps + } + if !IsNil(o.DefaultCacheDuration) { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + if !IsNil(o.LogSink) { + toSerialize["logSink"] = o.LogSink + } + if !IsNil(o.MonthlyLimitBytes) { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + if !IsNil(o.Redirects) { + toSerialize["redirects"] = o.Redirects + } + toSerialize["regions"] = o.Regions + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +func (o *CreateDistributionPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backend", + "regions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDistributionPayload := _CreateDistributionPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDistributionPayload) + + if err != nil { + return err + } + + *o = CreateDistributionPayload(varCreateDistributionPayload) + + return err +} + +type NullableCreateDistributionPayload struct { + value *CreateDistributionPayload + isSet bool +} + +func (v NullableCreateDistributionPayload) Get() *CreateDistributionPayload { + return v.value +} + +func (v *NullableCreateDistributionPayload) Set(val *CreateDistributionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDistributionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDistributionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDistributionPayload(val *CreateDistributionPayload) *NullableCreateDistributionPayload { + return &NullableCreateDistributionPayload{value: val, isSet: true} +} + +func (v NullableCreateDistributionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDistributionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_create_distribution_payload_backend.go b/services/cdn/v1api/model_create_distribution_payload_backend.go new file mode 100644 index 000000000..6b8b56961 --- /dev/null +++ b/services/cdn/v1api/model_create_distribution_payload_backend.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CreateDistributionPayloadBackend - Configuration for the content origin backend. +type CreateDistributionPayloadBackend struct { + BucketBackendCreate *BucketBackendCreate + HttpBackendCreate *HttpBackendCreate +} + +// BucketBackendCreateAsCreateDistributionPayloadBackend is a convenience function that returns BucketBackendCreate wrapped in CreateDistributionPayloadBackend +func BucketBackendCreateAsCreateDistributionPayloadBackend(v *BucketBackendCreate) CreateDistributionPayloadBackend { + return CreateDistributionPayloadBackend{ + BucketBackendCreate: v, + } +} + +// HttpBackendCreateAsCreateDistributionPayloadBackend is a convenience function that returns HttpBackendCreate wrapped in CreateDistributionPayloadBackend +func HttpBackendCreateAsCreateDistributionPayloadBackend(v *HttpBackendCreate) CreateDistributionPayloadBackend { + return CreateDistributionPayloadBackend{ + HttpBackendCreate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateDistributionPayloadBackend) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'bucket' + if jsonDict["type"] == "bucket" { + // try to unmarshal JSON data into BucketBackendCreate + err = json.Unmarshal(data, &dst.BucketBackendCreate) + if err == nil { + return nil // data stored in dst.BucketBackendCreate, return on the first match + } else { + dst.BucketBackendCreate = nil + return fmt.Errorf("failed to unmarshal CreateDistributionPayloadBackend as BucketBackendCreate: %s", err.Error()) + } + } + + // check if the discriminator value is 'http' + if jsonDict["type"] == "http" { + // try to unmarshal JSON data into HttpBackendCreate + err = json.Unmarshal(data, &dst.HttpBackendCreate) + if err == nil { + return nil // data stored in dst.HttpBackendCreate, return on the first match + } else { + dst.HttpBackendCreate = nil + return fmt.Errorf("failed to unmarshal CreateDistributionPayloadBackend as HttpBackendCreate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { + if src.BucketBackendCreate != nil { + return json.Marshal(&src.BucketBackendCreate) + } + + if src.HttpBackendCreate != nil { + return json.Marshal(&src.HttpBackendCreate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateDistributionPayloadBackend) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.BucketBackendCreate != nil { + return obj.BucketBackendCreate + } + + if obj.HttpBackendCreate != nil { + return obj.HttpBackendCreate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateDistributionPayloadBackend) GetActualInstanceValue() interface{} { + if obj.BucketBackendCreate != nil { + return *obj.BucketBackendCreate + } + + if obj.HttpBackendCreate != nil { + return *obj.HttpBackendCreate + } + + // all schemas are nil + return nil +} + +type NullableCreateDistributionPayloadBackend struct { + value *CreateDistributionPayloadBackend + isSet bool +} + +func (v NullableCreateDistributionPayloadBackend) Get() *CreateDistributionPayloadBackend { + return v.value +} + +func (v *NullableCreateDistributionPayloadBackend) Set(val *CreateDistributionPayloadBackend) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDistributionPayloadBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDistributionPayloadBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDistributionPayloadBackend(val *CreateDistributionPayloadBackend) *NullableCreateDistributionPayloadBackend { + return &NullableCreateDistributionPayloadBackend{value: val, isSet: true} +} + +func (v NullableCreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDistributionPayloadBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_create_distribution_response.go b/services/cdn/v1api/model_create_distribution_response.go new file mode 100644 index 000000000..a2d768dc5 --- /dev/null +++ b/services/cdn/v1api/model_create_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDistributionResponse{} + +// CreateDistributionResponse struct for CreateDistributionResponse +type CreateDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _CreateDistributionResponse CreateDistributionResponse + +// NewCreateDistributionResponse instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponse(distribution Distribution) *CreateDistributionResponse { + this := CreateDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewCreateDistributionResponseWithDefaults instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponseWithDefaults() *CreateDistributionResponse { + this := CreateDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *CreateDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *CreateDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o CreateDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *CreateDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDistributionResponse := _CreateDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDistributionResponse) + + if err != nil { + return err + } + + *o = CreateDistributionResponse(varCreateDistributionResponse) + + return err +} + +type NullableCreateDistributionResponse struct { + value *CreateDistributionResponse + isSet bool +} + +func (v NullableCreateDistributionResponse) Get() *CreateDistributionResponse { + return v.value +} + +func (v *NullableCreateDistributionResponse) Set(val *CreateDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDistributionResponse(val *CreateDistributionResponse) *NullableCreateDistributionResponse { + return &NullableCreateDistributionResponse{value: val, isSet: true} +} + +func (v NullableCreateDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_custom_domain.go b/services/cdn/v1api/model_custom_domain.go new file mode 100644 index 000000000..9bf8eebd4 --- /dev/null +++ b/services/cdn/v1api/model_custom_domain.go @@ -0,0 +1,222 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CustomDomain type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomDomain{} + +// CustomDomain Definition of a custom domain +type CustomDomain struct { + // This object is present if the custom domain has errors. + Errors []StatusError `json:"errors,omitempty"` + // The domain. Can be used as input for the GetCustomDomain endpoint + Name string `json:"name"` + Status DomainStatus `json:"status"` +} + +type _CustomDomain CustomDomain + +// NewCustomDomain instantiates a new CustomDomain 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 NewCustomDomain(name string, status DomainStatus) *CustomDomain { + this := CustomDomain{} + this.Name = name + this.Status = status + return &this +} + +// NewCustomDomainWithDefaults instantiates a new CustomDomain 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 NewCustomDomainWithDefaults() *CustomDomain { + this := CustomDomain{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *CustomDomain) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *CustomDomain) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *CustomDomain) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetName returns the Name field value +func (o *CustomDomain) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomDomain) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *CustomDomain) GetStatus() DomainStatus { + if o == nil { + var ret DomainStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetStatusOk() (*DomainStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *CustomDomain) SetStatus(v DomainStatus) { + o.Status = v +} + +func (o CustomDomain) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomDomain) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *CustomDomain) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomDomain := _CustomDomain{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCustomDomain) + + if err != nil { + return err + } + + *o = CustomDomain(varCustomDomain) + + return err +} + +type NullableCustomDomain struct { + value *CustomDomain + isSet bool +} + +func (v NullableCustomDomain) Get() *CustomDomain { + return v.value +} + +func (v *NullableCustomDomain) Set(val *CustomDomain) { + v.value = val + v.isSet = true +} + +func (v NullableCustomDomain) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomDomain) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomDomain(val *CustomDomain) *NullableCustomDomain { + return &NullableCustomDomain{value: val, isSet: true} +} + +func (v NullableCustomDomain) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomDomain) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_delete_custom_domain_response.go b/services/cdn/v1api/model_delete_custom_domain_response.go new file mode 100644 index 000000000..c86f99c86 --- /dev/null +++ b/services/cdn/v1api/model_delete_custom_domain_response.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the DeleteCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteCustomDomainResponse{} + +// DeleteCustomDomainResponse Returns the custom domain that was deleted while the deletion has not completed yet. After the deletion was successful the response will be empty. +type DeleteCustomDomainResponse struct { + CustomDomain *CustomDomain `json:"customDomain,omitempty"` +} + +// NewDeleteCustomDomainResponse instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponse() *DeleteCustomDomainResponse { + this := DeleteCustomDomainResponse{} + return &this +} + +// NewDeleteCustomDomainResponseWithDefaults instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponseWithDefaults() *DeleteCustomDomainResponse { + this := DeleteCustomDomainResponse{} + return &this +} + +// GetCustomDomain returns the CustomDomain field value if set, zero value otherwise. +func (o *DeleteCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil || IsNil(o.CustomDomain) { + var ret CustomDomain + return ret + } + return *o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil || IsNil(o.CustomDomain) { + return nil, false + } + return o.CustomDomain, true +} + +// HasCustomDomain returns a boolean if a field has been set. +func (o *DeleteCustomDomainResponse) HasCustomDomain() bool { + if o != nil && !IsNil(o.CustomDomain) { + return true + } + + return false +} + +// SetCustomDomain gets a reference to the given CustomDomain and assigns it to the CustomDomain field. +func (o *DeleteCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = &v +} + +func (o DeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomDomain) { + toSerialize["customDomain"] = o.CustomDomain + } + return toSerialize, nil +} + +type NullableDeleteCustomDomainResponse struct { + value *DeleteCustomDomainResponse + isSet bool +} + +func (v NullableDeleteCustomDomainResponse) Get() *DeleteCustomDomainResponse { + return v.value +} + +func (v *NullableDeleteCustomDomainResponse) Set(val *DeleteCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteCustomDomainResponse(val *DeleteCustomDomainResponse) *NullableDeleteCustomDomainResponse { + return &NullableDeleteCustomDomainResponse{value: val, isSet: true} +} + +func (v NullableDeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_delete_distribution_response.go b/services/cdn/v1api/model_delete_distribution_response.go new file mode 100644 index 000000000..482ee73a2 --- /dev/null +++ b/services/cdn/v1api/model_delete_distribution_response.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the DeleteDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteDistributionResponse{} + +// DeleteDistributionResponse struct for DeleteDistributionResponse +type DeleteDistributionResponse struct { + Distribution *Distribution `json:"distribution,omitempty"` +} + +// NewDeleteDistributionResponse instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponse() *DeleteDistributionResponse { + this := DeleteDistributionResponse{} + return &this +} + +// NewDeleteDistributionResponseWithDefaults instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponseWithDefaults() *DeleteDistributionResponse { + this := DeleteDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value if set, zero value otherwise. +func (o *DeleteDistributionResponse) GetDistribution() Distribution { + if o == nil || IsNil(o.Distribution) { + var ret Distribution + return ret + } + return *o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil || IsNil(o.Distribution) { + return nil, false + } + return o.Distribution, true +} + +// HasDistribution returns a boolean if a field has been set. +func (o *DeleteDistributionResponse) HasDistribution() bool { + if o != nil && !IsNil(o.Distribution) { + return true + } + + return false +} + +// SetDistribution gets a reference to the given Distribution and assigns it to the Distribution field. +func (o *DeleteDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = &v +} + +func (o DeleteDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Distribution) { + toSerialize["distribution"] = o.Distribution + } + return toSerialize, nil +} + +type NullableDeleteDistributionResponse struct { + value *DeleteDistributionResponse + isSet bool +} + +func (v NullableDeleteDistributionResponse) Get() *DeleteDistributionResponse { + return v.value +} + +func (v *NullableDeleteDistributionResponse) Set(val *DeleteDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteDistributionResponse(val *DeleteDistributionResponse) *NullableDeleteDistributionResponse { + return &NullableDeleteDistributionResponse{value: val, isSet: true} +} + +func (v NullableDeleteDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_distribution.go b/services/cdn/v1api/model_distribution.go new file mode 100644 index 000000000..dd12e55ee --- /dev/null +++ b/services/cdn/v1api/model_distribution.go @@ -0,0 +1,401 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Distribution type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Distribution{} + +// Distribution struct for Distribution +type Distribution struct { + Config Config `json:"config"` + // RFC3339 string defining when the distribution was created + CreatedAt time.Time `json:"createdAt"` + Domains []Domain `json:"domains"` + // This object may be present if, and only if the distribution has encountered an error state. + Errors []StatusError `json:"errors,omitempty"` + Id string `json:"id"` + ProjectId string `json:"projectId"` + // - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. + Status string `json:"status"` + // RFC3339 string which returns the last time the distribution configuration was modified. + UpdatedAt time.Time `json:"updatedAt"` + Waf *DistributionWaf `json:"waf,omitempty"` +} + +type _Distribution Distribution + +// NewDistribution instantiates a new Distribution 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 NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status string, updatedAt time.Time) *Distribution { + this := Distribution{} + this.Config = config + this.CreatedAt = createdAt + this.Domains = domains + this.Id = id + this.ProjectId = projectId + this.Status = status + this.UpdatedAt = updatedAt + return &this +} + +// NewDistributionWithDefaults instantiates a new Distribution 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 NewDistributionWithDefaults() *Distribution { + this := Distribution{} + return &this +} + +// GetConfig returns the Config field value +func (o *Distribution) GetConfig() Config { + if o == nil { + var ret Config + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetConfigOk() (*Config, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *Distribution) SetConfig(v Config) { + o.Config = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Distribution) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Distribution) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDomains returns the Domains field value +func (o *Distribution) GetDomains() []Domain { + if o == nil { + var ret []Domain + return ret + } + + return o.Domains +} + +// GetDomainsOk returns a tuple with the Domains field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetDomainsOk() ([]Domain, bool) { + if o == nil { + return nil, false + } + return o.Domains, true +} + +// SetDomains sets field value +func (o *Distribution) SetDomains(v []Domain) { + o.Domains = v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Distribution) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Distribution) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Distribution) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *Distribution) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetId returns the Id field value +func (o *Distribution) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Distribution) SetId(v string) { + o.Id = v +} + +// GetProjectId returns the ProjectId field value +func (o *Distribution) GetProjectId() string { + if o == nil { + var ret string + return ret + } + + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value +func (o *Distribution) SetProjectId(v string) { + o.ProjectId = v +} + +// GetStatus returns the Status field value +func (o *Distribution) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Distribution) SetStatus(v string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *Distribution) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *Distribution) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *Distribution) GetWaf() DistributionWaf { + if o == nil || IsNil(o.Waf) { + var ret DistributionWaf + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Distribution) GetWafOk() (*DistributionWaf, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *Distribution) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given DistributionWaf and assigns it to the Waf field. +func (o *Distribution) SetWaf(v DistributionWaf) { + o.Waf = &v +} + +func (o Distribution) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Distribution) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["config"] = o.Config + toSerialize["createdAt"] = o.CreatedAt + toSerialize["domains"] = o.Domains + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["id"] = o.Id + toSerialize["projectId"] = o.ProjectId + toSerialize["status"] = o.Status + toSerialize["updatedAt"] = o.UpdatedAt + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +func (o *Distribution) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "config", + "createdAt", + "domains", + "id", + "projectId", + "status", + "updatedAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistribution := _Distribution{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistribution) + + if err != nil { + return err + } + + *o = Distribution(varDistribution) + + return err +} + +type NullableDistribution struct { + value *Distribution + isSet bool +} + +func (v NullableDistribution) Get() *Distribution { + return v.value +} + +func (v *NullableDistribution) Set(val *Distribution) { + v.value = val + v.isSet = true +} + +func (v NullableDistribution) IsSet() bool { + return v.isSet +} + +func (v *NullableDistribution) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistribution(val *Distribution) *NullableDistribution { + return &NullableDistribution{value: val, isSet: true} +} + +func (v NullableDistribution) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistribution) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_distribution_logs_record.go b/services/cdn/v1api/model_distribution_logs_record.go new file mode 100644 index 000000000..243710349 --- /dev/null +++ b/services/cdn/v1api/model_distribution_logs_record.go @@ -0,0 +1,418 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the DistributionLogsRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionLogsRecord{} + +// DistributionLogsRecord struct for DistributionLogsRecord +type DistributionLogsRecord struct { + CacheHit bool `json:"cacheHit"` + DataCenterRegion string `json:"dataCenterRegion"` + DistributionId string `json:"distributionId"` + Host string `json:"host"` + Path string `json:"path"` + // ISO 3166-1 A2 compliant country code + RequestCountryCode string `json:"requestCountryCode"` + Size int64 `json:"size"` + StatusCode int32 `json:"statusCode"` + Timestamp time.Time `json:"timestamp"` + WafViolation *WAFViolation `json:"wafViolation,omitempty"` +} + +type _DistributionLogsRecord DistributionLogsRecord + +// NewDistributionLogsRecord instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecord(cacheHit bool, dataCenterRegion string, distributionId string, host string, path string, requestCountryCode string, size int64, statusCode int32, timestamp time.Time) *DistributionLogsRecord { + this := DistributionLogsRecord{} + this.CacheHit = cacheHit + this.DataCenterRegion = dataCenterRegion + this.DistributionId = distributionId + this.Host = host + this.Path = path + this.RequestCountryCode = requestCountryCode + this.Size = size + this.StatusCode = statusCode + this.Timestamp = timestamp + return &this +} + +// NewDistributionLogsRecordWithDefaults instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecordWithDefaults() *DistributionLogsRecord { + this := DistributionLogsRecord{} + return &this +} + +// GetCacheHit returns the CacheHit field value +func (o *DistributionLogsRecord) GetCacheHit() bool { + if o == nil { + var ret bool + return ret + } + + return o.CacheHit +} + +// GetCacheHitOk returns a tuple with the CacheHit field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetCacheHitOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CacheHit, true +} + +// SetCacheHit sets field value +func (o *DistributionLogsRecord) SetCacheHit(v bool) { + o.CacheHit = v +} + +// GetDataCenterRegion returns the DataCenterRegion field value +func (o *DistributionLogsRecord) GetDataCenterRegion() string { + if o == nil { + var ret string + return ret + } + + return o.DataCenterRegion +} + +// GetDataCenterRegionOk returns a tuple with the DataCenterRegion field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetDataCenterRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DataCenterRegion, true +} + +// SetDataCenterRegion sets field value +func (o *DistributionLogsRecord) SetDataCenterRegion(v string) { + o.DataCenterRegion = v +} + +// GetDistributionId returns the DistributionId field value +func (o *DistributionLogsRecord) GetDistributionId() string { + if o == nil { + var ret string + return ret + } + + return o.DistributionId +} + +// GetDistributionIdOk returns a tuple with the DistributionId field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetDistributionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DistributionId, true +} + +// SetDistributionId sets field value +func (o *DistributionLogsRecord) SetDistributionId(v string) { + o.DistributionId = v +} + +// GetHost returns the Host field value +func (o *DistributionLogsRecord) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *DistributionLogsRecord) SetHost(v string) { + o.Host = v +} + +// GetPath returns the Path field value +func (o *DistributionLogsRecord) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *DistributionLogsRecord) SetPath(v string) { + o.Path = v +} + +// GetRequestCountryCode returns the RequestCountryCode field value +func (o *DistributionLogsRecord) GetRequestCountryCode() string { + if o == nil { + var ret string + return ret + } + + return o.RequestCountryCode +} + +// GetRequestCountryCodeOk returns a tuple with the RequestCountryCode field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetRequestCountryCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestCountryCode, true +} + +// SetRequestCountryCode sets field value +func (o *DistributionLogsRecord) SetRequestCountryCode(v string) { + o.RequestCountryCode = v +} + +// GetSize returns the Size field value +func (o *DistributionLogsRecord) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *DistributionLogsRecord) SetSize(v int64) { + o.Size = v +} + +// GetStatusCode returns the StatusCode field value +func (o *DistributionLogsRecord) GetStatusCode() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetStatusCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.StatusCode, true +} + +// SetStatusCode sets field value +func (o *DistributionLogsRecord) SetStatusCode(v int32) { + o.StatusCode = v +} + +// GetTimestamp returns the Timestamp field value +func (o *DistributionLogsRecord) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *DistributionLogsRecord) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +// GetWafViolation returns the WafViolation field value if set, zero value otherwise. +func (o *DistributionLogsRecord) GetWafViolation() WAFViolation { + if o == nil || IsNil(o.WafViolation) { + var ret WAFViolation + return ret + } + return *o.WafViolation +} + +// GetWafViolationOk returns a tuple with the WafViolation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetWafViolationOk() (*WAFViolation, bool) { + if o == nil || IsNil(o.WafViolation) { + return nil, false + } + return o.WafViolation, true +} + +// HasWafViolation returns a boolean if a field has been set. +func (o *DistributionLogsRecord) HasWafViolation() bool { + if o != nil && !IsNil(o.WafViolation) { + return true + } + + return false +} + +// SetWafViolation gets a reference to the given WAFViolation and assigns it to the WafViolation field. +func (o *DistributionLogsRecord) SetWafViolation(v WAFViolation) { + o.WafViolation = &v +} + +func (o DistributionLogsRecord) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionLogsRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cacheHit"] = o.CacheHit + toSerialize["dataCenterRegion"] = o.DataCenterRegion + toSerialize["distributionId"] = o.DistributionId + toSerialize["host"] = o.Host + toSerialize["path"] = o.Path + toSerialize["requestCountryCode"] = o.RequestCountryCode + toSerialize["size"] = o.Size + toSerialize["statusCode"] = o.StatusCode + toSerialize["timestamp"] = o.Timestamp + if !IsNil(o.WafViolation) { + toSerialize["wafViolation"] = o.WafViolation + } + return toSerialize, nil +} + +func (o *DistributionLogsRecord) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cacheHit", + "dataCenterRegion", + "distributionId", + "host", + "path", + "requestCountryCode", + "size", + "statusCode", + "timestamp", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionLogsRecord := _DistributionLogsRecord{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionLogsRecord) + + if err != nil { + return err + } + + *o = DistributionLogsRecord(varDistributionLogsRecord) + + return err +} + +type NullableDistributionLogsRecord struct { + value *DistributionLogsRecord + isSet bool +} + +func (v NullableDistributionLogsRecord) Get() *DistributionLogsRecord { + return v.value +} + +func (v *NullableDistributionLogsRecord) Set(val *DistributionLogsRecord) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionLogsRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionLogsRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionLogsRecord(val *DistributionLogsRecord) *NullableDistributionLogsRecord { + return &NullableDistributionLogsRecord{value: val, isSet: true} +} + +func (v NullableDistributionLogsRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionLogsRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_distribution_statistics_record.go b/services/cdn/v1api/model_distribution_statistics_record.go new file mode 100644 index 000000000..410767eda --- /dev/null +++ b/services/cdn/v1api/model_distribution_statistics_record.go @@ -0,0 +1,302 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the DistributionStatisticsRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecord{} + +// DistributionStatisticsRecord Aggregated statistics of a distribution during a time interval +type DistributionStatisticsRecord struct { + // Number of cached requests that were served + CachedRequests int64 `json:"cachedRequests"` + // Total number of requests that were served + TotalRequests int64 `json:"totalRequests"` + // Total traffic in bytes that occurred during the time interval + TotalTrafficBytes int64 `json:"totalTrafficBytes"` + // Exclusive end of the time interval the statistics refer to + End time.Time `json:"end"` + Regions DistributionStatisticsRecordRegions `json:"regions"` + // Start of the time interval the statistics refer to + Start time.Time `json:"start"` +} + +type _DistributionStatisticsRecord DistributionStatisticsRecord + +// NewDistributionStatisticsRecord instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecord(cachedRequests int64, totalRequests int64, totalTrafficBytes int64, end time.Time, regions DistributionStatisticsRecordRegions, start time.Time) *DistributionStatisticsRecord { + this := DistributionStatisticsRecord{} + this.CachedRequests = cachedRequests + this.TotalRequests = totalRequests + this.TotalTrafficBytes = totalTrafficBytes + this.End = end + this.Regions = regions + this.Start = start + return &this +} + +// NewDistributionStatisticsRecordWithDefaults instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecordWithDefaults() *DistributionStatisticsRecord { + this := DistributionStatisticsRecord{} + return &this +} + +// GetCachedRequests returns the CachedRequests field value +func (o *DistributionStatisticsRecord) GetCachedRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.CachedRequests +} + +// GetCachedRequestsOk returns a tuple with the CachedRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetCachedRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.CachedRequests, true +} + +// SetCachedRequests sets field value +func (o *DistributionStatisticsRecord) SetCachedRequests(v int64) { + o.CachedRequests = v +} + +// GetTotalRequests returns the TotalRequests field value +func (o *DistributionStatisticsRecord) GetTotalRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalRequests +} + +// GetTotalRequestsOk returns a tuple with the TotalRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetTotalRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequests, true +} + +// SetTotalRequests sets field value +func (o *DistributionStatisticsRecord) SetTotalRequests(v int64) { + o.TotalRequests = v +} + +// GetTotalTrafficBytes returns the TotalTrafficBytes field value +func (o *DistributionStatisticsRecord) GetTotalTrafficBytes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalTrafficBytes +} + +// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetTotalTrafficBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalTrafficBytes, true +} + +// SetTotalTrafficBytes sets field value +func (o *DistributionStatisticsRecord) SetTotalTrafficBytes(v int64) { + o.TotalTrafficBytes = v +} + +// GetEnd returns the End field value +func (o *DistributionStatisticsRecord) GetEnd() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetEndOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value +func (o *DistributionStatisticsRecord) SetEnd(v time.Time) { + o.End = v +} + +// GetRegions returns the Regions field value +func (o *DistributionStatisticsRecord) GetRegions() DistributionStatisticsRecordRegions { + if o == nil { + var ret DistributionStatisticsRecordRegions + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetRegionsOk() (*DistributionStatisticsRecordRegions, bool) { + if o == nil { + return nil, false + } + return &o.Regions, true +} + +// SetRegions sets field value +func (o *DistributionStatisticsRecord) SetRegions(v DistributionStatisticsRecordRegions) { + o.Regions = v +} + +// GetStart returns the Start field value +func (o *DistributionStatisticsRecord) GetStart() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetStartOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value +func (o *DistributionStatisticsRecord) SetStart(v time.Time) { + o.Start = v +} + +func (o DistributionStatisticsRecord) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cachedRequests"] = o.CachedRequests + toSerialize["totalRequests"] = o.TotalRequests + toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes + toSerialize["end"] = o.End + toSerialize["regions"] = o.Regions + toSerialize["start"] = o.Start + return toSerialize, nil +} + +func (o *DistributionStatisticsRecord) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cachedRequests", + "totalRequests", + "totalTrafficBytes", + "end", + "regions", + "start", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecord := _DistributionStatisticsRecord{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecord) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecord(varDistributionStatisticsRecord) + + return err +} + +type NullableDistributionStatisticsRecord struct { + value *DistributionStatisticsRecord + isSet bool +} + +func (v NullableDistributionStatisticsRecord) Get() *DistributionStatisticsRecord { + return v.value +} + +func (v *NullableDistributionStatisticsRecord) Set(val *DistributionStatisticsRecord) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecord(val *DistributionStatisticsRecord) *NullableDistributionStatisticsRecord { + return &NullableDistributionStatisticsRecord{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_distribution_statistics_record_entry.go b/services/cdn/v1api/model_distribution_statistics_record_entry.go new file mode 100644 index 000000000..073689162 --- /dev/null +++ b/services/cdn/v1api/model_distribution_statistics_record_entry.go @@ -0,0 +1,215 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionStatisticsRecordEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecordEntry{} + +// DistributionStatisticsRecordEntry struct for DistributionStatisticsRecordEntry +type DistributionStatisticsRecordEntry struct { + // Number of cached requests that were served + CachedRequests int64 `json:"cachedRequests"` + // Total number of requests that were served + TotalRequests int64 `json:"totalRequests"` + // Total traffic in bytes that occurred during the time interval + TotalTrafficBytes int64 `json:"totalTrafficBytes"` +} + +type _DistributionStatisticsRecordEntry DistributionStatisticsRecordEntry + +// NewDistributionStatisticsRecordEntry instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntry(cachedRequests int64, totalRequests int64, totalTrafficBytes int64) *DistributionStatisticsRecordEntry { + this := DistributionStatisticsRecordEntry{} + this.CachedRequests = cachedRequests + this.TotalRequests = totalRequests + this.TotalTrafficBytes = totalTrafficBytes + return &this +} + +// NewDistributionStatisticsRecordEntryWithDefaults instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntryWithDefaults() *DistributionStatisticsRecordEntry { + this := DistributionStatisticsRecordEntry{} + return &this +} + +// GetCachedRequests returns the CachedRequests field value +func (o *DistributionStatisticsRecordEntry) GetCachedRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.CachedRequests +} + +// GetCachedRequestsOk returns a tuple with the CachedRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetCachedRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.CachedRequests, true +} + +// SetCachedRequests sets field value +func (o *DistributionStatisticsRecordEntry) SetCachedRequests(v int64) { + o.CachedRequests = v +} + +// GetTotalRequests returns the TotalRequests field value +func (o *DistributionStatisticsRecordEntry) GetTotalRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalRequests +} + +// GetTotalRequestsOk returns a tuple with the TotalRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetTotalRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequests, true +} + +// SetTotalRequests sets field value +func (o *DistributionStatisticsRecordEntry) SetTotalRequests(v int64) { + o.TotalRequests = v +} + +// GetTotalTrafficBytes returns the TotalTrafficBytes field value +func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalTrafficBytes +} + +// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalTrafficBytes, true +} + +// SetTotalTrafficBytes sets field value +func (o *DistributionStatisticsRecordEntry) SetTotalTrafficBytes(v int64) { + o.TotalTrafficBytes = v +} + +func (o DistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecordEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cachedRequests"] = o.CachedRequests + toSerialize["totalRequests"] = o.TotalRequests + toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes + return toSerialize, nil +} + +func (o *DistributionStatisticsRecordEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cachedRequests", + "totalRequests", + "totalTrafficBytes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecordEntry := _DistributionStatisticsRecordEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecordEntry) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecordEntry(varDistributionStatisticsRecordEntry) + + return err +} + +type NullableDistributionStatisticsRecordEntry struct { + value *DistributionStatisticsRecordEntry + isSet bool +} + +func (v NullableDistributionStatisticsRecordEntry) Get() *DistributionStatisticsRecordEntry { + return v.value +} + +func (v *NullableDistributionStatisticsRecordEntry) Set(val *DistributionStatisticsRecordEntry) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecordEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecordEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecordEntry(val *DistributionStatisticsRecordEntry) *NullableDistributionStatisticsRecordEntry { + return &NullableDistributionStatisticsRecordEntry{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecordEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_distribution_statistics_record_regions.go b/services/cdn/v1api/model_distribution_statistics_record_regions.go new file mode 100644 index 000000000..a54d6177f --- /dev/null +++ b/services/cdn/v1api/model_distribution_statistics_record_regions.go @@ -0,0 +1,268 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionStatisticsRecordRegions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecordRegions{} + +// DistributionStatisticsRecordRegions Mapping of regions to the metrics for this region for the defined time interval All regions are always present. If no traffic was reported for a region, it will still contain 0-filled properties +type DistributionStatisticsRecordRegions struct { + AF DistributionStatisticsRecordEntry `json:"AF"` + ASIA DistributionStatisticsRecordEntry `json:"ASIA"` + EU DistributionStatisticsRecordEntry `json:"EU"` + SA DistributionStatisticsRecordEntry `json:"SA"` + US DistributionStatisticsRecordEntry `json:"US"` +} + +type _DistributionStatisticsRecordRegions DistributionStatisticsRecordRegions + +// NewDistributionStatisticsRecordRegions instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegions(aF DistributionStatisticsRecordEntry, aSIA DistributionStatisticsRecordEntry, eU DistributionStatisticsRecordEntry, sA DistributionStatisticsRecordEntry, uS DistributionStatisticsRecordEntry) *DistributionStatisticsRecordRegions { + this := DistributionStatisticsRecordRegions{} + this.AF = aF + this.ASIA = aSIA + this.EU = eU + this.SA = sA + this.US = uS + return &this +} + +// NewDistributionStatisticsRecordRegionsWithDefaults instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegionsWithDefaults() *DistributionStatisticsRecordRegions { + this := DistributionStatisticsRecordRegions{} + return &this +} + +// GetAF returns the AF field value +func (o *DistributionStatisticsRecordRegions) GetAF() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.AF +} + +// GetAFOk returns a tuple with the AF field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetAFOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.AF, true +} + +// SetAF sets field value +func (o *DistributionStatisticsRecordRegions) SetAF(v DistributionStatisticsRecordEntry) { + o.AF = v +} + +// GetASIA returns the ASIA field value +func (o *DistributionStatisticsRecordRegions) GetASIA() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.ASIA +} + +// GetASIAOk returns a tuple with the ASIA field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetASIAOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.ASIA, true +} + +// SetASIA sets field value +func (o *DistributionStatisticsRecordRegions) SetASIA(v DistributionStatisticsRecordEntry) { + o.ASIA = v +} + +// GetEU returns the EU field value +func (o *DistributionStatisticsRecordRegions) GetEU() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.EU +} + +// GetEUOk returns a tuple with the EU field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetEUOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.EU, true +} + +// SetEU sets field value +func (o *DistributionStatisticsRecordRegions) SetEU(v DistributionStatisticsRecordEntry) { + o.EU = v +} + +// GetSA returns the SA field value +func (o *DistributionStatisticsRecordRegions) GetSA() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.SA +} + +// GetSAOk returns a tuple with the SA field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetSAOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.SA, true +} + +// SetSA sets field value +func (o *DistributionStatisticsRecordRegions) SetSA(v DistributionStatisticsRecordEntry) { + o.SA = v +} + +// GetUS returns the US field value +func (o *DistributionStatisticsRecordRegions) GetUS() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.US +} + +// GetUSOk returns a tuple with the US field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetUSOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.US, true +} + +// SetUS sets field value +func (o *DistributionStatisticsRecordRegions) SetUS(v DistributionStatisticsRecordEntry) { + o.US = v +} + +func (o DistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecordRegions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["AF"] = o.AF + toSerialize["ASIA"] = o.ASIA + toSerialize["EU"] = o.EU + toSerialize["SA"] = o.SA + toSerialize["US"] = o.US + return toSerialize, nil +} + +func (o *DistributionStatisticsRecordRegions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "AF", + "ASIA", + "EU", + "SA", + "US", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecordRegions := _DistributionStatisticsRecordRegions{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecordRegions) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecordRegions(varDistributionStatisticsRecordRegions) + + return err +} + +type NullableDistributionStatisticsRecordRegions struct { + value *DistributionStatisticsRecordRegions + isSet bool +} + +func (v NullableDistributionStatisticsRecordRegions) Get() *DistributionStatisticsRecordRegions { + return v.value +} + +func (v *NullableDistributionStatisticsRecordRegions) Set(val *DistributionStatisticsRecordRegions) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecordRegions) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecordRegions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecordRegions(val *DistributionStatisticsRecordRegions) *NullableDistributionStatisticsRecordRegions { + return &NullableDistributionStatisticsRecordRegions{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecordRegions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_distribution_waf.go b/services/cdn/v1api/model_distribution_waf.go new file mode 100644 index 000000000..6b42fa8ee --- /dev/null +++ b/services/cdn/v1api/model_distribution_waf.go @@ -0,0 +1,212 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionWaf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionWaf{} + +// DistributionWaf For this property to be present two pre-conditions must be met: - the WAF was enabled at least once - the query parameter ?withWafStatus is truthy This property contains the waf Status. At this point in time, this contains all resolved rules. Rules are split into 3 groups: - enabledRules - logOnlyRules - disabledRules **Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!** +type DistributionWaf struct { + DisabledRules []WafStatusRuleBlock `json:"disabledRules"` + EnabledRules []WafStatusRuleBlock `json:"enabledRules"` + LogOnlyRules []WafStatusRuleBlock `json:"logOnlyRules"` +} + +type _DistributionWaf DistributionWaf + +// NewDistributionWaf instantiates a new DistributionWaf 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 NewDistributionWaf(disabledRules []WafStatusRuleBlock, enabledRules []WafStatusRuleBlock, logOnlyRules []WafStatusRuleBlock) *DistributionWaf { + this := DistributionWaf{} + this.DisabledRules = disabledRules + this.EnabledRules = enabledRules + this.LogOnlyRules = logOnlyRules + return &this +} + +// NewDistributionWafWithDefaults instantiates a new DistributionWaf 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 NewDistributionWafWithDefaults() *DistributionWaf { + this := DistributionWaf{} + return &this +} + +// GetDisabledRules returns the DisabledRules field value +func (o *DistributionWaf) GetDisabledRules() []WafStatusRuleBlock { + if o == nil { + var ret []WafStatusRuleBlock + return ret + } + + return o.DisabledRules +} + +// GetDisabledRulesOk returns a tuple with the DisabledRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetDisabledRulesOk() ([]WafStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.DisabledRules, true +} + +// SetDisabledRules sets field value +func (o *DistributionWaf) SetDisabledRules(v []WafStatusRuleBlock) { + o.DisabledRules = v +} + +// GetEnabledRules returns the EnabledRules field value +func (o *DistributionWaf) GetEnabledRules() []WafStatusRuleBlock { + if o == nil { + var ret []WafStatusRuleBlock + return ret + } + + return o.EnabledRules +} + +// GetEnabledRulesOk returns a tuple with the EnabledRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetEnabledRulesOk() ([]WafStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.EnabledRules, true +} + +// SetEnabledRules sets field value +func (o *DistributionWaf) SetEnabledRules(v []WafStatusRuleBlock) { + o.EnabledRules = v +} + +// GetLogOnlyRules returns the LogOnlyRules field value +func (o *DistributionWaf) GetLogOnlyRules() []WafStatusRuleBlock { + if o == nil { + var ret []WafStatusRuleBlock + return ret + } + + return o.LogOnlyRules +} + +// GetLogOnlyRulesOk returns a tuple with the LogOnlyRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetLogOnlyRulesOk() ([]WafStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.LogOnlyRules, true +} + +// SetLogOnlyRules sets field value +func (o *DistributionWaf) SetLogOnlyRules(v []WafStatusRuleBlock) { + o.LogOnlyRules = v +} + +func (o DistributionWaf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionWaf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["disabledRules"] = o.DisabledRules + toSerialize["enabledRules"] = o.EnabledRules + toSerialize["logOnlyRules"] = o.LogOnlyRules + return toSerialize, nil +} + +func (o *DistributionWaf) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "disabledRules", + "enabledRules", + "logOnlyRules", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionWaf := _DistributionWaf{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionWaf) + + if err != nil { + return err + } + + *o = DistributionWaf(varDistributionWaf) + + return err +} + +type NullableDistributionWaf struct { + value *DistributionWaf + isSet bool +} + +func (v NullableDistributionWaf) Get() *DistributionWaf { + return v.value +} + +func (v *NullableDistributionWaf) Set(val *DistributionWaf) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionWaf) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionWaf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionWaf(val *DistributionWaf) *NullableDistributionWaf { + return &NullableDistributionWaf{value: val, isSet: true} +} + +func (v NullableDistributionWaf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionWaf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_domain.go b/services/cdn/v1api/model_domain.go new file mode 100644 index 000000000..384d139e6 --- /dev/null +++ b/services/cdn/v1api/model_domain.go @@ -0,0 +1,251 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Domain type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Domain{} + +// Domain Definition of a custom or managed domain without any certificates or keys +type Domain struct { + // This object is present if the custom domain has errors. + Errors []StatusError `json:"errors,omitempty"` + // The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint + Name string `json:"name"` + Status DomainStatus `json:"status"` + // Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint + Type string `json:"type"` +} + +type _Domain Domain + +// NewDomain instantiates a new Domain 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 NewDomain(name string, status DomainStatus, types string) *Domain { + this := Domain{} + this.Name = name + this.Status = status + this.Type = types + return &this +} + +// NewDomainWithDefaults instantiates a new Domain 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 NewDomainWithDefaults() *Domain { + this := Domain{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Domain) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Domain) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Domain) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *Domain) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetName returns the Name field value +func (o *Domain) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Domain) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Domain) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *Domain) GetStatus() DomainStatus { + if o == nil { + var ret DomainStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Domain) GetStatusOk() (*DomainStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Domain) SetStatus(v DomainStatus) { + o.Status = v +} + +// GetType returns the Type field value +func (o *Domain) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Domain) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Domain) SetType(v string) { + o.Type = v +} + +func (o Domain) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Domain) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *Domain) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "status", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDomain := _Domain{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDomain) + + if err != nil { + return err + } + + *o = Domain(varDomain) + + return err +} + +type NullableDomain struct { + value *Domain + isSet bool +} + +func (v NullableDomain) Get() *Domain { + return v.value +} + +func (v *NullableDomain) Set(val *Domain) { + v.value = val + v.isSet = true +} + +func (v NullableDomain) IsSet() bool { + return v.isSet +} + +func (v *NullableDomain) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomain(val *Domain) *NullableDomain { + return &NullableDomain{value: val, isSet: true} +} + +func (v NullableDomain) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomain) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_domain_status.go b/services/cdn/v1api/model_domain_status.go new file mode 100644 index 000000000..78d299be6 --- /dev/null +++ b/services/cdn/v1api/model_domain_status.go @@ -0,0 +1,116 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// DomainStatus The status of the domain: CREATING indicates that the custom domain is being set up. UPDATING means that requested changes are being applied to the custom domain. ACTIVE means the custom domain is currently configured and active. DELETING means that the domain is in the process of being removed from the distribution. In case the domain has the ERROR state, more information will be available in the errors list. +type DomainStatus string + +// List of DomainStatus +const ( + DOMAINSTATUS_CREATING DomainStatus = "CREATING" + DOMAINSTATUS_ACTIVE DomainStatus = "ACTIVE" + DOMAINSTATUS_UPDATING DomainStatus = "UPDATING" + DOMAINSTATUS_DELETING DomainStatus = "DELETING" + DOMAINSTATUS_ERROR DomainStatus = "ERROR" +) + +// All allowed values of DomainStatus enum +var AllowedDomainStatusEnumValues = []DomainStatus{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "ERROR", +} + +func (v *DomainStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DomainStatus(value) + for _, existing := range AllowedDomainStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DomainStatus", value) +} + +// NewDomainStatusFromValue returns a pointer to a valid DomainStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDomainStatusFromValue(v string) (*DomainStatus, error) { + ev := DomainStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainStatus: valid values are %v", v, AllowedDomainStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DomainStatus) IsValid() bool { + for _, existing := range AllowedDomainStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DomainStatus value +func (v DomainStatus) Ptr() *DomainStatus { + return &v +} + +type NullableDomainStatus struct { + value *DomainStatus + isSet bool +} + +func (v NullableDomainStatus) Get() *DomainStatus { + return v.value +} + +func (v *NullableDomainStatus) Set(val *DomainStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDomainStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainStatus(val *DomainStatus) *NullableDomainStatus { + return &NullableDomainStatus{value: val, isSet: true} +} + +func (v NullableDomainStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_error_details.go b/services/cdn/v1api/model_error_details.go new file mode 100644 index 000000000..f5af26c49 --- /dev/null +++ b/services/cdn/v1api/model_error_details.go @@ -0,0 +1,259 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ErrorDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorDetails{} + +// ErrorDetails struct for ErrorDetails +type ErrorDetails struct { + // German description of the error + De *string `json:"de,omitempty"` + // English description of the error + En string `json:"en"` + // Optional field in the request this error detail refers to + Field *string `json:"field,omitempty"` + Key string `json:"key"` +} + +type _ErrorDetails ErrorDetails + +// NewErrorDetails instantiates a new ErrorDetails 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 NewErrorDetails(en string, key string) *ErrorDetails { + this := ErrorDetails{} + this.En = en + this.Key = key + return &this +} + +// NewErrorDetailsWithDefaults instantiates a new ErrorDetails 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 NewErrorDetailsWithDefaults() *ErrorDetails { + this := ErrorDetails{} + return &this +} + +// GetDe returns the De field value if set, zero value otherwise. +func (o *ErrorDetails) GetDe() string { + if o == nil || IsNil(o.De) { + var ret string + return ret + } + return *o.De +} + +// GetDeOk returns a tuple with the De field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetDeOk() (*string, bool) { + if o == nil || IsNil(o.De) { + return nil, false + } + return o.De, true +} + +// HasDe returns a boolean if a field has been set. +func (o *ErrorDetails) HasDe() bool { + if o != nil && !IsNil(o.De) { + return true + } + + return false +} + +// SetDe gets a reference to the given string and assigns it to the De field. +func (o *ErrorDetails) SetDe(v string) { + o.De = &v +} + +// GetEn returns the En field value +func (o *ErrorDetails) GetEn() string { + if o == nil { + var ret string + return ret + } + + return o.En +} + +// GetEnOk returns a tuple with the En field value +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetEnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.En, true +} + +// SetEn sets field value +func (o *ErrorDetails) SetEn(v string) { + o.En = v +} + +// GetField returns the Field field value if set, zero value otherwise. +func (o *ErrorDetails) GetField() string { + if o == nil || IsNil(o.Field) { + var ret string + return ret + } + return *o.Field +} + +// GetFieldOk returns a tuple with the Field field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetFieldOk() (*string, bool) { + if o == nil || IsNil(o.Field) { + return nil, false + } + return o.Field, true +} + +// HasField returns a boolean if a field has been set. +func (o *ErrorDetails) HasField() bool { + if o != nil && !IsNil(o.Field) { + return true + } + + return false +} + +// SetField gets a reference to the given string and assigns it to the Field field. +func (o *ErrorDetails) SetField(v string) { + o.Field = &v +} + +// GetKey returns the Key field value +func (o *ErrorDetails) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *ErrorDetails) SetKey(v string) { + o.Key = v +} + +func (o ErrorDetails) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.De) { + toSerialize["de"] = o.De + } + toSerialize["en"] = o.En + if !IsNil(o.Field) { + toSerialize["field"] = o.Field + } + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *ErrorDetails) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "en", + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varErrorDetails := _ErrorDetails{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varErrorDetails) + + if err != nil { + return err + } + + *o = ErrorDetails(varErrorDetails) + + return err +} + +type NullableErrorDetails struct { + value *ErrorDetails + isSet bool +} + +func (v NullableErrorDetails) Get() *ErrorDetails { + return v.value +} + +func (v *NullableErrorDetails) Set(val *ErrorDetails) { + v.value = val + v.isSet = true +} + +func (v NullableErrorDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorDetails(val *ErrorDetails) *NullableErrorDetails { + return &NullableErrorDetails{value: val, isSet: true} +} + +func (v NullableErrorDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_find_cache_paths_response.go b/services/cdn/v1api/model_find_cache_paths_response.go new file mode 100644 index 000000000..68eaf78b7 --- /dev/null +++ b/services/cdn/v1api/model_find_cache_paths_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the FindCachePathsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindCachePathsResponse{} + +// FindCachePathsResponse struct for FindCachePathsResponse +type FindCachePathsResponse struct { + Response []FindCachePathsResponseEntry `json:"response"` +} + +type _FindCachePathsResponse FindCachePathsResponse + +// NewFindCachePathsResponse instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponse(response []FindCachePathsResponseEntry) *FindCachePathsResponse { + this := FindCachePathsResponse{} + this.Response = response + return &this +} + +// NewFindCachePathsResponseWithDefaults instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponseWithDefaults() *FindCachePathsResponse { + this := FindCachePathsResponse{} + return &this +} + +// GetResponse returns the Response field value +func (o *FindCachePathsResponse) GetResponse() []FindCachePathsResponseEntry { + if o == nil { + var ret []FindCachePathsResponseEntry + return ret + } + + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value +// and a boolean to check if the value has been set. +func (o *FindCachePathsResponse) GetResponseOk() ([]FindCachePathsResponseEntry, bool) { + if o == nil { + return nil, false + } + return o.Response, true +} + +// SetResponse sets field value +func (o *FindCachePathsResponse) SetResponse(v []FindCachePathsResponseEntry) { + o.Response = v +} + +func (o FindCachePathsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindCachePathsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["response"] = o.Response + return toSerialize, nil +} + +func (o *FindCachePathsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "response", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFindCachePathsResponse := _FindCachePathsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFindCachePathsResponse) + + if err != nil { + return err + } + + *o = FindCachePathsResponse(varFindCachePathsResponse) + + return err +} + +type NullableFindCachePathsResponse struct { + value *FindCachePathsResponse + isSet bool +} + +func (v NullableFindCachePathsResponse) Get() *FindCachePathsResponse { + return v.value +} + +func (v *NullableFindCachePathsResponse) Set(val *FindCachePathsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFindCachePathsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFindCachePathsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindCachePathsResponse(val *FindCachePathsResponse) *NullableFindCachePathsResponse { + return &NullableFindCachePathsResponse{value: val, isSet: true} +} + +func (v NullableFindCachePathsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindCachePathsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_find_cache_paths_response_entry.go b/services/cdn/v1api/model_find_cache_paths_response_entry.go new file mode 100644 index 000000000..2315524d7 --- /dev/null +++ b/services/cdn/v1api/model_find_cache_paths_response_entry.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the FindCachePathsResponseEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindCachePathsResponseEntry{} + +// FindCachePathsResponseEntry struct for FindCachePathsResponseEntry +type FindCachePathsResponseEntry struct { + // Defines one path that was previously used as part of a granular purge + Path string `json:"path"` +} + +type _FindCachePathsResponseEntry FindCachePathsResponseEntry + +// NewFindCachePathsResponseEntry instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntry(path string) *FindCachePathsResponseEntry { + this := FindCachePathsResponseEntry{} + this.Path = path + return &this +} + +// NewFindCachePathsResponseEntryWithDefaults instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntryWithDefaults() *FindCachePathsResponseEntry { + this := FindCachePathsResponseEntry{} + return &this +} + +// GetPath returns the Path field value +func (o *FindCachePathsResponseEntry) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *FindCachePathsResponseEntry) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *FindCachePathsResponseEntry) SetPath(v string) { + o.Path = v +} + +func (o FindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindCachePathsResponseEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["path"] = o.Path + return toSerialize, nil +} + +func (o *FindCachePathsResponseEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "path", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFindCachePathsResponseEntry := _FindCachePathsResponseEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFindCachePathsResponseEntry) + + if err != nil { + return err + } + + *o = FindCachePathsResponseEntry(varFindCachePathsResponseEntry) + + return err +} + +type NullableFindCachePathsResponseEntry struct { + value *FindCachePathsResponseEntry + isSet bool +} + +func (v NullableFindCachePathsResponseEntry) Get() *FindCachePathsResponseEntry { + return v.value +} + +func (v *NullableFindCachePathsResponseEntry) Set(val *FindCachePathsResponseEntry) { + v.value = val + v.isSet = true +} + +func (v NullableFindCachePathsResponseEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableFindCachePathsResponseEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindCachePathsResponseEntry(val *FindCachePathsResponseEntry) *NullableFindCachePathsResponseEntry { + return &NullableFindCachePathsResponseEntry{value: val, isSet: true} +} + +func (v NullableFindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindCachePathsResponseEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_generic_json_response.go b/services/cdn/v1api/model_generic_json_response.go new file mode 100644 index 000000000..1b9d5bae4 --- /dev/null +++ b/services/cdn/v1api/model_generic_json_response.go @@ -0,0 +1,193 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GenericJsonResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenericJsonResponse{} + +// GenericJsonResponse struct for GenericJsonResponse +type GenericJsonResponse struct { + // Listing of issues with your request + Details []ErrorDetails `json:"details,omitempty"` + Message string `json:"message"` +} + +type _GenericJsonResponse GenericJsonResponse + +// NewGenericJsonResponse instantiates a new GenericJsonResponse 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 NewGenericJsonResponse(message string) *GenericJsonResponse { + this := GenericJsonResponse{} + this.Message = message + return &this +} + +// NewGenericJsonResponseWithDefaults instantiates a new GenericJsonResponse 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 NewGenericJsonResponseWithDefaults() *GenericJsonResponse { + this := GenericJsonResponse{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *GenericJsonResponse) GetDetails() []ErrorDetails { + if o == nil || IsNil(o.Details) { + var ret []ErrorDetails + return ret + } + return o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericJsonResponse) GetDetailsOk() ([]ErrorDetails, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *GenericJsonResponse) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given []ErrorDetails and assigns it to the Details field. +func (o *GenericJsonResponse) SetDetails(v []ErrorDetails) { + o.Details = v +} + +// GetMessage returns the Message field value +func (o *GenericJsonResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *GenericJsonResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *GenericJsonResponse) SetMessage(v string) { + o.Message = v +} + +func (o GenericJsonResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericJsonResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["message"] = o.Message + return toSerialize, nil +} + +func (o *GenericJsonResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGenericJsonResponse := _GenericJsonResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGenericJsonResponse) + + if err != nil { + return err + } + + *o = GenericJsonResponse(varGenericJsonResponse) + + return err +} + +type NullableGenericJsonResponse struct { + value *GenericJsonResponse + isSet bool +} + +func (v NullableGenericJsonResponse) Get() *GenericJsonResponse { + return v.value +} + +func (v *NullableGenericJsonResponse) Set(val *GenericJsonResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGenericJsonResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericJsonResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericJsonResponse(val *GenericJsonResponse) *NullableGenericJsonResponse { + return &NullableGenericJsonResponse{value: val, isSet: true} +} + +func (v NullableGenericJsonResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericJsonResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_cache_info_response.go b/services/cdn/v1api/model_get_cache_info_response.go new file mode 100644 index 000000000..c26de81a0 --- /dev/null +++ b/services/cdn/v1api/model_get_cache_info_response.go @@ -0,0 +1,188 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the GetCacheInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCacheInfoResponse{} + +// GetCacheInfoResponse struct for GetCacheInfoResponse +type GetCacheInfoResponse struct { + History []GetCacheInfoResponseHistoryEntry `json:"history"` + // Returns the last time the cache was purged by calling the PurgeCache endpoint. Time represented as RFC3339 compliant string. If the cache was never purged, this returns `null` + LastPurgeTime NullableTime `json:"lastPurgeTime"` +} + +type _GetCacheInfoResponse GetCacheInfoResponse + +// NewGetCacheInfoResponse instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponse(history []GetCacheInfoResponseHistoryEntry, lastPurgeTime NullableTime) *GetCacheInfoResponse { + this := GetCacheInfoResponse{} + this.History = history + this.LastPurgeTime = lastPurgeTime + return &this +} + +// NewGetCacheInfoResponseWithDefaults instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponseWithDefaults() *GetCacheInfoResponse { + this := GetCacheInfoResponse{} + return &this +} + +// GetHistory returns the History field value +func (o *GetCacheInfoResponse) GetHistory() []GetCacheInfoResponseHistoryEntry { + if o == nil { + var ret []GetCacheInfoResponseHistoryEntry + return ret + } + + return o.History +} + +// GetHistoryOk returns a tuple with the History field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponse) GetHistoryOk() ([]GetCacheInfoResponseHistoryEntry, bool) { + if o == nil { + return nil, false + } + return o.History, true +} + +// SetHistory sets field value +func (o *GetCacheInfoResponse) SetHistory(v []GetCacheInfoResponseHistoryEntry) { + o.History = v +} + +// GetLastPurgeTime returns the LastPurgeTime field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *GetCacheInfoResponse) GetLastPurgeTime() time.Time { + if o == nil || o.LastPurgeTime.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastPurgeTime.Get() +} + +// GetLastPurgeTimeOk returns a tuple with the LastPurgeTime field value +// 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 *GetCacheInfoResponse) GetLastPurgeTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastPurgeTime.Get(), o.LastPurgeTime.IsSet() +} + +// SetLastPurgeTime sets field value +func (o *GetCacheInfoResponse) SetLastPurgeTime(v time.Time) { + o.LastPurgeTime.Set(&v) +} + +func (o GetCacheInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCacheInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["history"] = o.History + toSerialize["lastPurgeTime"] = o.LastPurgeTime.Get() + return toSerialize, nil +} + +func (o *GetCacheInfoResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "history", + "lastPurgeTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCacheInfoResponse := _GetCacheInfoResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCacheInfoResponse) + + if err != nil { + return err + } + + *o = GetCacheInfoResponse(varGetCacheInfoResponse) + + return err +} + +type NullableGetCacheInfoResponse struct { + value *GetCacheInfoResponse + isSet bool +} + +func (v NullableGetCacheInfoResponse) Get() *GetCacheInfoResponse { + return v.value +} + +func (v *NullableGetCacheInfoResponse) Set(val *GetCacheInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponse(val *GetCacheInfoResponse) *NullableGetCacheInfoResponse { + return &NullableGetCacheInfoResponse{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_cache_info_response_history_entry.go b/services/cdn/v1api/model_get_cache_info_response_history_entry.go new file mode 100644 index 000000000..df84cd3eb --- /dev/null +++ b/services/cdn/v1api/model_get_cache_info_response_history_entry.go @@ -0,0 +1,185 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the GetCacheInfoResponseHistoryEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} + +// GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry +type GetCacheInfoResponseHistoryEntry struct { + OccurredAt time.Time `json:"occurredAt"` + Type string `json:"type"` +} + +type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry + +// NewGetCacheInfoResponseHistoryEntry instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntry(occurredAt time.Time, types string) *GetCacheInfoResponseHistoryEntry { + this := GetCacheInfoResponseHistoryEntry{} + this.OccurredAt = occurredAt + this.Type = types + return &this +} + +// NewGetCacheInfoResponseHistoryEntryWithDefaults instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntryWithDefaults() *GetCacheInfoResponseHistoryEntry { + this := GetCacheInfoResponseHistoryEntry{} + return &this +} + +// GetOccurredAt returns the OccurredAt field value +func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.OccurredAt +} + +// GetOccurredAtOk returns a tuple with the OccurredAt field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.OccurredAt, true +} + +// SetOccurredAt sets field value +func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v time.Time) { + o.OccurredAt = v +} + +// GetType returns the Type field value +func (o *GetCacheInfoResponseHistoryEntry) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCacheInfoResponseHistoryEntry) SetType(v string) { + o.Type = v +} + +func (o GetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCacheInfoResponseHistoryEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["occurredAt"] = o.OccurredAt + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *GetCacheInfoResponseHistoryEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "occurredAt", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCacheInfoResponseHistoryEntry := _GetCacheInfoResponseHistoryEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCacheInfoResponseHistoryEntry) + + if err != nil { + return err + } + + *o = GetCacheInfoResponseHistoryEntry(varGetCacheInfoResponseHistoryEntry) + + return err +} + +type NullableGetCacheInfoResponseHistoryEntry struct { + value *GetCacheInfoResponseHistoryEntry + isSet bool +} + +func (v NullableGetCacheInfoResponseHistoryEntry) Get() *GetCacheInfoResponseHistoryEntry { + return v.value +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) Set(val *GetCacheInfoResponseHistoryEntry) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponseHistoryEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponseHistoryEntry(val *GetCacheInfoResponseHistoryEntry) *NullableGetCacheInfoResponseHistoryEntry { + return &NullableGetCacheInfoResponseHistoryEntry{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_custom_domain_custom_certificate.go b/services/cdn/v1api/model_get_custom_domain_custom_certificate.go new file mode 100644 index 000000000..4f185426b --- /dev/null +++ b/services/cdn/v1api/model_get_custom_domain_custom_certificate.go @@ -0,0 +1,185 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainCustomCertificate{} + +// GetCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. +type GetCustomDomainCustomCertificate struct { + Type string `json:"type"` + // Whenever a new custom certificate is added the version is increased by 1. + Version int32 `json:"version"` +} + +type _GetCustomDomainCustomCertificate GetCustomDomainCustomCertificate + +// NewGetCustomDomainCustomCertificate instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificate(types string, version int32) *GetCustomDomainCustomCertificate { + this := GetCustomDomainCustomCertificate{} + this.Type = types + this.Version = version + return &this +} + +// NewGetCustomDomainCustomCertificateWithDefaults instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificateWithDefaults() *GetCustomDomainCustomCertificate { + this := GetCustomDomainCustomCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *GetCustomDomainCustomCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCustomDomainCustomCertificate) SetType(v string) { + o.Type = v +} + +// GetVersion returns the Version field value +func (o *GetCustomDomainCustomCertificate) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainCustomCertificate) GetVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *GetCustomDomainCustomCertificate) SetVersion(v int32) { + o.Version = v +} + +func (o GetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *GetCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainCustomCertificate := _GetCustomDomainCustomCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainCustomCertificate) + + if err != nil { + return err + } + + *o = GetCustomDomainCustomCertificate(varGetCustomDomainCustomCertificate) + + return err +} + +type NullableGetCustomDomainCustomCertificate struct { + value *GetCustomDomainCustomCertificate + isSet bool +} + +func (v NullableGetCustomDomainCustomCertificate) Get() *GetCustomDomainCustomCertificate { + return v.value +} + +func (v *NullableGetCustomDomainCustomCertificate) Set(val *GetCustomDomainCustomCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainCustomCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainCustomCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainCustomCertificate(val *GetCustomDomainCustomCertificate) *NullableGetCustomDomainCustomCertificate { + return &NullableGetCustomDomainCustomCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_custom_domain_managed_certificate.go b/services/cdn/v1api/model_get_custom_domain_managed_certificate.go new file mode 100644 index 000000000..377138997 --- /dev/null +++ b/services/cdn/v1api/model_get_custom_domain_managed_certificate.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainManagedCertificate{} + +// GetCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you +type GetCustomDomainManagedCertificate struct { + Type string `json:"type"` +} + +type _GetCustomDomainManagedCertificate GetCustomDomainManagedCertificate + +// NewGetCustomDomainManagedCertificate instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificate(types string) *GetCustomDomainManagedCertificate { + this := GetCustomDomainManagedCertificate{} + this.Type = types + return &this +} + +// NewGetCustomDomainManagedCertificateWithDefaults instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificateWithDefaults() *GetCustomDomainManagedCertificate { + this := GetCustomDomainManagedCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *GetCustomDomainManagedCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCustomDomainManagedCertificate) SetType(v string) { + o.Type = v +} + +func (o GetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *GetCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainManagedCertificate := _GetCustomDomainManagedCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainManagedCertificate) + + if err != nil { + return err + } + + *o = GetCustomDomainManagedCertificate(varGetCustomDomainManagedCertificate) + + return err +} + +type NullableGetCustomDomainManagedCertificate struct { + value *GetCustomDomainManagedCertificate + isSet bool +} + +func (v NullableGetCustomDomainManagedCertificate) Get() *GetCustomDomainManagedCertificate { + return v.value +} + +func (v *NullableGetCustomDomainManagedCertificate) Set(val *GetCustomDomainManagedCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainManagedCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainManagedCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainManagedCertificate(val *GetCustomDomainManagedCertificate) *NullableGetCustomDomainManagedCertificate { + return &NullableGetCustomDomainManagedCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_custom_domain_response.go b/services/cdn/v1api/model_get_custom_domain_response.go new file mode 100644 index 000000000..19a394ca2 --- /dev/null +++ b/services/cdn/v1api/model_get_custom_domain_response.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainResponse{} + +// GetCustomDomainResponse struct for GetCustomDomainResponse +type GetCustomDomainResponse struct { + Certificate GetCustomDomainResponseCertificate `json:"certificate"` + CustomDomain CustomDomain `json:"customDomain"` +} + +type _GetCustomDomainResponse GetCustomDomainResponse + +// NewGetCustomDomainResponse instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponse(certificate GetCustomDomainResponseCertificate, customDomain CustomDomain) *GetCustomDomainResponse { + this := GetCustomDomainResponse{} + this.Certificate = certificate + this.CustomDomain = customDomain + return &this +} + +// NewGetCustomDomainResponseWithDefaults instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponseWithDefaults() *GetCustomDomainResponse { + this := GetCustomDomainResponse{} + return &this +} + +// GetCertificate returns the Certificate field value +func (o *GetCustomDomainResponse) GetCertificate() GetCustomDomainResponseCertificate { + if o == nil { + var ret GetCustomDomainResponseCertificate + return ret + } + + return o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainResponse) GetCertificateOk() (*GetCustomDomainResponseCertificate, bool) { + if o == nil { + return nil, false + } + return &o.Certificate, true +} + +// SetCertificate sets field value +func (o *GetCustomDomainResponse) SetCertificate(v GetCustomDomainResponseCertificate) { + o.Certificate = v +} + +// GetCustomDomain returns the CustomDomain field value +func (o *GetCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil { + var ret CustomDomain + return ret + } + + return o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil { + return nil, false + } + return &o.CustomDomain, true +} + +// SetCustomDomain sets field value +func (o *GetCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = v +} + +func (o GetCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["certificate"] = o.Certificate + toSerialize["customDomain"] = o.CustomDomain + return toSerialize, nil +} + +func (o *GetCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "certificate", + "customDomain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainResponse := _GetCustomDomainResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainResponse) + + if err != nil { + return err + } + + *o = GetCustomDomainResponse(varGetCustomDomainResponse) + + return err +} + +type NullableGetCustomDomainResponse struct { + value *GetCustomDomainResponse + isSet bool +} + +func (v NullableGetCustomDomainResponse) Get() *GetCustomDomainResponse { + return v.value +} + +func (v *NullableGetCustomDomainResponse) Set(val *GetCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainResponse(val *GetCustomDomainResponse) *NullableGetCustomDomainResponse { + return &NullableGetCustomDomainResponse{value: val, isSet: true} +} + +func (v NullableGetCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_custom_domain_response_certificate.go b/services/cdn/v1api/model_get_custom_domain_response_certificate.go new file mode 100644 index 000000000..b93bb63c6 --- /dev/null +++ b/services/cdn/v1api/model_get_custom_domain_response_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// GetCustomDomainResponseCertificate - struct for GetCustomDomainResponseCertificate +type GetCustomDomainResponseCertificate struct { + GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate + GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate +} + +// GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in GetCustomDomainResponseCertificate +func GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) GetCustomDomainResponseCertificate { + return GetCustomDomainResponseCertificate{ + GetCustomDomainCustomCertificate: v, + } +} + +// GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in GetCustomDomainResponseCertificate +func GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) GetCustomDomainResponseCertificate { + return GetCustomDomainResponseCertificate{ + GetCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GetCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into GetCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match + } else { + dst.GetCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into GetCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match + } else { + dst.GetCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + if src.GetCustomDomainCustomCertificate != nil { + return json.Marshal(&src.GetCustomDomainCustomCertificate) + } + + if src.GetCustomDomainManagedCertificate != nil { + return json.Marshal(&src.GetCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GetCustomDomainResponseCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.GetCustomDomainCustomCertificate != nil { + return obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj GetCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { + if obj.GetCustomDomainCustomCertificate != nil { + return *obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return *obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullableGetCustomDomainResponseCertificate struct { + value *GetCustomDomainResponseCertificate + isSet bool +} + +func (v NullableGetCustomDomainResponseCertificate) Get() *GetCustomDomainResponseCertificate { + return v.value +} + +func (v *NullableGetCustomDomainResponseCertificate) Set(val *GetCustomDomainResponseCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainResponseCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainResponseCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainResponseCertificate(val *GetCustomDomainResponseCertificate) *NullableGetCustomDomainResponseCertificate { + return &NullableGetCustomDomainResponseCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_distribution_response.go b/services/cdn/v1api/model_get_distribution_response.go new file mode 100644 index 000000000..d29db5ce9 --- /dev/null +++ b/services/cdn/v1api/model_get_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDistributionResponse{} + +// GetDistributionResponse struct for GetDistributionResponse +type GetDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _GetDistributionResponse GetDistributionResponse + +// NewGetDistributionResponse instantiates a new GetDistributionResponse 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 NewGetDistributionResponse(distribution Distribution) *GetDistributionResponse { + this := GetDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewGetDistributionResponseWithDefaults instantiates a new GetDistributionResponse 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 NewGetDistributionResponseWithDefaults() *GetDistributionResponse { + this := GetDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *GetDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *GetDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *GetDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o GetDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *GetDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetDistributionResponse := _GetDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetDistributionResponse) + + if err != nil { + return err + } + + *o = GetDistributionResponse(varGetDistributionResponse) + + return err +} + +type NullableGetDistributionResponse struct { + value *GetDistributionResponse + isSet bool +} + +func (v NullableGetDistributionResponse) Get() *GetDistributionResponse { + return v.value +} + +func (v *NullableGetDistributionResponse) Set(val *GetDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetDistributionResponse(val *GetDistributionResponse) *NullableGetDistributionResponse { + return &NullableGetDistributionResponse{value: val, isSet: true} +} + +func (v NullableGetDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_logs_response.go b/services/cdn/v1api/model_get_logs_response.go new file mode 100644 index 000000000..36869b909 --- /dev/null +++ b/services/cdn/v1api/model_get_logs_response.go @@ -0,0 +1,192 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsResponse{} + +// GetLogsResponse struct for GetLogsResponse +type GetLogsResponse struct { + Logs []DistributionLogsRecord `json:"logs"` + NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` +} + +type _GetLogsResponse GetLogsResponse + +// NewGetLogsResponse instantiates a new GetLogsResponse 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 NewGetLogsResponse(logs []DistributionLogsRecord) *GetLogsResponse { + this := GetLogsResponse{} + this.Logs = logs + return &this +} + +// NewGetLogsResponseWithDefaults instantiates a new GetLogsResponse 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 NewGetLogsResponseWithDefaults() *GetLogsResponse { + this := GetLogsResponse{} + return &this +} + +// GetLogs returns the Logs field value +func (o *GetLogsResponse) GetLogs() []DistributionLogsRecord { + if o == nil { + var ret []DistributionLogsRecord + return ret + } + + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *GetLogsResponse) GetLogsOk() ([]DistributionLogsRecord, bool) { + if o == nil { + return nil, false + } + return o.Logs, true +} + +// SetLogs sets field value +func (o *GetLogsResponse) SetLogs(v []DistributionLogsRecord) { + o.Logs = v +} + +// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +func (o *GetLogsResponse) GetNextPageIdentifier() string { + if o == nil || IsNil(o.NextPageIdentifier) { + var ret string + return ret + } + return *o.NextPageIdentifier +} + +// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLogsResponse) GetNextPageIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.NextPageIdentifier) { + return nil, false + } + return o.NextPageIdentifier, true +} + +// HasNextPageIdentifier returns a boolean if a field has been set. +func (o *GetLogsResponse) HasNextPageIdentifier() bool { + if o != nil && !IsNil(o.NextPageIdentifier) { + return true + } + + return false +} + +// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. +func (o *GetLogsResponse) SetNextPageIdentifier(v string) { + o.NextPageIdentifier = &v +} + +func (o GetLogsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["logs"] = o.Logs + if !IsNil(o.NextPageIdentifier) { + toSerialize["nextPageIdentifier"] = o.NextPageIdentifier + } + return toSerialize, nil +} + +func (o *GetLogsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "logs", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsResponse := _GetLogsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsResponse) + + if err != nil { + return err + } + + *o = GetLogsResponse(varGetLogsResponse) + + return err +} + +type NullableGetLogsResponse struct { + value *GetLogsResponse + isSet bool +} + +func (v NullableGetLogsResponse) Get() *GetLogsResponse { + return v.value +} + +func (v *NullableGetLogsResponse) Set(val *GetLogsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsResponse(val *GetLogsResponse) *NullableGetLogsResponse { + return &NullableGetLogsResponse{value: val, isSet: true} +} + +func (v NullableGetLogsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_logs_search_filters_response.go b/services/cdn/v1api/model_get_logs_search_filters_response.go new file mode 100644 index 000000000..2571cb8ef --- /dev/null +++ b/services/cdn/v1api/model_get_logs_search_filters_response.go @@ -0,0 +1,242 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsSearchFiltersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsSearchFiltersResponse{} + +// GetLogsSearchFiltersResponse struct for GetLogsSearchFiltersResponse +type GetLogsSearchFiltersResponse struct { + Cache []string `json:"cache"` + DataCenter GetLogsSearchFiltersResponseDatacenterBlock `json:"dataCenter"` + // List of ISO-3166 Alpha2 Country Codes matching the input filter. Response is ordered in ascending order. For more Info about the country codes, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + RemoteCountry []string `json:"remoteCountry"` + // List of Status Codes matching the input filter. Response is ordered in ascending order. + Status []int32 `json:"status"` +} + +type _GetLogsSearchFiltersResponse GetLogsSearchFiltersResponse + +// NewGetLogsSearchFiltersResponse instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponse(cache []string, dataCenter GetLogsSearchFiltersResponseDatacenterBlock, remoteCountry []string, status []int32) *GetLogsSearchFiltersResponse { + this := GetLogsSearchFiltersResponse{} + this.Cache = cache + this.DataCenter = dataCenter + this.RemoteCountry = remoteCountry + this.Status = status + return &this +} + +// NewGetLogsSearchFiltersResponseWithDefaults instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponseWithDefaults() *GetLogsSearchFiltersResponse { + this := GetLogsSearchFiltersResponse{} + return &this +} + +// GetCache returns the Cache field value +func (o *GetLogsSearchFiltersResponse) GetCache() []string { + if o == nil { + var ret []string + return ret + } + + return o.Cache +} + +// GetCacheOk returns a tuple with the Cache field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Cache, true +} + +// SetCache sets field value +func (o *GetLogsSearchFiltersResponse) SetCache(v []string) { + o.Cache = v +} + +// GetDataCenter returns the DataCenter field value +func (o *GetLogsSearchFiltersResponse) GetDataCenter() GetLogsSearchFiltersResponseDatacenterBlock { + if o == nil { + var ret GetLogsSearchFiltersResponseDatacenterBlock + return ret + } + + return o.DataCenter +} + +// GetDataCenterOk returns a tuple with the DataCenter field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetDataCenterOk() (*GetLogsSearchFiltersResponseDatacenterBlock, bool) { + if o == nil { + return nil, false + } + return &o.DataCenter, true +} + +// SetDataCenter sets field value +func (o *GetLogsSearchFiltersResponse) SetDataCenter(v GetLogsSearchFiltersResponseDatacenterBlock) { + o.DataCenter = v +} + +// GetRemoteCountry returns the RemoteCountry field value +func (o *GetLogsSearchFiltersResponse) GetRemoteCountry() []string { + if o == nil { + var ret []string + return ret + } + + return o.RemoteCountry +} + +// GetRemoteCountryOk returns a tuple with the RemoteCountry field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetRemoteCountryOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.RemoteCountry, true +} + +// SetRemoteCountry sets field value +func (o *GetLogsSearchFiltersResponse) SetRemoteCountry(v []string) { + o.RemoteCountry = v +} + +// GetStatus returns the Status field value +func (o *GetLogsSearchFiltersResponse) GetStatus() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetStatusOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Status, true +} + +// SetStatus sets field value +func (o *GetLogsSearchFiltersResponse) SetStatus(v []int32) { + o.Status = v +} + +func (o GetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsSearchFiltersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cache"] = o.Cache + toSerialize["dataCenter"] = o.DataCenter + toSerialize["remoteCountry"] = o.RemoteCountry + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *GetLogsSearchFiltersResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cache", + "dataCenter", + "remoteCountry", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsSearchFiltersResponse := _GetLogsSearchFiltersResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsSearchFiltersResponse) + + if err != nil { + return err + } + + *o = GetLogsSearchFiltersResponse(varGetLogsSearchFiltersResponse) + + return err +} + +type NullableGetLogsSearchFiltersResponse struct { + value *GetLogsSearchFiltersResponse + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponse) Get() *GetLogsSearchFiltersResponse { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponse) Set(val *GetLogsSearchFiltersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponse(val *GetLogsSearchFiltersResponse) *NullableGetLogsSearchFiltersResponse { + return &NullableGetLogsSearchFiltersResponse{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_logs_search_filters_response_datacenter_block.go b/services/cdn/v1api/model_get_logs_search_filters_response_datacenter_block.go new file mode 100644 index 000000000..8f2a5b4ba --- /dev/null +++ b/services/cdn/v1api/model_get_logs_search_filters_response_datacenter_block.go @@ -0,0 +1,268 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsSearchFiltersResponseDatacenterBlock type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsSearchFiltersResponseDatacenterBlock{} + +// GetLogsSearchFiltersResponseDatacenterBlock Object containing Datacenters to filter for. Each datacenter is grouped to the respective region. +type GetLogsSearchFiltersResponseDatacenterBlock struct { + AF []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"AF"` + ASIA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"ASIA"` + EU []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"EU"` + NA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"NA"` + SA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"SA"` +} + +type _GetLogsSearchFiltersResponseDatacenterBlock GetLogsSearchFiltersResponseDatacenterBlock + +// NewGetLogsSearchFiltersResponseDatacenterBlock instantiates a new GetLogsSearchFiltersResponseDatacenterBlock 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 NewGetLogsSearchFiltersResponseDatacenterBlock(aF []GetLogsSearchFiltersResponseDatacenterBlockItem, aSIA []GetLogsSearchFiltersResponseDatacenterBlockItem, eU []GetLogsSearchFiltersResponseDatacenterBlockItem, nA []GetLogsSearchFiltersResponseDatacenterBlockItem, sA []GetLogsSearchFiltersResponseDatacenterBlockItem) *GetLogsSearchFiltersResponseDatacenterBlock { + this := GetLogsSearchFiltersResponseDatacenterBlock{} + this.AF = aF + this.ASIA = aSIA + this.EU = eU + this.NA = nA + this.SA = sA + return &this +} + +// NewGetLogsSearchFiltersResponseDatacenterBlockWithDefaults instantiates a new GetLogsSearchFiltersResponseDatacenterBlock 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 NewGetLogsSearchFiltersResponseDatacenterBlockWithDefaults() *GetLogsSearchFiltersResponseDatacenterBlock { + this := GetLogsSearchFiltersResponseDatacenterBlock{} + return &this +} + +// GetAF returns the AF field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAF() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.AF +} + +// GetAFOk returns a tuple with the AF field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAFOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.AF, true +} + +// SetAF sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetAF(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.AF = v +} + +// GetASIA returns the ASIA field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIA() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.ASIA +} + +// GetASIAOk returns a tuple with the ASIA field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.ASIA, true +} + +// SetASIA sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetASIA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.ASIA = v +} + +// GetEU returns the EU field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEU() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.EU +} + +// GetEUOk returns a tuple with the EU field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEUOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.EU, true +} + +// SetEU sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetEU(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.EU = v +} + +// GetNA returns the NA field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNA() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.NA +} + +// GetNAOk returns a tuple with the NA field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.NA, true +} + +// SetNA sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetNA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.NA = v +} + +// GetSA returns the SA field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSA() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.SA +} + +// GetSAOk returns a tuple with the SA field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.SA, true +} + +// SetSA sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetSA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.SA = v +} + +func (o GetLogsSearchFiltersResponseDatacenterBlock) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsSearchFiltersResponseDatacenterBlock) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["AF"] = o.AF + toSerialize["ASIA"] = o.ASIA + toSerialize["EU"] = o.EU + toSerialize["NA"] = o.NA + toSerialize["SA"] = o.SA + return toSerialize, nil +} + +func (o *GetLogsSearchFiltersResponseDatacenterBlock) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "AF", + "ASIA", + "EU", + "NA", + "SA", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsSearchFiltersResponseDatacenterBlock := _GetLogsSearchFiltersResponseDatacenterBlock{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsSearchFiltersResponseDatacenterBlock) + + if err != nil { + return err + } + + *o = GetLogsSearchFiltersResponseDatacenterBlock(varGetLogsSearchFiltersResponseDatacenterBlock) + + return err +} + +type NullableGetLogsSearchFiltersResponseDatacenterBlock struct { + value *GetLogsSearchFiltersResponseDatacenterBlock + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) Get() *GetLogsSearchFiltersResponseDatacenterBlock { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) Set(val *GetLogsSearchFiltersResponseDatacenterBlock) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponseDatacenterBlock(val *GetLogsSearchFiltersResponseDatacenterBlock) *NullableGetLogsSearchFiltersResponseDatacenterBlock { + return &NullableGetLogsSearchFiltersResponseDatacenterBlock{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_logs_search_filters_response_datacenter_block_item.go b/services/cdn/v1api/model_get_logs_search_filters_response_datacenter_block_item.go new file mode 100644 index 000000000..f43d2efdd --- /dev/null +++ b/services/cdn/v1api/model_get_logs_search_filters_response_datacenter_block_item.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsSearchFiltersResponseDatacenterBlockItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsSearchFiltersResponseDatacenterBlockItem{} + +// GetLogsSearchFiltersResponseDatacenterBlockItem A datacenter. The `id` defines the key needed to filter against the logs endpoint, while the `displayName` defines a human-readable Name. +type GetLogsSearchFiltersResponseDatacenterBlockItem struct { + DisplayName string `json:"displayName"` + Id string `json:"id"` +} + +type _GetLogsSearchFiltersResponseDatacenterBlockItem GetLogsSearchFiltersResponseDatacenterBlockItem + +// NewGetLogsSearchFiltersResponseDatacenterBlockItem instantiates a new GetLogsSearchFiltersResponseDatacenterBlockItem 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 NewGetLogsSearchFiltersResponseDatacenterBlockItem(displayName string, id string) *GetLogsSearchFiltersResponseDatacenterBlockItem { + this := GetLogsSearchFiltersResponseDatacenterBlockItem{} + this.DisplayName = displayName + this.Id = id + return &this +} + +// NewGetLogsSearchFiltersResponseDatacenterBlockItemWithDefaults instantiates a new GetLogsSearchFiltersResponseDatacenterBlockItem 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 NewGetLogsSearchFiltersResponseDatacenterBlockItemWithDefaults() *GetLogsSearchFiltersResponseDatacenterBlockItem { + this := GetLogsSearchFiltersResponseDatacenterBlockItem{} + return &this +} + +// GetDisplayName returns the DisplayName field value +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetId returns the Id field value +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) SetId(v string) { + o.Id = v +} + +func (o GetLogsSearchFiltersResponseDatacenterBlockItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsSearchFiltersResponseDatacenterBlockItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["displayName"] = o.DisplayName + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "displayName", + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsSearchFiltersResponseDatacenterBlockItem := _GetLogsSearchFiltersResponseDatacenterBlockItem{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsSearchFiltersResponseDatacenterBlockItem) + + if err != nil { + return err + } + + *o = GetLogsSearchFiltersResponseDatacenterBlockItem(varGetLogsSearchFiltersResponseDatacenterBlockItem) + + return err +} + +type NullableGetLogsSearchFiltersResponseDatacenterBlockItem struct { + value *GetLogsSearchFiltersResponseDatacenterBlockItem + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Get() *GetLogsSearchFiltersResponseDatacenterBlockItem { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Set(val *GetLogsSearchFiltersResponseDatacenterBlockItem) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponseDatacenterBlockItem(val *GetLogsSearchFiltersResponseDatacenterBlockItem) *NullableGetLogsSearchFiltersResponseDatacenterBlockItem { + return &NullableGetLogsSearchFiltersResponseDatacenterBlockItem{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_get_statistics_response.go b/services/cdn/v1api/model_get_statistics_response.go new file mode 100644 index 000000000..f7fd3df32 --- /dev/null +++ b/services/cdn/v1api/model_get_statistics_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetStatisticsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStatisticsResponse{} + +// GetStatisticsResponse struct for GetStatisticsResponse +type GetStatisticsResponse struct { + Records []DistributionStatisticsRecord `json:"records"` +} + +type _GetStatisticsResponse GetStatisticsResponse + +// NewGetStatisticsResponse instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponse(records []DistributionStatisticsRecord) *GetStatisticsResponse { + this := GetStatisticsResponse{} + this.Records = records + return &this +} + +// NewGetStatisticsResponseWithDefaults instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponseWithDefaults() *GetStatisticsResponse { + this := GetStatisticsResponse{} + return &this +} + +// GetRecords returns the Records field value +func (o *GetStatisticsResponse) GetRecords() []DistributionStatisticsRecord { + if o == nil { + var ret []DistributionStatisticsRecord + return ret + } + + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value +// and a boolean to check if the value has been set. +func (o *GetStatisticsResponse) GetRecordsOk() ([]DistributionStatisticsRecord, bool) { + if o == nil { + return nil, false + } + return o.Records, true +} + +// SetRecords sets field value +func (o *GetStatisticsResponse) SetRecords(v []DistributionStatisticsRecord) { + o.Records = v +} + +func (o GetStatisticsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStatisticsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["records"] = o.Records + return toSerialize, nil +} + +func (o *GetStatisticsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "records", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetStatisticsResponse := _GetStatisticsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetStatisticsResponse) + + if err != nil { + return err + } + + *o = GetStatisticsResponse(varGetStatisticsResponse) + + return err +} + +type NullableGetStatisticsResponse struct { + value *GetStatisticsResponse + isSet bool +} + +func (v NullableGetStatisticsResponse) Get() *GetStatisticsResponse { + return v.value +} + +func (v *NullableGetStatisticsResponse) Set(val *GetStatisticsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatisticsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatisticsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatisticsResponse(val *GetStatisticsResponse) *NullableGetStatisticsResponse { + return &NullableGetStatisticsResponse{value: val, isSet: true} +} + +func (v NullableGetStatisticsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatisticsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_http_backend.go b/services/cdn/v1api/model_http_backend.go new file mode 100644 index 000000000..c9fc8b9e7 --- /dev/null +++ b/services/cdn/v1api/model_http_backend.go @@ -0,0 +1,243 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the HttpBackend type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpBackend{} + +// HttpBackend struct for HttpBackend +type HttpBackend struct { + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. + Geofencing map[string][]string `json:"geofencing"` + // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. + OriginRequestHeaders map[string]string `json:"originRequestHeaders"` + // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` + OriginUrl string `json:"originUrl"` + Type string `json:"type"` +} + +type _HttpBackend HttpBackend + +// NewHttpBackend instantiates a new HttpBackend 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 NewHttpBackend(geofencing map[string][]string, originRequestHeaders map[string]string, originUrl string, types string) *HttpBackend { + this := HttpBackend{} + this.Geofencing = geofencing + this.OriginRequestHeaders = originRequestHeaders + this.OriginUrl = originUrl + this.Type = types + return &this +} + +// NewHttpBackendWithDefaults instantiates a new HttpBackend 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 NewHttpBackendWithDefaults() *HttpBackend { + this := HttpBackend{} + return &this +} + +// GetGeofencing returns the Geofencing field value +func (o *HttpBackend) GetGeofencing() map[string][]string { + if o == nil { + var ret map[string][]string + return ret + } + + return o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil { + return nil, false + } + return &o.Geofencing, true +} + +// SetGeofencing sets field value +func (o *HttpBackend) SetGeofencing(v map[string][]string) { + o.Geofencing = v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value +func (o *HttpBackend) GetOriginRequestHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.OriginRequestHeaders, true +} + +// SetOriginRequestHeaders sets field value +func (o *HttpBackend) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = v +} + +// GetOriginUrl returns the OriginUrl field value +func (o *HttpBackend) GetOriginUrl() string { + if o == nil { + var ret string + return ret + } + + return o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetOriginUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginUrl, true +} + +// SetOriginUrl sets field value +func (o *HttpBackend) SetOriginUrl(v string) { + o.OriginUrl = v +} + +// GetType returns the Type field value +func (o *HttpBackend) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HttpBackend) SetType(v string) { + o.Type = v +} + +func (o HttpBackend) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpBackend) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["geofencing"] = o.Geofencing + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + toSerialize["originUrl"] = o.OriginUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *HttpBackend) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "geofencing", + "originRequestHeaders", + "originUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHttpBackend := _HttpBackend{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpBackend) + + if err != nil { + return err + } + + *o = HttpBackend(varHttpBackend) + + return err +} + +type NullableHttpBackend struct { + value *HttpBackend + isSet bool +} + +func (v NullableHttpBackend) Get() *HttpBackend { + return v.value +} + +func (v *NullableHttpBackend) Set(val *HttpBackend) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackend(val *HttpBackend) *NullableHttpBackend { + return &NullableHttpBackend{value: val, isSet: true} +} + +func (v NullableHttpBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_http_backend_create.go b/services/cdn/v1api/model_http_backend_create.go new file mode 100644 index 000000000..1125a83e9 --- /dev/null +++ b/services/cdn/v1api/model_http_backend_create.go @@ -0,0 +1,259 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the HttpBackendCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpBackendCreate{} + +// HttpBackendCreate struct for HttpBackendCreate +type HttpBackendCreate struct { + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. + Geofencing *map[string][]string `json:"geofencing,omitempty"` + // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. + OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` + // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` + OriginUrl string `json:"originUrl"` + Type string `json:"type"` +} + +type _HttpBackendCreate HttpBackendCreate + +// NewHttpBackendCreate instantiates a new HttpBackendCreate 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 NewHttpBackendCreate(originUrl string, types string) *HttpBackendCreate { + this := HttpBackendCreate{} + this.OriginUrl = originUrl + this.Type = types + return &this +} + +// NewHttpBackendCreateWithDefaults instantiates a new HttpBackendCreate 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 NewHttpBackendCreateWithDefaults() *HttpBackendCreate { + this := HttpBackendCreate{} + return &this +} + +// GetGeofencing returns the Geofencing field value if set, zero value otherwise. +func (o *HttpBackendCreate) GetGeofencing() map[string][]string { + if o == nil || IsNil(o.Geofencing) { + var ret map[string][]string + return ret + } + return *o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendCreate) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil || IsNil(o.Geofencing) { + return nil, false + } + return o.Geofencing, true +} + +// HasGeofencing returns a boolean if a field has been set. +func (o *HttpBackendCreate) HasGeofencing() bool { + if o != nil && !IsNil(o.Geofencing) { + return true + } + + return false +} + +// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. +func (o *HttpBackendCreate) SetGeofencing(v map[string][]string) { + o.Geofencing = &v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. +func (o *HttpBackendCreate) GetOriginRequestHeaders() map[string]string { + if o == nil || IsNil(o.OriginRequestHeaders) { + var ret map[string]string + return ret + } + return *o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendCreate) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil || IsNil(o.OriginRequestHeaders) { + return nil, false + } + return o.OriginRequestHeaders, true +} + +// HasOriginRequestHeaders returns a boolean if a field has been set. +func (o *HttpBackendCreate) HasOriginRequestHeaders() bool { + if o != nil && !IsNil(o.OriginRequestHeaders) { + return true + } + + return false +} + +// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. +func (o *HttpBackendCreate) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = &v +} + +// GetOriginUrl returns the OriginUrl field value +func (o *HttpBackendCreate) GetOriginUrl() string { + if o == nil { + var ret string + return ret + } + + return o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value +// and a boolean to check if the value has been set. +func (o *HttpBackendCreate) GetOriginUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginUrl, true +} + +// SetOriginUrl sets field value +func (o *HttpBackendCreate) SetOriginUrl(v string) { + o.OriginUrl = v +} + +// GetType returns the Type field value +func (o *HttpBackendCreate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *HttpBackendCreate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HttpBackendCreate) SetType(v string) { + o.Type = v +} + +func (o HttpBackendCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpBackendCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Geofencing) { + toSerialize["geofencing"] = o.Geofencing + } + if !IsNil(o.OriginRequestHeaders) { + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + } + toSerialize["originUrl"] = o.OriginUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *HttpBackendCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "originUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHttpBackendCreate := _HttpBackendCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpBackendCreate) + + if err != nil { + return err + } + + *o = HttpBackendCreate(varHttpBackendCreate) + + return err +} + +type NullableHttpBackendCreate struct { + value *HttpBackendCreate + isSet bool +} + +func (v NullableHttpBackendCreate) Get() *HttpBackendCreate { + return v.value +} + +func (v *NullableHttpBackendCreate) Set(val *HttpBackendCreate) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackendCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackendCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackendCreate(val *HttpBackendCreate) *NullableHttpBackendCreate { + return &NullableHttpBackendCreate{value: val, isSet: true} +} + +func (v NullableHttpBackendCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackendCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_http_backend_patch.go b/services/cdn/v1api/model_http_backend_patch.go new file mode 100644 index 000000000..574062bab --- /dev/null +++ b/services/cdn/v1api/model_http_backend_patch.go @@ -0,0 +1,267 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the HttpBackendPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpBackendPatch{} + +// HttpBackendPatch A partial HTTP Backend +type HttpBackendPatch struct { + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. + Geofencing *map[string][]string `json:"geofencing,omitempty"` + // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. + OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` + OriginUrl *string `json:"originUrl,omitempty"` + // This property is required to determine the used backend type. + Type string `json:"type"` +} + +type _HttpBackendPatch HttpBackendPatch + +// NewHttpBackendPatch instantiates a new HttpBackendPatch 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 NewHttpBackendPatch(types string) *HttpBackendPatch { + this := HttpBackendPatch{} + this.Type = types + return &this +} + +// NewHttpBackendPatchWithDefaults instantiates a new HttpBackendPatch 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 NewHttpBackendPatchWithDefaults() *HttpBackendPatch { + this := HttpBackendPatch{} + return &this +} + +// GetGeofencing returns the Geofencing field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetGeofencing() map[string][]string { + if o == nil || IsNil(o.Geofencing) { + var ret map[string][]string + return ret + } + return *o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil || IsNil(o.Geofencing) { + return nil, false + } + return o.Geofencing, true +} + +// HasGeofencing returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasGeofencing() bool { + if o != nil && !IsNil(o.Geofencing) { + return true + } + + return false +} + +// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. +func (o *HttpBackendPatch) SetGeofencing(v map[string][]string) { + o.Geofencing = &v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetOriginRequestHeaders() map[string]string { + if o == nil || IsNil(o.OriginRequestHeaders) { + var ret map[string]string + return ret + } + return *o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil || IsNil(o.OriginRequestHeaders) { + return nil, false + } + return o.OriginRequestHeaders, true +} + +// HasOriginRequestHeaders returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasOriginRequestHeaders() bool { + if o != nil && !IsNil(o.OriginRequestHeaders) { + return true + } + + return false +} + +// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. +func (o *HttpBackendPatch) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = &v +} + +// GetOriginUrl returns the OriginUrl field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetOriginUrl() string { + if o == nil || IsNil(o.OriginUrl) { + var ret string + return ret + } + return *o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetOriginUrlOk() (*string, bool) { + if o == nil || IsNil(o.OriginUrl) { + return nil, false + } + return o.OriginUrl, true +} + +// HasOriginUrl returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasOriginUrl() bool { + if o != nil && !IsNil(o.OriginUrl) { + return true + } + + return false +} + +// SetOriginUrl gets a reference to the given string and assigns it to the OriginUrl field. +func (o *HttpBackendPatch) SetOriginUrl(v string) { + o.OriginUrl = &v +} + +// GetType returns the Type field value +func (o *HttpBackendPatch) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HttpBackendPatch) SetType(v string) { + o.Type = v +} + +func (o HttpBackendPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Geofencing) { + toSerialize["geofencing"] = o.Geofencing + } + if !IsNil(o.OriginRequestHeaders) { + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + } + if !IsNil(o.OriginUrl) { + toSerialize["originUrl"] = o.OriginUrl + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *HttpBackendPatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHttpBackendPatch := _HttpBackendPatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpBackendPatch) + + if err != nil { + return err + } + + *o = HttpBackendPatch(varHttpBackendPatch) + + return err +} + +type NullableHttpBackendPatch struct { + value *HttpBackendPatch + isSet bool +} + +func (v NullableHttpBackendPatch) Get() *HttpBackendPatch { + return v.value +} + +func (v *NullableHttpBackendPatch) Set(val *HttpBackendPatch) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackendPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackendPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackendPatch(val *HttpBackendPatch) *NullableHttpBackendPatch { + return &NullableHttpBackendPatch{value: val, isSet: true} +} + +func (v NullableHttpBackendPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackendPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_list_distributions_response.go b/services/cdn/v1api/model_list_distributions_response.go new file mode 100644 index 000000000..8d7df6078 --- /dev/null +++ b/services/cdn/v1api/model_list_distributions_response.go @@ -0,0 +1,192 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListDistributionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDistributionsResponse{} + +// ListDistributionsResponse struct for ListDistributionsResponse +type ListDistributionsResponse struct { + Distributions []Distribution `json:"distributions"` + NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` +} + +type _ListDistributionsResponse ListDistributionsResponse + +// NewListDistributionsResponse instantiates a new ListDistributionsResponse 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 NewListDistributionsResponse(distributions []Distribution) *ListDistributionsResponse { + this := ListDistributionsResponse{} + this.Distributions = distributions + return &this +} + +// NewListDistributionsResponseWithDefaults instantiates a new ListDistributionsResponse 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 NewListDistributionsResponseWithDefaults() *ListDistributionsResponse { + this := ListDistributionsResponse{} + return &this +} + +// GetDistributions returns the Distributions field value +func (o *ListDistributionsResponse) GetDistributions() []Distribution { + if o == nil { + var ret []Distribution + return ret + } + + return o.Distributions +} + +// GetDistributionsOk returns a tuple with the Distributions field value +// and a boolean to check if the value has been set. +func (o *ListDistributionsResponse) GetDistributionsOk() ([]Distribution, bool) { + if o == nil { + return nil, false + } + return o.Distributions, true +} + +// SetDistributions sets field value +func (o *ListDistributionsResponse) SetDistributions(v []Distribution) { + o.Distributions = v +} + +// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +func (o *ListDistributionsResponse) GetNextPageIdentifier() string { + if o == nil || IsNil(o.NextPageIdentifier) { + var ret string + return ret + } + return *o.NextPageIdentifier +} + +// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListDistributionsResponse) GetNextPageIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.NextPageIdentifier) { + return nil, false + } + return o.NextPageIdentifier, true +} + +// HasNextPageIdentifier returns a boolean if a field has been set. +func (o *ListDistributionsResponse) HasNextPageIdentifier() bool { + if o != nil && !IsNil(o.NextPageIdentifier) { + return true + } + + return false +} + +// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. +func (o *ListDistributionsResponse) SetNextPageIdentifier(v string) { + o.NextPageIdentifier = &v +} + +func (o ListDistributionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListDistributionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distributions"] = o.Distributions + if !IsNil(o.NextPageIdentifier) { + toSerialize["nextPageIdentifier"] = o.NextPageIdentifier + } + return toSerialize, nil +} + +func (o *ListDistributionsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distributions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListDistributionsResponse := _ListDistributionsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListDistributionsResponse) + + if err != nil { + return err + } + + *o = ListDistributionsResponse(varListDistributionsResponse) + + return err +} + +type NullableListDistributionsResponse struct { + value *ListDistributionsResponse + isSet bool +} + +func (v NullableListDistributionsResponse) Get() *ListDistributionsResponse { + return v.value +} + +func (v *NullableListDistributionsResponse) Set(val *ListDistributionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsResponse(val *ListDistributionsResponse) *NullableListDistributionsResponse { + return &NullableListDistributionsResponse{value: val, isSet: true} +} + +func (v NullableListDistributionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_list_waf_collections_response.go b/services/cdn/v1api/model_list_waf_collections_response.go new file mode 100644 index 000000000..926dda7c7 --- /dev/null +++ b/services/cdn/v1api/model_list_waf_collections_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListWafCollectionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListWafCollectionsResponse{} + +// ListWafCollectionsResponse struct for ListWafCollectionsResponse +type ListWafCollectionsResponse struct { + Collections []WafRuleCollection `json:"collections"` +} + +type _ListWafCollectionsResponse ListWafCollectionsResponse + +// NewListWafCollectionsResponse instantiates a new ListWafCollectionsResponse 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 NewListWafCollectionsResponse(collections []WafRuleCollection) *ListWafCollectionsResponse { + this := ListWafCollectionsResponse{} + this.Collections = collections + return &this +} + +// NewListWafCollectionsResponseWithDefaults instantiates a new ListWafCollectionsResponse 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 NewListWafCollectionsResponseWithDefaults() *ListWafCollectionsResponse { + this := ListWafCollectionsResponse{} + return &this +} + +// GetCollections returns the Collections field value +func (o *ListWafCollectionsResponse) GetCollections() []WafRuleCollection { + if o == nil { + var ret []WafRuleCollection + return ret + } + + return o.Collections +} + +// GetCollectionsOk returns a tuple with the Collections field value +// and a boolean to check if the value has been set. +func (o *ListWafCollectionsResponse) GetCollectionsOk() ([]WafRuleCollection, bool) { + if o == nil { + return nil, false + } + return o.Collections, true +} + +// SetCollections sets field value +func (o *ListWafCollectionsResponse) SetCollections(v []WafRuleCollection) { + o.Collections = v +} + +func (o ListWafCollectionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListWafCollectionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["collections"] = o.Collections + return toSerialize, nil +} + +func (o *ListWafCollectionsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "collections", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListWafCollectionsResponse := _ListWafCollectionsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListWafCollectionsResponse) + + if err != nil { + return err + } + + *o = ListWafCollectionsResponse(varListWafCollectionsResponse) + + return err +} + +type NullableListWafCollectionsResponse struct { + value *ListWafCollectionsResponse + isSet bool +} + +func (v NullableListWafCollectionsResponse) Get() *ListWafCollectionsResponse { + return v.value +} + +func (v *NullableListWafCollectionsResponse) Set(val *ListWafCollectionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListWafCollectionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListWafCollectionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListWafCollectionsResponse(val *ListWafCollectionsResponse) *NullableListWafCollectionsResponse { + return &NullableListWafCollectionsResponse{value: val, isSet: true} +} + +func (v NullableListWafCollectionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListWafCollectionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_loki_log_sink.go b/services/cdn/v1api/model_loki_log_sink.go new file mode 100644 index 000000000..cb53340a0 --- /dev/null +++ b/services/cdn/v1api/model_loki_log_sink.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSink{} + +// LokiLogSink struct for LokiLogSink +type LokiLogSink struct { + PushUrl string `json:"pushUrl"` + Type string `json:"type"` +} + +type _LokiLogSink LokiLogSink + +// NewLokiLogSink instantiates a new LokiLogSink 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 NewLokiLogSink(pushUrl string, types string) *LokiLogSink { + this := LokiLogSink{} + this.PushUrl = pushUrl + this.Type = types + return &this +} + +// NewLokiLogSinkWithDefaults instantiates a new LokiLogSink 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 NewLokiLogSinkWithDefaults() *LokiLogSink { + this := LokiLogSink{} + return &this +} + +// GetPushUrl returns the PushUrl field value +func (o *LokiLogSink) GetPushUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value +// and a boolean to check if the value has been set. +func (o *LokiLogSink) GetPushUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PushUrl, true +} + +// SetPushUrl sets field value +func (o *LokiLogSink) SetPushUrl(v string) { + o.PushUrl = v +} + +// GetType returns the Type field value +func (o *LokiLogSink) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LokiLogSink) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *LokiLogSink) SetType(v string) { + o.Type = v +} + +func (o LokiLogSink) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pushUrl"] = o.PushUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *LokiLogSink) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pushUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSink := _LokiLogSink{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSink) + + if err != nil { + return err + } + + *o = LokiLogSink(varLokiLogSink) + + return err +} + +type NullableLokiLogSink struct { + value *LokiLogSink + isSet bool +} + +func (v NullableLokiLogSink) Get() *LokiLogSink { + return v.value +} + +func (v *NullableLokiLogSink) Set(val *LokiLogSink) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSink) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSink(val *LokiLogSink) *NullableLokiLogSink { + return &NullableLokiLogSink{value: val, isSet: true} +} + +func (v NullableLokiLogSink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_loki_log_sink_create.go b/services/cdn/v1api/model_loki_log_sink_create.go new file mode 100644 index 000000000..29261debf --- /dev/null +++ b/services/cdn/v1api/model_loki_log_sink_create.go @@ -0,0 +1,212 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSinkCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSinkCreate{} + +// LokiLogSinkCreate struct for LokiLogSinkCreate +type LokiLogSinkCreate struct { + Credentials LokiLogSinkCredentials `json:"credentials"` + PushUrl string `json:"pushUrl"` + Type string `json:"type"` +} + +type _LokiLogSinkCreate LokiLogSinkCreate + +// NewLokiLogSinkCreate instantiates a new LokiLogSinkCreate 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 NewLokiLogSinkCreate(credentials LokiLogSinkCredentials, pushUrl string, types string) *LokiLogSinkCreate { + this := LokiLogSinkCreate{} + this.Credentials = credentials + this.PushUrl = pushUrl + this.Type = types + return &this +} + +// NewLokiLogSinkCreateWithDefaults instantiates a new LokiLogSinkCreate 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 NewLokiLogSinkCreateWithDefaults() *LokiLogSinkCreate { + this := LokiLogSinkCreate{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *LokiLogSinkCreate) GetCredentials() LokiLogSinkCredentials { + if o == nil { + var ret LokiLogSinkCredentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCreate) GetCredentialsOk() (*LokiLogSinkCredentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *LokiLogSinkCreate) SetCredentials(v LokiLogSinkCredentials) { + o.Credentials = v +} + +// GetPushUrl returns the PushUrl field value +func (o *LokiLogSinkCreate) GetPushUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCreate) GetPushUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PushUrl, true +} + +// SetPushUrl sets field value +func (o *LokiLogSinkCreate) SetPushUrl(v string) { + o.PushUrl = v +} + +// GetType returns the Type field value +func (o *LokiLogSinkCreate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCreate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *LokiLogSinkCreate) SetType(v string) { + o.Type = v +} + +func (o LokiLogSinkCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSinkCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + toSerialize["pushUrl"] = o.PushUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *LokiLogSinkCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + "pushUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSinkCreate := _LokiLogSinkCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSinkCreate) + + if err != nil { + return err + } + + *o = LokiLogSinkCreate(varLokiLogSinkCreate) + + return err +} + +type NullableLokiLogSinkCreate struct { + value *LokiLogSinkCreate + isSet bool +} + +func (v NullableLokiLogSinkCreate) Get() *LokiLogSinkCreate { + return v.value +} + +func (v *NullableLokiLogSinkCreate) Set(val *LokiLogSinkCreate) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkCreate(val *LokiLogSinkCreate) *NullableLokiLogSinkCreate { + return &NullableLokiLogSinkCreate{value: val, isSet: true} +} + +func (v NullableLokiLogSinkCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_loki_log_sink_credentials.go b/services/cdn/v1api/model_loki_log_sink_credentials.go new file mode 100644 index 000000000..ade42153f --- /dev/null +++ b/services/cdn/v1api/model_loki_log_sink_credentials.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSinkCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSinkCredentials{} + +// LokiLogSinkCredentials struct for LokiLogSinkCredentials +type LokiLogSinkCredentials struct { + Password string `json:"password"` + Username string `json:"username"` +} + +type _LokiLogSinkCredentials LokiLogSinkCredentials + +// NewLokiLogSinkCredentials instantiates a new LokiLogSinkCredentials 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 NewLokiLogSinkCredentials(password string, username string) *LokiLogSinkCredentials { + this := LokiLogSinkCredentials{} + this.Password = password + this.Username = username + return &this +} + +// NewLokiLogSinkCredentialsWithDefaults instantiates a new LokiLogSinkCredentials 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 NewLokiLogSinkCredentialsWithDefaults() *LokiLogSinkCredentials { + this := LokiLogSinkCredentials{} + return &this +} + +// GetPassword returns the Password field value +func (o *LokiLogSinkCredentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCredentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *LokiLogSinkCredentials) SetPassword(v string) { + o.Password = v +} + +// GetUsername returns the Username field value +func (o *LokiLogSinkCredentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCredentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *LokiLogSinkCredentials) SetUsername(v string) { + o.Username = v +} + +func (o LokiLogSinkCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSinkCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["password"] = o.Password + toSerialize["username"] = o.Username + return toSerialize, nil +} + +func (o *LokiLogSinkCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "password", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSinkCredentials := _LokiLogSinkCredentials{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSinkCredentials) + + if err != nil { + return err + } + + *o = LokiLogSinkCredentials(varLokiLogSinkCredentials) + + return err +} + +type NullableLokiLogSinkCredentials struct { + value *LokiLogSinkCredentials + isSet bool +} + +func (v NullableLokiLogSinkCredentials) Get() *LokiLogSinkCredentials { + return v.value +} + +func (v *NullableLokiLogSinkCredentials) Set(val *LokiLogSinkCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkCredentials(val *LokiLogSinkCredentials) *NullableLokiLogSinkCredentials { + return &NullableLokiLogSinkCredentials{value: val, isSet: true} +} + +func (v NullableLokiLogSinkCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_loki_log_sink_patch.go b/services/cdn/v1api/model_loki_log_sink_patch.go new file mode 100644 index 000000000..301b8dbb7 --- /dev/null +++ b/services/cdn/v1api/model_loki_log_sink_patch.go @@ -0,0 +1,228 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSinkPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSinkPatch{} + +// LokiLogSinkPatch struct for LokiLogSinkPatch +type LokiLogSinkPatch struct { + Credentials *LokiLogSinkCredentials `json:"credentials,omitempty"` + PushUrl *string `json:"pushUrl,omitempty"` + Type string `json:"type"` +} + +type _LokiLogSinkPatch LokiLogSinkPatch + +// NewLokiLogSinkPatch instantiates a new LokiLogSinkPatch 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 NewLokiLogSinkPatch(types string) *LokiLogSinkPatch { + this := LokiLogSinkPatch{} + this.Type = types + return &this +} + +// NewLokiLogSinkPatchWithDefaults instantiates a new LokiLogSinkPatch 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 NewLokiLogSinkPatchWithDefaults() *LokiLogSinkPatch { + this := LokiLogSinkPatch{} + return &this +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *LokiLogSinkPatch) GetCredentials() LokiLogSinkCredentials { + if o == nil || IsNil(o.Credentials) { + var ret LokiLogSinkCredentials + return ret + } + return *o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LokiLogSinkPatch) GetCredentialsOk() (*LokiLogSinkCredentials, bool) { + if o == nil || IsNil(o.Credentials) { + return nil, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *LokiLogSinkPatch) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given LokiLogSinkCredentials and assigns it to the Credentials field. +func (o *LokiLogSinkPatch) SetCredentials(v LokiLogSinkCredentials) { + o.Credentials = &v +} + +// GetPushUrl returns the PushUrl field value if set, zero value otherwise. +func (o *LokiLogSinkPatch) GetPushUrl() string { + if o == nil || IsNil(o.PushUrl) { + var ret string + return ret + } + return *o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LokiLogSinkPatch) GetPushUrlOk() (*string, bool) { + if o == nil || IsNil(o.PushUrl) { + return nil, false + } + return o.PushUrl, true +} + +// HasPushUrl returns a boolean if a field has been set. +func (o *LokiLogSinkPatch) HasPushUrl() bool { + if o != nil && !IsNil(o.PushUrl) { + return true + } + + return false +} + +// SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. +func (o *LokiLogSinkPatch) SetPushUrl(v string) { + o.PushUrl = &v +} + +// GetType returns the Type field value +func (o *LokiLogSinkPatch) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkPatch) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *LokiLogSinkPatch) SetType(v string) { + o.Type = v +} + +func (o LokiLogSinkPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSinkPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + if !IsNil(o.PushUrl) { + toSerialize["pushUrl"] = o.PushUrl + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *LokiLogSinkPatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSinkPatch := _LokiLogSinkPatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSinkPatch) + + if err != nil { + return err + } + + *o = LokiLogSinkPatch(varLokiLogSinkPatch) + + return err +} + +type NullableLokiLogSinkPatch struct { + value *LokiLogSinkPatch + isSet bool +} + +func (v NullableLokiLogSinkPatch) Get() *LokiLogSinkPatch { + return v.value +} + +func (v *NullableLokiLogSinkPatch) Set(val *LokiLogSinkPatch) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkPatch(val *LokiLogSinkPatch) *NullableLokiLogSinkPatch { + return &NullableLokiLogSinkPatch{value: val, isSet: true} +} + +func (v NullableLokiLogSinkPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_match_condition.go b/services/cdn/v1api/model_match_condition.go new file mode 100644 index 000000000..d1f589967 --- /dev/null +++ b/services/cdn/v1api/model_match_condition.go @@ -0,0 +1,112 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// MatchCondition Defines how multiple matchers within this rule are combined (ALL, ANY, NONE). Defaults to ANY. +type MatchCondition string + +// List of MatchCondition +const ( + MATCHCONDITION_ANY MatchCondition = "ANY" + MATCHCONDITION_ALL MatchCondition = "ALL" + MATCHCONDITION_NONE MatchCondition = "NONE" +) + +// All allowed values of MatchCondition enum +var AllowedMatchConditionEnumValues = []MatchCondition{ + "ANY", + "ALL", + "NONE", +} + +func (v *MatchCondition) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := MatchCondition(value) + for _, existing := range AllowedMatchConditionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid MatchCondition", value) +} + +// NewMatchConditionFromValue returns a pointer to a valid MatchCondition +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewMatchConditionFromValue(v string) (*MatchCondition, error) { + ev := MatchCondition(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for MatchCondition: valid values are %v", v, AllowedMatchConditionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v MatchCondition) IsValid() bool { + for _, existing := range AllowedMatchConditionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MatchCondition value +func (v MatchCondition) Ptr() *MatchCondition { + return &v +} + +type NullableMatchCondition struct { + value *MatchCondition + isSet bool +} + +func (v NullableMatchCondition) Get() *MatchCondition { + return v.value +} + +func (v *NullableMatchCondition) Set(val *MatchCondition) { + v.value = val + v.isSet = true +} + +func (v NullableMatchCondition) IsSet() bool { + return v.isSet +} + +func (v *NullableMatchCondition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMatchCondition(val *MatchCondition) *NullableMatchCondition { + return &NullableMatchCondition{value: val, isSet: true} +} + +func (v NullableMatchCondition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMatchCondition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_matcher.go b/services/cdn/v1api/model_matcher.go new file mode 100644 index 000000000..291655e94 --- /dev/null +++ b/services/cdn/v1api/model_matcher.go @@ -0,0 +1,197 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Matcher type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Matcher{} + +// Matcher A matcher containing a list of string values to compare against the request path. +type Matcher struct { + ValueMatchCondition *MatchCondition `json:"valueMatchCondition,omitempty"` + // A list of glob patterns to match against the request path. At least one value is required. Examples: \"/shop/_*\" or \"*_/img/_*\" + Values []string `json:"values"` +} + +type _Matcher Matcher + +// NewMatcher instantiates a new Matcher 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 NewMatcher(values []string) *Matcher { + this := Matcher{} + var valueMatchCondition MatchCondition = MATCHCONDITION_ANY + this.ValueMatchCondition = &valueMatchCondition + this.Values = values + return &this +} + +// NewMatcherWithDefaults instantiates a new Matcher 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 NewMatcherWithDefaults() *Matcher { + this := Matcher{} + var valueMatchCondition MatchCondition = MATCHCONDITION_ANY + this.ValueMatchCondition = &valueMatchCondition + return &this +} + +// GetValueMatchCondition returns the ValueMatchCondition field value if set, zero value otherwise. +func (o *Matcher) GetValueMatchCondition() MatchCondition { + if o == nil || IsNil(o.ValueMatchCondition) { + var ret MatchCondition + return ret + } + return *o.ValueMatchCondition +} + +// GetValueMatchConditionOk returns a tuple with the ValueMatchCondition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Matcher) GetValueMatchConditionOk() (*MatchCondition, bool) { + if o == nil || IsNil(o.ValueMatchCondition) { + return nil, false + } + return o.ValueMatchCondition, true +} + +// HasValueMatchCondition returns a boolean if a field has been set. +func (o *Matcher) HasValueMatchCondition() bool { + if o != nil && !IsNil(o.ValueMatchCondition) { + return true + } + + return false +} + +// SetValueMatchCondition gets a reference to the given MatchCondition and assigns it to the ValueMatchCondition field. +func (o *Matcher) SetValueMatchCondition(v MatchCondition) { + o.ValueMatchCondition = &v +} + +// GetValues returns the Values field value +func (o *Matcher) GetValues() []string { + if o == nil { + var ret []string + return ret + } + + return o.Values +} + +// GetValuesOk returns a tuple with the Values field value +// and a boolean to check if the value has been set. +func (o *Matcher) GetValuesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Values, true +} + +// SetValues sets field value +func (o *Matcher) SetValues(v []string) { + o.Values = v +} + +func (o Matcher) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Matcher) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ValueMatchCondition) { + toSerialize["valueMatchCondition"] = o.ValueMatchCondition + } + toSerialize["values"] = o.Values + return toSerialize, nil +} + +func (o *Matcher) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "values", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMatcher := _Matcher{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMatcher) + + if err != nil { + return err + } + + *o = Matcher(varMatcher) + + return err +} + +type NullableMatcher struct { + value *Matcher + isSet bool +} + +func (v NullableMatcher) Get() *Matcher { + return v.value +} + +func (v *NullableMatcher) Set(val *Matcher) { + v.value = val + v.isSet = true +} + +func (v NullableMatcher) IsSet() bool { + return v.isSet +} + +func (v *NullableMatcher) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMatcher(val *Matcher) *NullableMatcher { + return &NullableMatcher{value: val, isSet: true} +} + +func (v NullableMatcher) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMatcher) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_optimizer.go b/services/cdn/v1api/model_optimizer.go new file mode 100644 index 000000000..c69c1da24 --- /dev/null +++ b/services/cdn/v1api/model_optimizer.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Optimizer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Optimizer{} + +// Optimizer Optimizer is paid feature, a real-time on the fly image manipulation and optimization service that automatically optimizes your images for faster image delivery. +type Optimizer struct { + // Determines if the optimizer should be enabled for this distribution and incurs a monthly fee + Enabled bool `json:"enabled"` +} + +type _Optimizer Optimizer + +// NewOptimizer instantiates a new Optimizer 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 NewOptimizer(enabled bool) *Optimizer { + this := Optimizer{} + this.Enabled = enabled + return &this +} + +// NewOptimizerWithDefaults instantiates a new Optimizer 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 NewOptimizerWithDefaults() *Optimizer { + this := Optimizer{} + return &this +} + +// GetEnabled returns the Enabled field value +func (o *Optimizer) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *Optimizer) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *Optimizer) SetEnabled(v bool) { + o.Enabled = v +} + +func (o Optimizer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Optimizer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["enabled"] = o.Enabled + return toSerialize, nil +} + +func (o *Optimizer) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOptimizer := _Optimizer{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOptimizer) + + if err != nil { + return err + } + + *o = Optimizer(varOptimizer) + + return err +} + +type NullableOptimizer struct { + value *Optimizer + isSet bool +} + +func (v NullableOptimizer) Get() *Optimizer { + return v.value +} + +func (v *NullableOptimizer) Set(val *Optimizer) { + v.value = val + v.isSet = true +} + +func (v NullableOptimizer) IsSet() bool { + return v.isSet +} + +func (v *NullableOptimizer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOptimizer(val *Optimizer) *NullableOptimizer { + return &NullableOptimizer{value: val, isSet: true} +} + +func (v NullableOptimizer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOptimizer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_optimizer_patch.go b/services/cdn/v1api/model_optimizer_patch.go new file mode 100644 index 000000000..b1a88e0d8 --- /dev/null +++ b/services/cdn/v1api/model_optimizer_patch.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the OptimizerPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OptimizerPatch{} + +// OptimizerPatch struct for OptimizerPatch +type OptimizerPatch struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// NewOptimizerPatch instantiates a new OptimizerPatch 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 NewOptimizerPatch() *OptimizerPatch { + this := OptimizerPatch{} + return &this +} + +// NewOptimizerPatchWithDefaults instantiates a new OptimizerPatch 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 NewOptimizerPatchWithDefaults() *OptimizerPatch { + this := OptimizerPatch{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *OptimizerPatch) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OptimizerPatch) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *OptimizerPatch) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *OptimizerPatch) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o OptimizerPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OptimizerPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableOptimizerPatch struct { + value *OptimizerPatch + isSet bool +} + +func (v NullableOptimizerPatch) Get() *OptimizerPatch { + return v.value +} + +func (v *NullableOptimizerPatch) Set(val *OptimizerPatch) { + v.value = val + v.isSet = true +} + +func (v NullableOptimizerPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableOptimizerPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOptimizerPatch(val *OptimizerPatch) *NullableOptimizerPatch { + return &NullableOptimizerPatch{value: val, isSet: true} +} + +func (v NullableOptimizerPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOptimizerPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_patch_distribution_payload.go b/services/cdn/v1api/model_patch_distribution_payload.go new file mode 100644 index 000000000..c65650459 --- /dev/null +++ b/services/cdn/v1api/model_patch_distribution_payload.go @@ -0,0 +1,161 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PatchDistributionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchDistributionPayload{} + +// PatchDistributionPayload Defines a partial distribution. Set values +type PatchDistributionPayload struct { + Config *ConfigPatch `json:"config,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` +} + +// NewPatchDistributionPayload instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayload() *PatchDistributionPayload { + this := PatchDistributionPayload{} + return &this +} + +// NewPatchDistributionPayloadWithDefaults instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayloadWithDefaults() *PatchDistributionPayload { + this := PatchDistributionPayload{} + return &this +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *PatchDistributionPayload) GetConfig() ConfigPatch { + if o == nil || IsNil(o.Config) { + var ret ConfigPatch + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchDistributionPayload) GetConfigOk() (*ConfigPatch, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *PatchDistributionPayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ConfigPatch and assigns it to the Config field. +func (o *PatchDistributionPayload) SetConfig(v ConfigPatch) { + o.Config = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *PatchDistributionPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchDistributionPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *PatchDistributionPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *PatchDistributionPayload) SetIntentId(v string) { + o.IntentId = &v +} + +func (o PatchDistributionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchDistributionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + return toSerialize, nil +} + +type NullablePatchDistributionPayload struct { + value *PatchDistributionPayload + isSet bool +} + +func (v NullablePatchDistributionPayload) Get() *PatchDistributionPayload { + return v.value +} + +func (v *NullablePatchDistributionPayload) Set(val *PatchDistributionPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePatchDistributionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchDistributionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchDistributionPayload(val *PatchDistributionPayload) *NullablePatchDistributionPayload { + return &NullablePatchDistributionPayload{value: val, isSet: true} +} + +func (v NullablePatchDistributionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchDistributionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_patch_distribution_response.go b/services/cdn/v1api/model_patch_distribution_response.go new file mode 100644 index 000000000..1b344fe4e --- /dev/null +++ b/services/cdn/v1api/model_patch_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PatchDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchDistributionResponse{} + +// PatchDistributionResponse struct for PatchDistributionResponse +type PatchDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _PatchDistributionResponse PatchDistributionResponse + +// NewPatchDistributionResponse instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponse(distribution Distribution) *PatchDistributionResponse { + this := PatchDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewPatchDistributionResponseWithDefaults instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponseWithDefaults() *PatchDistributionResponse { + this := PatchDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *PatchDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *PatchDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *PatchDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o PatchDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *PatchDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPatchDistributionResponse := _PatchDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPatchDistributionResponse) + + if err != nil { + return err + } + + *o = PatchDistributionResponse(varPatchDistributionResponse) + + return err +} + +type NullablePatchDistributionResponse struct { + value *PatchDistributionResponse + isSet bool +} + +func (v NullablePatchDistributionResponse) Get() *PatchDistributionResponse { + return v.value +} + +func (v *NullablePatchDistributionResponse) Set(val *PatchDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePatchDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchDistributionResponse(val *PatchDistributionResponse) *NullablePatchDistributionResponse { + return &NullablePatchDistributionResponse{value: val, isSet: true} +} + +func (v NullablePatchDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_purge_cache_payload.go b/services/cdn/v1api/model_purge_cache_payload.go new file mode 100644 index 000000000..9d05dcd99 --- /dev/null +++ b/services/cdn/v1api/model_purge_cache_payload.go @@ -0,0 +1,125 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PurgeCachePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PurgeCachePayload{} + +// PurgeCachePayload struct for PurgeCachePayload +type PurgeCachePayload struct { + // Defines an optional path. If this is set, a granular purge is done. If missing, the entire cache is invalidated. During a granular cache purge, only the provided path is purged. Please do not that for example `/some/path` and `/some/path.txt` are considered different paths. + Path *string `json:"path,omitempty"` +} + +// NewPurgeCachePayload instantiates a new PurgeCachePayload 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 NewPurgeCachePayload() *PurgeCachePayload { + this := PurgeCachePayload{} + return &this +} + +// NewPurgeCachePayloadWithDefaults instantiates a new PurgeCachePayload 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 NewPurgeCachePayloadWithDefaults() *PurgeCachePayload { + this := PurgeCachePayload{} + return &this +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *PurgeCachePayload) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PurgeCachePayload) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *PurgeCachePayload) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *PurgeCachePayload) SetPath(v string) { + o.Path = &v +} + +func (o PurgeCachePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PurgeCachePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + return toSerialize, nil +} + +type NullablePurgeCachePayload struct { + value *PurgeCachePayload + isSet bool +} + +func (v NullablePurgeCachePayload) Get() *PurgeCachePayload { + return v.value +} + +func (v *NullablePurgeCachePayload) Set(val *PurgeCachePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePurgeCachePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePurgeCachePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePurgeCachePayload(val *PurgeCachePayload) *NullablePurgeCachePayload { + return &NullablePurgeCachePayload{value: val, isSet: true} +} + +func (v NullablePurgeCachePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePurgeCachePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_put_custom_domain_custom_certificate.go b/services/cdn/v1api/model_put_custom_domain_custom_certificate.go new file mode 100644 index 000000000..443d420af --- /dev/null +++ b/services/cdn/v1api/model_put_custom_domain_custom_certificate.go @@ -0,0 +1,214 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainCustomCertificate{} + +// PutCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. +type PutCustomDomainCustomCertificate struct { + // base64-encoded PEM-encoded certificate + Certificate string `json:"certificate"` + // base64-encoded PEM encoded key + Key string `json:"key"` + Type string `json:"type"` +} + +type _PutCustomDomainCustomCertificate PutCustomDomainCustomCertificate + +// NewPutCustomDomainCustomCertificate instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificate(certificate string, key string, types string) *PutCustomDomainCustomCertificate { + this := PutCustomDomainCustomCertificate{} + this.Certificate = certificate + this.Key = key + this.Type = types + return &this +} + +// NewPutCustomDomainCustomCertificateWithDefaults instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificateWithDefaults() *PutCustomDomainCustomCertificate { + this := PutCustomDomainCustomCertificate{} + return &this +} + +// GetCertificate returns the Certificate field value +func (o *PutCustomDomainCustomCertificate) GetCertificate() string { + if o == nil { + var ret string + return ret + } + + return o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Certificate, true +} + +// SetCertificate sets field value +func (o *PutCustomDomainCustomCertificate) SetCertificate(v string) { + o.Certificate = v +} + +// GetKey returns the Key field value +func (o *PutCustomDomainCustomCertificate) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *PutCustomDomainCustomCertificate) SetKey(v string) { + o.Key = v +} + +// GetType returns the Type field value +func (o *PutCustomDomainCustomCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PutCustomDomainCustomCertificate) SetType(v string) { + o.Type = v +} + +func (o PutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["certificate"] = o.Certificate + toSerialize["key"] = o.Key + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *PutCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "certificate", + "key", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainCustomCertificate := _PutCustomDomainCustomCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainCustomCertificate) + + if err != nil { + return err + } + + *o = PutCustomDomainCustomCertificate(varPutCustomDomainCustomCertificate) + + return err +} + +type NullablePutCustomDomainCustomCertificate struct { + value *PutCustomDomainCustomCertificate + isSet bool +} + +func (v NullablePutCustomDomainCustomCertificate) Get() *PutCustomDomainCustomCertificate { + return v.value +} + +func (v *NullablePutCustomDomainCustomCertificate) Set(val *PutCustomDomainCustomCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainCustomCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainCustomCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainCustomCertificate(val *PutCustomDomainCustomCertificate) *NullablePutCustomDomainCustomCertificate { + return &NullablePutCustomDomainCustomCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_put_custom_domain_managed_certificate.go b/services/cdn/v1api/model_put_custom_domain_managed_certificate.go new file mode 100644 index 000000000..9ee41a4d4 --- /dev/null +++ b/services/cdn/v1api/model_put_custom_domain_managed_certificate.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainManagedCertificate{} + +// PutCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you +type PutCustomDomainManagedCertificate struct { + Type string `json:"type"` +} + +type _PutCustomDomainManagedCertificate PutCustomDomainManagedCertificate + +// NewPutCustomDomainManagedCertificate instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificate(types string) *PutCustomDomainManagedCertificate { + this := PutCustomDomainManagedCertificate{} + this.Type = types + return &this +} + +// NewPutCustomDomainManagedCertificateWithDefaults instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificateWithDefaults() *PutCustomDomainManagedCertificate { + this := PutCustomDomainManagedCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *PutCustomDomainManagedCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PutCustomDomainManagedCertificate) SetType(v string) { + o.Type = v +} + +func (o PutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *PutCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainManagedCertificate := _PutCustomDomainManagedCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainManagedCertificate) + + if err != nil { + return err + } + + *o = PutCustomDomainManagedCertificate(varPutCustomDomainManagedCertificate) + + return err +} + +type NullablePutCustomDomainManagedCertificate struct { + value *PutCustomDomainManagedCertificate + isSet bool +} + +func (v NullablePutCustomDomainManagedCertificate) Get() *PutCustomDomainManagedCertificate { + return v.value +} + +func (v *NullablePutCustomDomainManagedCertificate) Set(val *PutCustomDomainManagedCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainManagedCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainManagedCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainManagedCertificate(val *PutCustomDomainManagedCertificate) *NullablePutCustomDomainManagedCertificate { + return &NullablePutCustomDomainManagedCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_put_custom_domain_payload.go b/services/cdn/v1api/model_put_custom_domain_payload.go new file mode 100644 index 000000000..db0b7b90b --- /dev/null +++ b/services/cdn/v1api/model_put_custom_domain_payload.go @@ -0,0 +1,161 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PutCustomDomainPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainPayload{} + +// PutCustomDomainPayload struct for PutCustomDomainPayload +type PutCustomDomainPayload struct { + Certificate *PutCustomDomainPayloadCertificate `json:"certificate,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` +} + +// NewPutCustomDomainPayload instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayload() *PutCustomDomainPayload { + this := PutCustomDomainPayload{} + return &this +} + +// NewPutCustomDomainPayloadWithDefaults instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayloadWithDefaults() *PutCustomDomainPayload { + this := PutCustomDomainPayload{} + return &this +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise. +func (o *PutCustomDomainPayload) GetCertificate() PutCustomDomainPayloadCertificate { + if o == nil || IsNil(o.Certificate) { + var ret PutCustomDomainPayloadCertificate + return ret + } + return *o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainPayload) GetCertificateOk() (*PutCustomDomainPayloadCertificate, bool) { + if o == nil || IsNil(o.Certificate) { + return nil, false + } + return o.Certificate, true +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PutCustomDomainPayload) HasCertificate() bool { + if o != nil && !IsNil(o.Certificate) { + return true + } + + return false +} + +// SetCertificate gets a reference to the given PutCustomDomainPayloadCertificate and assigns it to the Certificate field. +func (o *PutCustomDomainPayload) SetCertificate(v PutCustomDomainPayloadCertificate) { + o.Certificate = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *PutCustomDomainPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *PutCustomDomainPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *PutCustomDomainPayload) SetIntentId(v string) { + o.IntentId = &v +} + +func (o PutCustomDomainPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Certificate) { + toSerialize["certificate"] = o.Certificate + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + return toSerialize, nil +} + +type NullablePutCustomDomainPayload struct { + value *PutCustomDomainPayload + isSet bool +} + +func (v NullablePutCustomDomainPayload) Get() *PutCustomDomainPayload { + return v.value +} + +func (v *NullablePutCustomDomainPayload) Set(val *PutCustomDomainPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainPayload(val *PutCustomDomainPayload) *NullablePutCustomDomainPayload { + return &NullablePutCustomDomainPayload{value: val, isSet: true} +} + +func (v NullablePutCustomDomainPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_put_custom_domain_payload_certificate.go b/services/cdn/v1api/model_put_custom_domain_payload_certificate.go new file mode 100644 index 000000000..deb09db47 --- /dev/null +++ b/services/cdn/v1api/model_put_custom_domain_payload_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// PutCustomDomainPayloadCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted +type PutCustomDomainPayloadCertificate struct { + PutCustomDomainCustomCertificate *PutCustomDomainCustomCertificate + PutCustomDomainManagedCertificate *PutCustomDomainManagedCertificate +} + +// PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainCustomCertificate wrapped in PutCustomDomainPayloadCertificate +func PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainCustomCertificate) PutCustomDomainPayloadCertificate { + return PutCustomDomainPayloadCertificate{ + PutCustomDomainCustomCertificate: v, + } +} + +// PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainManagedCertificate wrapped in PutCustomDomainPayloadCertificate +func PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainManagedCertificate) PutCustomDomainPayloadCertificate { + return PutCustomDomainPayloadCertificate{ + PutCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PutCustomDomainPayloadCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into PutCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.PutCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.PutCustomDomainCustomCertificate, return on the first match + } else { + dst.PutCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into PutCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.PutCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.PutCustomDomainManagedCertificate, return on the first match + } else { + dst.PutCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { + if src.PutCustomDomainCustomCertificate != nil { + return json.Marshal(&src.PutCustomDomainCustomCertificate) + } + + if src.PutCustomDomainManagedCertificate != nil { + return json.Marshal(&src.PutCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *PutCustomDomainPayloadCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.PutCustomDomainCustomCertificate != nil { + return obj.PutCustomDomainCustomCertificate + } + + if obj.PutCustomDomainManagedCertificate != nil { + return obj.PutCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj PutCustomDomainPayloadCertificate) GetActualInstanceValue() interface{} { + if obj.PutCustomDomainCustomCertificate != nil { + return *obj.PutCustomDomainCustomCertificate + } + + if obj.PutCustomDomainManagedCertificate != nil { + return *obj.PutCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullablePutCustomDomainPayloadCertificate struct { + value *PutCustomDomainPayloadCertificate + isSet bool +} + +func (v NullablePutCustomDomainPayloadCertificate) Get() *PutCustomDomainPayloadCertificate { + return v.value +} + +func (v *NullablePutCustomDomainPayloadCertificate) Set(val *PutCustomDomainPayloadCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainPayloadCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainPayloadCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainPayloadCertificate(val *PutCustomDomainPayloadCertificate) *NullablePutCustomDomainPayloadCertificate { + return &NullablePutCustomDomainPayloadCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainPayloadCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_put_custom_domain_response.go b/services/cdn/v1api/model_put_custom_domain_response.go new file mode 100644 index 000000000..283bb7473 --- /dev/null +++ b/services/cdn/v1api/model_put_custom_domain_response.go @@ -0,0 +1,192 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainResponse{} + +// PutCustomDomainResponse struct for PutCustomDomainResponse +type PutCustomDomainResponse struct { + Certificate *PutCustomDomainResponseCertificate `json:"certificate,omitempty"` + CustomDomain CustomDomain `json:"customDomain"` +} + +type _PutCustomDomainResponse PutCustomDomainResponse + +// NewPutCustomDomainResponse instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponse(customDomain CustomDomain) *PutCustomDomainResponse { + this := PutCustomDomainResponse{} + this.CustomDomain = customDomain + return &this +} + +// NewPutCustomDomainResponseWithDefaults instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponseWithDefaults() *PutCustomDomainResponse { + this := PutCustomDomainResponse{} + return &this +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise. +func (o *PutCustomDomainResponse) GetCertificate() PutCustomDomainResponseCertificate { + if o == nil || IsNil(o.Certificate) { + var ret PutCustomDomainResponseCertificate + return ret + } + return *o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainResponse) GetCertificateOk() (*PutCustomDomainResponseCertificate, bool) { + if o == nil || IsNil(o.Certificate) { + return nil, false + } + return o.Certificate, true +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PutCustomDomainResponse) HasCertificate() bool { + if o != nil && !IsNil(o.Certificate) { + return true + } + + return false +} + +// SetCertificate gets a reference to the given PutCustomDomainResponseCertificate and assigns it to the Certificate field. +func (o *PutCustomDomainResponse) SetCertificate(v PutCustomDomainResponseCertificate) { + o.Certificate = &v +} + +// GetCustomDomain returns the CustomDomain field value +func (o *PutCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil { + var ret CustomDomain + return ret + } + + return o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil { + return nil, false + } + return &o.CustomDomain, true +} + +// SetCustomDomain sets field value +func (o *PutCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = v +} + +func (o PutCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Certificate) { + toSerialize["certificate"] = o.Certificate + } + toSerialize["customDomain"] = o.CustomDomain + return toSerialize, nil +} + +func (o *PutCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "customDomain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainResponse := _PutCustomDomainResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainResponse) + + if err != nil { + return err + } + + *o = PutCustomDomainResponse(varPutCustomDomainResponse) + + return err +} + +type NullablePutCustomDomainResponse struct { + value *PutCustomDomainResponse + isSet bool +} + +func (v NullablePutCustomDomainResponse) Get() *PutCustomDomainResponse { + return v.value +} + +func (v *NullablePutCustomDomainResponse) Set(val *PutCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainResponse(val *PutCustomDomainResponse) *NullablePutCustomDomainResponse { + return &NullablePutCustomDomainResponse{value: val, isSet: true} +} + +func (v NullablePutCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_put_custom_domain_response_certificate.go b/services/cdn/v1api/model_put_custom_domain_response_certificate.go new file mode 100644 index 000000000..30074918e --- /dev/null +++ b/services/cdn/v1api/model_put_custom_domain_response_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// PutCustomDomainResponseCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted +type PutCustomDomainResponseCertificate struct { + GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate + GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate +} + +// GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in PutCustomDomainResponseCertificate +func GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) PutCustomDomainResponseCertificate { + return PutCustomDomainResponseCertificate{ + GetCustomDomainCustomCertificate: v, + } +} + +// GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in PutCustomDomainResponseCertificate +func GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) PutCustomDomainResponseCertificate { + return PutCustomDomainResponseCertificate{ + GetCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PutCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into GetCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match + } else { + dst.GetCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into GetCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match + } else { + dst.GetCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + if src.GetCustomDomainCustomCertificate != nil { + return json.Marshal(&src.GetCustomDomainCustomCertificate) + } + + if src.GetCustomDomainManagedCertificate != nil { + return json.Marshal(&src.GetCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *PutCustomDomainResponseCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.GetCustomDomainCustomCertificate != nil { + return obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj PutCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { + if obj.GetCustomDomainCustomCertificate != nil { + return *obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return *obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullablePutCustomDomainResponseCertificate struct { + value *PutCustomDomainResponseCertificate + isSet bool +} + +func (v NullablePutCustomDomainResponseCertificate) Get() *PutCustomDomainResponseCertificate { + return v.value +} + +func (v *NullablePutCustomDomainResponseCertificate) Set(val *PutCustomDomainResponseCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainResponseCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainResponseCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainResponseCertificate(val *PutCustomDomainResponseCertificate) *NullablePutCustomDomainResponseCertificate { + return &NullablePutCustomDomainResponseCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_redirect_config.go b/services/cdn/v1api/model_redirect_config.go new file mode 100644 index 000000000..25d06e6d6 --- /dev/null +++ b/services/cdn/v1api/model_redirect_config.go @@ -0,0 +1,125 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the RedirectConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedirectConfig{} + +// RedirectConfig A wrapper for a list of redirect rules that allows for redirect settings on a distribution. +type RedirectConfig struct { + // A list of redirect rules. The order of rules matters for evaluation. + Rules []RedirectRule `json:"rules,omitempty"` +} + +// NewRedirectConfig instantiates a new RedirectConfig 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 NewRedirectConfig() *RedirectConfig { + this := RedirectConfig{} + return &this +} + +// NewRedirectConfigWithDefaults instantiates a new RedirectConfig 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 NewRedirectConfigWithDefaults() *RedirectConfig { + this := RedirectConfig{} + return &this +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *RedirectConfig) GetRules() []RedirectRule { + if o == nil || IsNil(o.Rules) { + var ret []RedirectRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectConfig) GetRulesOk() ([]RedirectRule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *RedirectConfig) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []RedirectRule and assigns it to the Rules field. +func (o *RedirectConfig) SetRules(v []RedirectRule) { + o.Rules = v +} + +func (o RedirectConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedirectConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + return toSerialize, nil +} + +type NullableRedirectConfig struct { + value *RedirectConfig + isSet bool +} + +func (v NullableRedirectConfig) Get() *RedirectConfig { + return v.value +} + +func (v *NullableRedirectConfig) Set(val *RedirectConfig) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectConfig(val *RedirectConfig) *NullableRedirectConfig { + return &NullableRedirectConfig{value: val, isSet: true} +} + +func (v NullableRedirectConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_redirect_rule.go b/services/cdn/v1api/model_redirect_rule.go new file mode 100644 index 000000000..d297b3fc3 --- /dev/null +++ b/services/cdn/v1api/model_redirect_rule.go @@ -0,0 +1,333 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RedirectRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedirectRule{} + +// RedirectRule A single redirect rule defining a source pattern and a target URL. +type RedirectRule struct { + // An optional description for the redirect rule. + Description *string `json:"description,omitempty"` + // A toggle to enable or disable the redirect rule. + Enabled *bool `json:"enabled,omitempty"` + // A list of matchers that define when this rule should apply. At least one matcher is required. + Matchers []Matcher `json:"matchers"` + RuleMatchCondition *MatchCondition `json:"ruleMatchCondition,omitempty"` + // The HTTP status code for the redirect. Must be one of 301, 302, 303, 307, or 308. + StatusCode int32 `json:"statusCode"` + // The target URL to redirect to. Must be a valid URI. + TargetUrl string `json:"targetUrl"` +} + +type _RedirectRule RedirectRule + +// NewRedirectRule instantiates a new RedirectRule 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 NewRedirectRule(matchers []Matcher, statusCode int32, targetUrl string) *RedirectRule { + this := RedirectRule{} + var enabled bool = true + this.Enabled = &enabled + this.Matchers = matchers + var ruleMatchCondition MatchCondition = MATCHCONDITION_ANY + this.RuleMatchCondition = &ruleMatchCondition + this.StatusCode = statusCode + this.TargetUrl = targetUrl + return &this +} + +// NewRedirectRuleWithDefaults instantiates a new RedirectRule 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 NewRedirectRuleWithDefaults() *RedirectRule { + this := RedirectRule{} + var enabled bool = true + this.Enabled = &enabled + var ruleMatchCondition MatchCondition = MATCHCONDITION_ANY + this.RuleMatchCondition = &ruleMatchCondition + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RedirectRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + 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 *RedirectRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RedirectRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RedirectRule) SetDescription(v string) { + o.Description = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *RedirectRule) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectRule) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *RedirectRule) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *RedirectRule) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetMatchers returns the Matchers field value +func (o *RedirectRule) GetMatchers() []Matcher { + if o == nil { + var ret []Matcher + return ret + } + + return o.Matchers +} + +// GetMatchersOk returns a tuple with the Matchers field value +// and a boolean to check if the value has been set. +func (o *RedirectRule) GetMatchersOk() ([]Matcher, bool) { + if o == nil { + return nil, false + } + return o.Matchers, true +} + +// SetMatchers sets field value +func (o *RedirectRule) SetMatchers(v []Matcher) { + o.Matchers = v +} + +// GetRuleMatchCondition returns the RuleMatchCondition field value if set, zero value otherwise. +func (o *RedirectRule) GetRuleMatchCondition() MatchCondition { + if o == nil || IsNil(o.RuleMatchCondition) { + var ret MatchCondition + return ret + } + return *o.RuleMatchCondition +} + +// GetRuleMatchConditionOk returns a tuple with the RuleMatchCondition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectRule) GetRuleMatchConditionOk() (*MatchCondition, bool) { + if o == nil || IsNil(o.RuleMatchCondition) { + return nil, false + } + return o.RuleMatchCondition, true +} + +// HasRuleMatchCondition returns a boolean if a field has been set. +func (o *RedirectRule) HasRuleMatchCondition() bool { + if o != nil && !IsNil(o.RuleMatchCondition) { + return true + } + + return false +} + +// SetRuleMatchCondition gets a reference to the given MatchCondition and assigns it to the RuleMatchCondition field. +func (o *RedirectRule) SetRuleMatchCondition(v MatchCondition) { + o.RuleMatchCondition = &v +} + +// GetStatusCode returns the StatusCode field value +func (o *RedirectRule) GetStatusCode() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value +// and a boolean to check if the value has been set. +func (o *RedirectRule) GetStatusCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.StatusCode, true +} + +// SetStatusCode sets field value +func (o *RedirectRule) SetStatusCode(v int32) { + o.StatusCode = v +} + +// GetTargetUrl returns the TargetUrl field value +func (o *RedirectRule) GetTargetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.TargetUrl +} + +// GetTargetUrlOk returns a tuple with the TargetUrl field value +// and a boolean to check if the value has been set. +func (o *RedirectRule) GetTargetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TargetUrl, true +} + +// SetTargetUrl sets field value +func (o *RedirectRule) SetTargetUrl(v string) { + o.TargetUrl = v +} + +func (o RedirectRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedirectRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["matchers"] = o.Matchers + if !IsNil(o.RuleMatchCondition) { + toSerialize["ruleMatchCondition"] = o.RuleMatchCondition + } + toSerialize["statusCode"] = o.StatusCode + toSerialize["targetUrl"] = o.TargetUrl + return toSerialize, nil +} + +func (o *RedirectRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "matchers", + "statusCode", + "targetUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRedirectRule := _RedirectRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRedirectRule) + + if err != nil { + return err + } + + *o = RedirectRule(varRedirectRule) + + return err +} + +type NullableRedirectRule struct { + value *RedirectRule + isSet bool +} + +func (v NullableRedirectRule) Get() *RedirectRule { + return v.value +} + +func (v *NullableRedirectRule) Set(val *RedirectRule) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectRule) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectRule(val *RedirectRule) *NullableRedirectRule { + return &NullableRedirectRule{value: val, isSet: true} +} + +func (v NullableRedirectRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_region.go b/services/cdn/v1api/model_region.go new file mode 100644 index 000000000..79c8f1c6c --- /dev/null +++ b/services/cdn/v1api/model_region.go @@ -0,0 +1,116 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// Region The following regions exist: - `EU` - Europe - `US` - United States / North America - `AF` - Africa - `SA` - South America - `ASIA` - Asia and Oceania +type Region string + +// List of Region +const ( + REGION_EU Region = "EU" + REGION_US Region = "US" + REGION_AF Region = "AF" + REGION_SA Region = "SA" + REGION_ASIA Region = "ASIA" +) + +// All allowed values of Region enum +var AllowedRegionEnumValues = []Region{ + "EU", + "US", + "AF", + "SA", + "ASIA", +} + +func (v *Region) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Region(value) + for _, existing := range AllowedRegionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Region", value) +} + +// NewRegionFromValue returns a pointer to a valid Region +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRegionFromValue(v string) (*Region, error) { + ev := Region(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Region: valid values are %v", v, AllowedRegionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Region) IsValid() bool { + for _, existing := range AllowedRegionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Region value +func (v Region) Ptr() *Region { + return &v +} + +type NullableRegion struct { + value *Region + isSet bool +} + +func (v NullableRegion) Get() *Region { + return v.value +} + +func (v *NullableRegion) Set(val *Region) { + v.value = val + v.isSet = true +} + +func (v NullableRegion) IsSet() bool { + return v.isSet +} + +func (v *NullableRegion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegion(val *Region) *NullableRegion { + return &NullableRegion{value: val, isSet: true} +} + +func (v NullableRegion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_status_error.go b/services/cdn/v1api/model_status_error.go new file mode 100644 index 000000000..3ced1d368 --- /dev/null +++ b/services/cdn/v1api/model_status_error.go @@ -0,0 +1,223 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the StatusError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StatusError{} + +// StatusError struct for StatusError +type StatusError struct { + // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. + De *string `json:"de,omitempty"` + // An english translation string corresponding to the error key. An english translation key is always present. + En string `json:"en"` + // An enum value that describes a Status Error. + Key string `json:"key"` +} + +type _StatusError StatusError + +// NewStatusError instantiates a new StatusError 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 NewStatusError(en string, key string) *StatusError { + this := StatusError{} + this.En = en + this.Key = key + return &this +} + +// NewStatusErrorWithDefaults instantiates a new StatusError 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 NewStatusErrorWithDefaults() *StatusError { + this := StatusError{} + return &this +} + +// GetDe returns the De field value if set, zero value otherwise. +func (o *StatusError) GetDe() string { + if o == nil || IsNil(o.De) { + var ret string + return ret + } + return *o.De +} + +// GetDeOk returns a tuple with the De field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusError) GetDeOk() (*string, bool) { + if o == nil || IsNil(o.De) { + return nil, false + } + return o.De, true +} + +// HasDe returns a boolean if a field has been set. +func (o *StatusError) HasDe() bool { + if o != nil && !IsNil(o.De) { + return true + } + + return false +} + +// SetDe gets a reference to the given string and assigns it to the De field. +func (o *StatusError) SetDe(v string) { + o.De = &v +} + +// GetEn returns the En field value +func (o *StatusError) GetEn() string { + if o == nil { + var ret string + return ret + } + + return o.En +} + +// GetEnOk returns a tuple with the En field value +// and a boolean to check if the value has been set. +func (o *StatusError) GetEnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.En, true +} + +// SetEn sets field value +func (o *StatusError) SetEn(v string) { + o.En = v +} + +// GetKey returns the Key field value +func (o *StatusError) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *StatusError) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *StatusError) SetKey(v string) { + o.Key = v +} + +func (o StatusError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StatusError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.De) { + toSerialize["de"] = o.De + } + toSerialize["en"] = o.En + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *StatusError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "en", + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStatusError := _StatusError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varStatusError) + + if err != nil { + return err + } + + *o = StatusError(varStatusError) + + return err +} + +type NullableStatusError struct { + value *StatusError + isSet bool +} + +func (v NullableStatusError) Get() *StatusError { + return v.value +} + +func (v *NullableStatusError) Set(val *StatusError) { + v.value = val + v.isSet = true +} + +func (v NullableStatusError) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusError(val *StatusError) *NullableStatusError { + return &NullableStatusError{value: val, isSet: true} +} + +func (v NullableStatusError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_config.go b/services/cdn/v1api/model_waf_config.go new file mode 100644 index 000000000..24b200254 --- /dev/null +++ b/services/cdn/v1api/model_waf_config.go @@ -0,0 +1,655 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafConfig{} + +// WafConfig Configuration of the WAF of a distribution A WAF Config always contains a WAF Mode and Type. If a WAF was never enabled, most of the properties are not present. To **enable** the WAF for your Distribution, you must set the `mode` to `ENABLED` or `LOG_ONLY`. This causes the other properties to be populated. ## Rules There are 9 properties used to control which Rules are enabled, disabled or set to Log-Only. These properties can be grouped in 3 groups of 3. Each of these groups varies in specificity: Rules are more specific than Rule Groups, which in turn are more specific than Collections. More specific definitions override more generic definitions. ### Collections - `enabledRuleCollectionIds` - `disabledRuleCollectionIds` - `logOnlyRuleCollectionIds` These are the least specific selectors. As of 2025, only two collections exist: - `@builtin/crs/response`, containing all Rules regarding Responses - `@builtin/crs/request`, containing all Rules regarding Requests More collections may be added in the future ### Rule Groups - `enabledRuleGroupIds` - `disabledRuleGroupIds` - `logOnlyRuleGroupIds` These are more specific than Collections and will override their selector. You can find all available Rule Groups by calling the `ListWafCollections` Operation. ### Rules - `enabledRuleIds` - `disabledRuleIds` - `logOnlyRuleGds` Being the most specific selectors, these will override both Collection and Rule Group selectors. You can find all available Rule Groups by calling the `ListWafCollections` Operation. ### TIP: Review resolved config If you call `GetDistribution` with `?withWafStatus=true`, you get back a resolved WAF Rules Config which contains a `waf` property which you can inspect to see why a Rule is either enabled, disabled or logOnly. +type WafConfig struct { + // This whitelist restricts which HTTP methods the distribution accepts. Requests using non-whitelisted methods are blocked by the WAF before reaching the origin. Common methods: `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS`, `CONNECT`, `TRACE` Validation ensures: 1. At least one method is allowed 2. No duplicate methods (e.g., `GET` appearing twice) 3. Each method is valid per HTTP standards + AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` + AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` + // This allow list restricts which Content-Type headers are accepted in request bodies. Format: Must be `type/subtype` with no spaces. Common content types: - `application/json` - `application/x-www-form-urlencoded` - `multipart/form-data` - `text/html` - `text/plain` - `application/xml` + AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` + // Ids of WAF Collections to mark as disabled + DisabledRuleCollectionIds []string `json:"disabledRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as disabled + DisabledRuleGroupIds []string `json:"disabledRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** disabled for this distribution. + DisabledRuleIds []string `json:"disabledRuleIds,omitempty"` + // Ids of WAF Collections to mark as enabled + EnabledRuleCollectionIds []string `json:"enabledRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as enabled + EnabledRuleGroupIds []string `json:"enabledRuleGroupIds,omitempty"` + // Ids of the WAF rules that are **explicitly** enabled for this distribution. If this rule is in a disabled / log Only RuleGroup or Collection, it will be enabled regardless as `enabledRuleIds` overrides those in specificity. Do note that rules can also be enabled because a Rulegroup or Collection is enabled. **DO NOT** use this property to find all active rules. Instead, pass `?withWafStatus=true` as a query parameter to `GetDistribution` or `ListDistributions`. This will expose the `waf` Property on distribution Level. From there you can `$.waf.enabledRules.map(e => e.id)` to get a list of all enabled rules. + EnabledRuleIds []string `json:"enabledRuleIds"` + // Ids of WAF Collections to mark as log Only. + LogOnlyRuleCollectionIds []string `json:"logOnlyRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as log Only. + LogOnlyRuleGroupIds []string `json:"logOnlyRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** marked as Log Only for this distribution. + LogOnlyRuleIds []string `json:"logOnlyRuleIds,omitempty"` + Mode WafMode `json:"mode"` + ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` + Type WafType `json:"type"` +} + +type _WafConfig WafConfig + +// NewWafConfig instantiates a new WafConfig 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 NewWafConfig(enabledRuleIds []string, mode WafMode, types WafType) *WafConfig { + this := WafConfig{} + this.EnabledRuleIds = enabledRuleIds + this.Mode = mode + this.Type = types + return &this +} + +// NewWafConfigWithDefaults instantiates a new WafConfig 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 NewWafConfigWithDefaults() *WafConfig { + this := WafConfig{} + return &this +} + +// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedHttpMethods() []string { + if o == nil || IsNil(o.AllowedHttpMethods) { + var ret []string + return ret + } + return o.AllowedHttpMethods +} + +// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedHttpMethodsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpMethods) { + return nil, false + } + return o.AllowedHttpMethods, true +} + +// HasAllowedHttpMethods returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedHttpMethods() bool { + if o != nil && !IsNil(o.AllowedHttpMethods) { + return true + } + + return false +} + +// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. +func (o *WafConfig) SetAllowedHttpMethods(v []string) { + o.AllowedHttpMethods = v +} + +// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedHttpVersions() []string { + if o == nil || IsNil(o.AllowedHttpVersions) { + var ret []string + return ret + } + return o.AllowedHttpVersions +} + +// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedHttpVersionsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpVersions) { + return nil, false + } + return o.AllowedHttpVersions, true +} + +// HasAllowedHttpVersions returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedHttpVersions() bool { + if o != nil && !IsNil(o.AllowedHttpVersions) { + return true + } + + return false +} + +// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. +func (o *WafConfig) SetAllowedHttpVersions(v []string) { + o.AllowedHttpVersions = v +} + +// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedRequestContentTypes() []string { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + var ret []string + return ret + } + return o.AllowedRequestContentTypes +} + +// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedRequestContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + return nil, false + } + return o.AllowedRequestContentTypes, true +} + +// HasAllowedRequestContentTypes returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedRequestContentTypes() bool { + if o != nil && !IsNil(o.AllowedRequestContentTypes) { + return true + } + + return false +} + +// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. +func (o *WafConfig) SetAllowedRequestContentTypes(v []string) { + o.AllowedRequestContentTypes = v +} + +// GetDisabledRuleCollectionIds returns the DisabledRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfig) GetDisabledRuleCollectionIds() []string { + if o == nil || IsNil(o.DisabledRuleCollectionIds) { + var ret []string + return ret + } + return o.DisabledRuleCollectionIds +} + +// GetDisabledRuleCollectionIdsOk returns a tuple with the DisabledRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetDisabledRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleCollectionIds) { + return nil, false + } + return o.DisabledRuleCollectionIds, true +} + +// HasDisabledRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfig) HasDisabledRuleCollectionIds() bool { + if o != nil && !IsNil(o.DisabledRuleCollectionIds) { + return true + } + + return false +} + +// SetDisabledRuleCollectionIds gets a reference to the given []string and assigns it to the DisabledRuleCollectionIds field. +func (o *WafConfig) SetDisabledRuleCollectionIds(v []string) { + o.DisabledRuleCollectionIds = v +} + +// GetDisabledRuleGroupIds returns the DisabledRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfig) GetDisabledRuleGroupIds() []string { + if o == nil || IsNil(o.DisabledRuleGroupIds) { + var ret []string + return ret + } + return o.DisabledRuleGroupIds +} + +// GetDisabledRuleGroupIdsOk returns a tuple with the DisabledRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetDisabledRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleGroupIds) { + return nil, false + } + return o.DisabledRuleGroupIds, true +} + +// HasDisabledRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfig) HasDisabledRuleGroupIds() bool { + if o != nil && !IsNil(o.DisabledRuleGroupIds) { + return true + } + + return false +} + +// SetDisabledRuleGroupIds gets a reference to the given []string and assigns it to the DisabledRuleGroupIds field. +func (o *WafConfig) SetDisabledRuleGroupIds(v []string) { + o.DisabledRuleGroupIds = v +} + +// GetDisabledRuleIds returns the DisabledRuleIds field value if set, zero value otherwise. +func (o *WafConfig) GetDisabledRuleIds() []string { + if o == nil || IsNil(o.DisabledRuleIds) { + var ret []string + return ret + } + return o.DisabledRuleIds +} + +// GetDisabledRuleIdsOk returns a tuple with the DisabledRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetDisabledRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleIds) { + return nil, false + } + return o.DisabledRuleIds, true +} + +// HasDisabledRuleIds returns a boolean if a field has been set. +func (o *WafConfig) HasDisabledRuleIds() bool { + if o != nil && !IsNil(o.DisabledRuleIds) { + return true + } + + return false +} + +// SetDisabledRuleIds gets a reference to the given []string and assigns it to the DisabledRuleIds field. +func (o *WafConfig) SetDisabledRuleIds(v []string) { + o.DisabledRuleIds = v +} + +// GetEnabledRuleCollectionIds returns the EnabledRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfig) GetEnabledRuleCollectionIds() []string { + if o == nil || IsNil(o.EnabledRuleCollectionIds) { + var ret []string + return ret + } + return o.EnabledRuleCollectionIds +} + +// GetEnabledRuleCollectionIdsOk returns a tuple with the EnabledRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetEnabledRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleCollectionIds) { + return nil, false + } + return o.EnabledRuleCollectionIds, true +} + +// HasEnabledRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfig) HasEnabledRuleCollectionIds() bool { + if o != nil && !IsNil(o.EnabledRuleCollectionIds) { + return true + } + + return false +} + +// SetEnabledRuleCollectionIds gets a reference to the given []string and assigns it to the EnabledRuleCollectionIds field. +func (o *WafConfig) SetEnabledRuleCollectionIds(v []string) { + o.EnabledRuleCollectionIds = v +} + +// GetEnabledRuleGroupIds returns the EnabledRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfig) GetEnabledRuleGroupIds() []string { + if o == nil || IsNil(o.EnabledRuleGroupIds) { + var ret []string + return ret + } + return o.EnabledRuleGroupIds +} + +// GetEnabledRuleGroupIdsOk returns a tuple with the EnabledRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetEnabledRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleGroupIds) { + return nil, false + } + return o.EnabledRuleGroupIds, true +} + +// HasEnabledRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfig) HasEnabledRuleGroupIds() bool { + if o != nil && !IsNil(o.EnabledRuleGroupIds) { + return true + } + + return false +} + +// SetEnabledRuleGroupIds gets a reference to the given []string and assigns it to the EnabledRuleGroupIds field. +func (o *WafConfig) SetEnabledRuleGroupIds(v []string) { + o.EnabledRuleGroupIds = v +} + +// GetEnabledRuleIds returns the EnabledRuleIds field value +func (o *WafConfig) GetEnabledRuleIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.EnabledRuleIds +} + +// GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetEnabledRuleIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.EnabledRuleIds, true +} + +// SetEnabledRuleIds sets field value +func (o *WafConfig) SetEnabledRuleIds(v []string) { + o.EnabledRuleIds = v +} + +// GetLogOnlyRuleCollectionIds returns the LogOnlyRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfig) GetLogOnlyRuleCollectionIds() []string { + if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { + var ret []string + return ret + } + return o.LogOnlyRuleCollectionIds +} + +// GetLogOnlyRuleCollectionIdsOk returns a tuple with the LogOnlyRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetLogOnlyRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { + return nil, false + } + return o.LogOnlyRuleCollectionIds, true +} + +// HasLogOnlyRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfig) HasLogOnlyRuleCollectionIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleCollectionIds) { + return true + } + + return false +} + +// SetLogOnlyRuleCollectionIds gets a reference to the given []string and assigns it to the LogOnlyRuleCollectionIds field. +func (o *WafConfig) SetLogOnlyRuleCollectionIds(v []string) { + o.LogOnlyRuleCollectionIds = v +} + +// GetLogOnlyRuleGroupIds returns the LogOnlyRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfig) GetLogOnlyRuleGroupIds() []string { + if o == nil || IsNil(o.LogOnlyRuleGroupIds) { + var ret []string + return ret + } + return o.LogOnlyRuleGroupIds +} + +// GetLogOnlyRuleGroupIdsOk returns a tuple with the LogOnlyRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetLogOnlyRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleGroupIds) { + return nil, false + } + return o.LogOnlyRuleGroupIds, true +} + +// HasLogOnlyRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfig) HasLogOnlyRuleGroupIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleGroupIds) { + return true + } + + return false +} + +// SetLogOnlyRuleGroupIds gets a reference to the given []string and assigns it to the LogOnlyRuleGroupIds field. +func (o *WafConfig) SetLogOnlyRuleGroupIds(v []string) { + o.LogOnlyRuleGroupIds = v +} + +// GetLogOnlyRuleIds returns the LogOnlyRuleIds field value if set, zero value otherwise. +func (o *WafConfig) GetLogOnlyRuleIds() []string { + if o == nil || IsNil(o.LogOnlyRuleIds) { + var ret []string + return ret + } + return o.LogOnlyRuleIds +} + +// GetLogOnlyRuleIdsOk returns a tuple with the LogOnlyRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetLogOnlyRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleIds) { + return nil, false + } + return o.LogOnlyRuleIds, true +} + +// HasLogOnlyRuleIds returns a boolean if a field has been set. +func (o *WafConfig) HasLogOnlyRuleIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleIds) { + return true + } + + return false +} + +// SetLogOnlyRuleIds gets a reference to the given []string and assigns it to the LogOnlyRuleIds field. +func (o *WafConfig) SetLogOnlyRuleIds(v []string) { + o.LogOnlyRuleIds = v +} + +// GetMode returns the Mode field value +func (o *WafConfig) GetMode() WafMode { + if o == nil { + var ret WafMode + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetModeOk() (*WafMode, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *WafConfig) SetMode(v WafMode) { + o.Mode = v +} + +// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. +func (o *WafConfig) GetParanoiaLevel() WafParanoiaLevel { + if o == nil || IsNil(o.ParanoiaLevel) { + var ret WafParanoiaLevel + return ret + } + return *o.ParanoiaLevel +} + +// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { + if o == nil || IsNil(o.ParanoiaLevel) { + return nil, false + } + return o.ParanoiaLevel, true +} + +// HasParanoiaLevel returns a boolean if a field has been set. +func (o *WafConfig) HasParanoiaLevel() bool { + if o != nil && !IsNil(o.ParanoiaLevel) { + return true + } + + return false +} + +// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. +func (o *WafConfig) SetParanoiaLevel(v WafParanoiaLevel) { + o.ParanoiaLevel = &v +} + +// GetType returns the Type field value +func (o *WafConfig) GetType() WafType { + if o == nil { + var ret WafType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetTypeOk() (*WafType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafConfig) SetType(v WafType) { + o.Type = v +} + +func (o WafConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedHttpMethods) { + toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods + } + if !IsNil(o.AllowedHttpVersions) { + toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions + } + if !IsNil(o.AllowedRequestContentTypes) { + toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes + } + if !IsNil(o.DisabledRuleCollectionIds) { + toSerialize["disabledRuleCollectionIds"] = o.DisabledRuleCollectionIds + } + if !IsNil(o.DisabledRuleGroupIds) { + toSerialize["disabledRuleGroupIds"] = o.DisabledRuleGroupIds + } + if !IsNil(o.DisabledRuleIds) { + toSerialize["disabledRuleIds"] = o.DisabledRuleIds + } + if !IsNil(o.EnabledRuleCollectionIds) { + toSerialize["enabledRuleCollectionIds"] = o.EnabledRuleCollectionIds + } + if !IsNil(o.EnabledRuleGroupIds) { + toSerialize["enabledRuleGroupIds"] = o.EnabledRuleGroupIds + } + toSerialize["enabledRuleIds"] = o.EnabledRuleIds + if !IsNil(o.LogOnlyRuleCollectionIds) { + toSerialize["logOnlyRuleCollectionIds"] = o.LogOnlyRuleCollectionIds + } + if !IsNil(o.LogOnlyRuleGroupIds) { + toSerialize["logOnlyRuleGroupIds"] = o.LogOnlyRuleGroupIds + } + if !IsNil(o.LogOnlyRuleIds) { + toSerialize["logOnlyRuleIds"] = o.LogOnlyRuleIds + } + toSerialize["mode"] = o.Mode + if !IsNil(o.ParanoiaLevel) { + toSerialize["paranoiaLevel"] = o.ParanoiaLevel + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabledRuleIds", + "mode", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafConfig := _WafConfig{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafConfig) + + if err != nil { + return err + } + + *o = WafConfig(varWafConfig) + + return err +} + +type NullableWafConfig struct { + value *WafConfig + isSet bool +} + +func (v NullableWafConfig) Get() *WafConfig { + return v.value +} + +func (v *NullableWafConfig) Set(val *WafConfig) { + v.value = val + v.isSet = true +} + +func (v NullableWafConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableWafConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafConfig(val *WafConfig) *NullableWafConfig { + return &NullableWafConfig{value: val, isSet: true} +} + +func (v NullableWafConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_config_patch.go b/services/cdn/v1api/model_waf_config_patch.go new file mode 100644 index 000000000..5158dc33b --- /dev/null +++ b/services/cdn/v1api/model_waf_config_patch.go @@ -0,0 +1,637 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the WafConfigPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafConfigPatch{} + +// WafConfigPatch Modify the WAF Configuration ## WAF Rules You can modify the set of enabled, disabled and log-only Rules by modifying these 9 properties: - enabledRuleIds - disabledRuleIds - logOnlyRuleIds - enabledRuleGroupIds - disabledRuleGroupIds - logOnlyRuleGroupIds - enabledRuleCollectionIds - disabledRuleCollectionIds - logOnlyRuleCollectionIds Please inquire the `WafConfig` Description on how the effective configuration is determined. For patching, if an ID is already used in one of the properties, it will be removed (and effectively moved) to the new property. If patching multiple properties with the same ID (e.g. writing `@builtin/crs/response` to `logOnlyRuleCollectionIds` and `enabledRuleCollectionIds`), the request will be rejected with a 400. +type WafConfigPatch struct { + AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` + AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` + AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` + // Ids of WAF Collections to mark as disabled + DisabledRuleCollectionIds []string `json:"disabledRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as disabled + DisabledRuleGroupIds []string `json:"disabledRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** disabled for this distribution. + DisabledRuleIds []string `json:"disabledRuleIds,omitempty"` + // Ids of WAF Collections to mark as enabled + EnabledRuleCollectionIds []string `json:"enabledRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as enabled + EnabledRuleGroupIds []string `json:"enabledRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** enabled for this distribution. + EnabledRuleIds []string `json:"enabledRuleIds,omitempty"` + // Ids of WAF Collections to mark as log Only. + LogOnlyRuleCollectionIds []string `json:"logOnlyRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as log Only. + LogOnlyRuleGroupIds []string `json:"logOnlyRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** marked as Log Only for this distribution. + LogOnlyRuleIds []string `json:"logOnlyRuleIds,omitempty"` + Mode *WafMode `json:"mode,omitempty"` + ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` + Type *WafType `json:"type,omitempty"` +} + +// NewWafConfigPatch instantiates a new WafConfigPatch 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 NewWafConfigPatch() *WafConfigPatch { + this := WafConfigPatch{} + return &this +} + +// NewWafConfigPatchWithDefaults instantiates a new WafConfigPatch 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 NewWafConfigPatchWithDefaults() *WafConfigPatch { + this := WafConfigPatch{} + return &this +} + +// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedHttpMethods() []string { + if o == nil || IsNil(o.AllowedHttpMethods) { + var ret []string + return ret + } + return o.AllowedHttpMethods +} + +// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedHttpMethodsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpMethods) { + return nil, false + } + return o.AllowedHttpMethods, true +} + +// HasAllowedHttpMethods returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedHttpMethods() bool { + if o != nil && !IsNil(o.AllowedHttpMethods) { + return true + } + + return false +} + +// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. +func (o *WafConfigPatch) SetAllowedHttpMethods(v []string) { + o.AllowedHttpMethods = v +} + +// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedHttpVersions() []string { + if o == nil || IsNil(o.AllowedHttpVersions) { + var ret []string + return ret + } + return o.AllowedHttpVersions +} + +// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedHttpVersionsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpVersions) { + return nil, false + } + return o.AllowedHttpVersions, true +} + +// HasAllowedHttpVersions returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedHttpVersions() bool { + if o != nil && !IsNil(o.AllowedHttpVersions) { + return true + } + + return false +} + +// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. +func (o *WafConfigPatch) SetAllowedHttpVersions(v []string) { + o.AllowedHttpVersions = v +} + +// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedRequestContentTypes() []string { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + var ret []string + return ret + } + return o.AllowedRequestContentTypes +} + +// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedRequestContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + return nil, false + } + return o.AllowedRequestContentTypes, true +} + +// HasAllowedRequestContentTypes returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedRequestContentTypes() bool { + if o != nil && !IsNil(o.AllowedRequestContentTypes) { + return true + } + + return false +} + +// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. +func (o *WafConfigPatch) SetAllowedRequestContentTypes(v []string) { + o.AllowedRequestContentTypes = v +} + +// GetDisabledRuleCollectionIds returns the DisabledRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetDisabledRuleCollectionIds() []string { + if o == nil || IsNil(o.DisabledRuleCollectionIds) { + var ret []string + return ret + } + return o.DisabledRuleCollectionIds +} + +// GetDisabledRuleCollectionIdsOk returns a tuple with the DisabledRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetDisabledRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleCollectionIds) { + return nil, false + } + return o.DisabledRuleCollectionIds, true +} + +// HasDisabledRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasDisabledRuleCollectionIds() bool { + if o != nil && !IsNil(o.DisabledRuleCollectionIds) { + return true + } + + return false +} + +// SetDisabledRuleCollectionIds gets a reference to the given []string and assigns it to the DisabledRuleCollectionIds field. +func (o *WafConfigPatch) SetDisabledRuleCollectionIds(v []string) { + o.DisabledRuleCollectionIds = v +} + +// GetDisabledRuleGroupIds returns the DisabledRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetDisabledRuleGroupIds() []string { + if o == nil || IsNil(o.DisabledRuleGroupIds) { + var ret []string + return ret + } + return o.DisabledRuleGroupIds +} + +// GetDisabledRuleGroupIdsOk returns a tuple with the DisabledRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetDisabledRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleGroupIds) { + return nil, false + } + return o.DisabledRuleGroupIds, true +} + +// HasDisabledRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasDisabledRuleGroupIds() bool { + if o != nil && !IsNil(o.DisabledRuleGroupIds) { + return true + } + + return false +} + +// SetDisabledRuleGroupIds gets a reference to the given []string and assigns it to the DisabledRuleGroupIds field. +func (o *WafConfigPatch) SetDisabledRuleGroupIds(v []string) { + o.DisabledRuleGroupIds = v +} + +// GetDisabledRuleIds returns the DisabledRuleIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetDisabledRuleIds() []string { + if o == nil || IsNil(o.DisabledRuleIds) { + var ret []string + return ret + } + return o.DisabledRuleIds +} + +// GetDisabledRuleIdsOk returns a tuple with the DisabledRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetDisabledRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleIds) { + return nil, false + } + return o.DisabledRuleIds, true +} + +// HasDisabledRuleIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasDisabledRuleIds() bool { + if o != nil && !IsNil(o.DisabledRuleIds) { + return true + } + + return false +} + +// SetDisabledRuleIds gets a reference to the given []string and assigns it to the DisabledRuleIds field. +func (o *WafConfigPatch) SetDisabledRuleIds(v []string) { + o.DisabledRuleIds = v +} + +// GetEnabledRuleCollectionIds returns the EnabledRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetEnabledRuleCollectionIds() []string { + if o == nil || IsNil(o.EnabledRuleCollectionIds) { + var ret []string + return ret + } + return o.EnabledRuleCollectionIds +} + +// GetEnabledRuleCollectionIdsOk returns a tuple with the EnabledRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetEnabledRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleCollectionIds) { + return nil, false + } + return o.EnabledRuleCollectionIds, true +} + +// HasEnabledRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasEnabledRuleCollectionIds() bool { + if o != nil && !IsNil(o.EnabledRuleCollectionIds) { + return true + } + + return false +} + +// SetEnabledRuleCollectionIds gets a reference to the given []string and assigns it to the EnabledRuleCollectionIds field. +func (o *WafConfigPatch) SetEnabledRuleCollectionIds(v []string) { + o.EnabledRuleCollectionIds = v +} + +// GetEnabledRuleGroupIds returns the EnabledRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetEnabledRuleGroupIds() []string { + if o == nil || IsNil(o.EnabledRuleGroupIds) { + var ret []string + return ret + } + return o.EnabledRuleGroupIds +} + +// GetEnabledRuleGroupIdsOk returns a tuple with the EnabledRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetEnabledRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleGroupIds) { + return nil, false + } + return o.EnabledRuleGroupIds, true +} + +// HasEnabledRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasEnabledRuleGroupIds() bool { + if o != nil && !IsNil(o.EnabledRuleGroupIds) { + return true + } + + return false +} + +// SetEnabledRuleGroupIds gets a reference to the given []string and assigns it to the EnabledRuleGroupIds field. +func (o *WafConfigPatch) SetEnabledRuleGroupIds(v []string) { + o.EnabledRuleGroupIds = v +} + +// GetEnabledRuleIds returns the EnabledRuleIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetEnabledRuleIds() []string { + if o == nil || IsNil(o.EnabledRuleIds) { + var ret []string + return ret + } + return o.EnabledRuleIds +} + +// GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetEnabledRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleIds) { + return nil, false + } + return o.EnabledRuleIds, true +} + +// HasEnabledRuleIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasEnabledRuleIds() bool { + if o != nil && !IsNil(o.EnabledRuleIds) { + return true + } + + return false +} + +// SetEnabledRuleIds gets a reference to the given []string and assigns it to the EnabledRuleIds field. +func (o *WafConfigPatch) SetEnabledRuleIds(v []string) { + o.EnabledRuleIds = v +} + +// GetLogOnlyRuleCollectionIds returns the LogOnlyRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetLogOnlyRuleCollectionIds() []string { + if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { + var ret []string + return ret + } + return o.LogOnlyRuleCollectionIds +} + +// GetLogOnlyRuleCollectionIdsOk returns a tuple with the LogOnlyRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetLogOnlyRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { + return nil, false + } + return o.LogOnlyRuleCollectionIds, true +} + +// HasLogOnlyRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasLogOnlyRuleCollectionIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleCollectionIds) { + return true + } + + return false +} + +// SetLogOnlyRuleCollectionIds gets a reference to the given []string and assigns it to the LogOnlyRuleCollectionIds field. +func (o *WafConfigPatch) SetLogOnlyRuleCollectionIds(v []string) { + o.LogOnlyRuleCollectionIds = v +} + +// GetLogOnlyRuleGroupIds returns the LogOnlyRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetLogOnlyRuleGroupIds() []string { + if o == nil || IsNil(o.LogOnlyRuleGroupIds) { + var ret []string + return ret + } + return o.LogOnlyRuleGroupIds +} + +// GetLogOnlyRuleGroupIdsOk returns a tuple with the LogOnlyRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetLogOnlyRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleGroupIds) { + return nil, false + } + return o.LogOnlyRuleGroupIds, true +} + +// HasLogOnlyRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasLogOnlyRuleGroupIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleGroupIds) { + return true + } + + return false +} + +// SetLogOnlyRuleGroupIds gets a reference to the given []string and assigns it to the LogOnlyRuleGroupIds field. +func (o *WafConfigPatch) SetLogOnlyRuleGroupIds(v []string) { + o.LogOnlyRuleGroupIds = v +} + +// GetLogOnlyRuleIds returns the LogOnlyRuleIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetLogOnlyRuleIds() []string { + if o == nil || IsNil(o.LogOnlyRuleIds) { + var ret []string + return ret + } + return o.LogOnlyRuleIds +} + +// GetLogOnlyRuleIdsOk returns a tuple with the LogOnlyRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetLogOnlyRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleIds) { + return nil, false + } + return o.LogOnlyRuleIds, true +} + +// HasLogOnlyRuleIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasLogOnlyRuleIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleIds) { + return true + } + + return false +} + +// SetLogOnlyRuleIds gets a reference to the given []string and assigns it to the LogOnlyRuleIds field. +func (o *WafConfigPatch) SetLogOnlyRuleIds(v []string) { + o.LogOnlyRuleIds = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *WafConfigPatch) GetMode() WafMode { + if o == nil || IsNil(o.Mode) { + var ret WafMode + 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 *WafConfigPatch) GetModeOk() (*WafMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *WafConfigPatch) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given WafMode and assigns it to the Mode field. +func (o *WafConfigPatch) SetMode(v WafMode) { + o.Mode = &v +} + +// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. +func (o *WafConfigPatch) GetParanoiaLevel() WafParanoiaLevel { + if o == nil || IsNil(o.ParanoiaLevel) { + var ret WafParanoiaLevel + return ret + } + return *o.ParanoiaLevel +} + +// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { + if o == nil || IsNil(o.ParanoiaLevel) { + return nil, false + } + return o.ParanoiaLevel, true +} + +// HasParanoiaLevel returns a boolean if a field has been set. +func (o *WafConfigPatch) HasParanoiaLevel() bool { + if o != nil && !IsNil(o.ParanoiaLevel) { + return true + } + + return false +} + +// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. +func (o *WafConfigPatch) SetParanoiaLevel(v WafParanoiaLevel) { + o.ParanoiaLevel = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WafConfigPatch) GetType() WafType { + if o == nil || IsNil(o.Type) { + var ret WafType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetTypeOk() (*WafType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WafConfigPatch) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given WafType and assigns it to the Type field. +func (o *WafConfigPatch) SetType(v WafType) { + o.Type = &v +} + +func (o WafConfigPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafConfigPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedHttpMethods) { + toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods + } + if !IsNil(o.AllowedHttpVersions) { + toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions + } + if !IsNil(o.AllowedRequestContentTypes) { + toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes + } + if !IsNil(o.DisabledRuleCollectionIds) { + toSerialize["disabledRuleCollectionIds"] = o.DisabledRuleCollectionIds + } + if !IsNil(o.DisabledRuleGroupIds) { + toSerialize["disabledRuleGroupIds"] = o.DisabledRuleGroupIds + } + if !IsNil(o.DisabledRuleIds) { + toSerialize["disabledRuleIds"] = o.DisabledRuleIds + } + if !IsNil(o.EnabledRuleCollectionIds) { + toSerialize["enabledRuleCollectionIds"] = o.EnabledRuleCollectionIds + } + if !IsNil(o.EnabledRuleGroupIds) { + toSerialize["enabledRuleGroupIds"] = o.EnabledRuleGroupIds + } + if !IsNil(o.EnabledRuleIds) { + toSerialize["enabledRuleIds"] = o.EnabledRuleIds + } + if !IsNil(o.LogOnlyRuleCollectionIds) { + toSerialize["logOnlyRuleCollectionIds"] = o.LogOnlyRuleCollectionIds + } + if !IsNil(o.LogOnlyRuleGroupIds) { + toSerialize["logOnlyRuleGroupIds"] = o.LogOnlyRuleGroupIds + } + if !IsNil(o.LogOnlyRuleIds) { + toSerialize["logOnlyRuleIds"] = o.LogOnlyRuleIds + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.ParanoiaLevel) { + toSerialize["paranoiaLevel"] = o.ParanoiaLevel + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableWafConfigPatch struct { + value *WafConfigPatch + isSet bool +} + +func (v NullableWafConfigPatch) Get() *WafConfigPatch { + return v.value +} + +func (v *NullableWafConfigPatch) Set(val *WafConfigPatch) { + v.value = val + v.isSet = true +} + +func (v NullableWafConfigPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableWafConfigPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafConfigPatch(val *WafConfigPatch) *NullableWafConfigPatch { + return &NullableWafConfigPatch{value: val, isSet: true} +} + +func (v NullableWafConfigPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafConfigPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_mode.go b/services/cdn/v1api/model_waf_mode.go new file mode 100644 index 000000000..c81e381e6 --- /dev/null +++ b/services/cdn/v1api/model_waf_mode.go @@ -0,0 +1,112 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// WafMode - `ENABLED`: The WAF actively inspects and blocks malicious requests. - `DISABLED`: The WAF is completely off. No inspection occurs. - `LOG_ONLY`: The WAF inspects requests and logs matches but never blocks. +type WafMode string + +// List of WafMode +const ( + WAFMODE_DISABLED WafMode = "DISABLED" + WAFMODE_ENABLED WafMode = "ENABLED" + WAFMODE_LOG_ONLY WafMode = "LOG_ONLY" +) + +// All allowed values of WafMode enum +var AllowedWafModeEnumValues = []WafMode{ + "DISABLED", + "ENABLED", + "LOG_ONLY", +} + +func (v *WafMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafMode(value) + for _, existing := range AllowedWafModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafMode", value) +} + +// NewWafModeFromValue returns a pointer to a valid WafMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafModeFromValue(v string) (*WafMode, error) { + ev := WafMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafMode: valid values are %v", v, AllowedWafModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafMode) IsValid() bool { + for _, existing := range AllowedWafModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafMode value +func (v WafMode) Ptr() *WafMode { + return &v +} + +type NullableWafMode struct { + value *WafMode + isSet bool +} + +func (v NullableWafMode) Get() *WafMode { + return v.value +} + +func (v *NullableWafMode) Set(val *WafMode) { + v.value = val + v.isSet = true +} + +func (v NullableWafMode) IsSet() bool { + return v.isSet +} + +func (v *NullableWafMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafMode(val *WafMode) *NullableWafMode { + return &NullableWafMode{value: val, isSet: true} +} + +func (v NullableWafMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_paranoia_level.go b/services/cdn/v1api/model_waf_paranoia_level.go new file mode 100644 index 000000000..6b81197d5 --- /dev/null +++ b/services/cdn/v1api/model_waf_paranoia_level.go @@ -0,0 +1,114 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// WafParanoiaLevel The paranoia level defines how aggressively the WAF should action on requests. It ranges from `L1` (least strict, lowest chance of false positives) to `L4` (most strict, highest chance of false positives). A higher paranoia level is more effective at catching attacks but can also block legitimate traffic. +type WafParanoiaLevel string + +// List of WafParanoiaLevel +const ( + WAFPARANOIALEVEL_L1 WafParanoiaLevel = "L1" + WAFPARANOIALEVEL_L2 WafParanoiaLevel = "L2" + WAFPARANOIALEVEL_L3 WafParanoiaLevel = "L3" + WAFPARANOIALEVEL_L4 WafParanoiaLevel = "L4" +) + +// All allowed values of WafParanoiaLevel enum +var AllowedWafParanoiaLevelEnumValues = []WafParanoiaLevel{ + "L1", + "L2", + "L3", + "L4", +} + +func (v *WafParanoiaLevel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafParanoiaLevel(value) + for _, existing := range AllowedWafParanoiaLevelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafParanoiaLevel", value) +} + +// NewWafParanoiaLevelFromValue returns a pointer to a valid WafParanoiaLevel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafParanoiaLevelFromValue(v string) (*WafParanoiaLevel, error) { + ev := WafParanoiaLevel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafParanoiaLevel: valid values are %v", v, AllowedWafParanoiaLevelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafParanoiaLevel) IsValid() bool { + for _, existing := range AllowedWafParanoiaLevelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafParanoiaLevel value +func (v WafParanoiaLevel) Ptr() *WafParanoiaLevel { + return &v +} + +type NullableWafParanoiaLevel struct { + value *WafParanoiaLevel + isSet bool +} + +func (v NullableWafParanoiaLevel) Get() *WafParanoiaLevel { + return v.value +} + +func (v *NullableWafParanoiaLevel) Set(val *WafParanoiaLevel) { + v.value = val + v.isSet = true +} + +func (v NullableWafParanoiaLevel) IsSet() bool { + return v.isSet +} + +func (v *NullableWafParanoiaLevel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafParanoiaLevel(val *WafParanoiaLevel) *NullableWafParanoiaLevel { + return &NullableWafParanoiaLevel{value: val, isSet: true} +} + +func (v NullableWafParanoiaLevel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafParanoiaLevel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_rule.go b/services/cdn/v1api/model_waf_rule.go new file mode 100644 index 000000000..b6d0d3b9f --- /dev/null +++ b/services/cdn/v1api/model_waf_rule.go @@ -0,0 +1,222 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafRule{} + +// WafRule struct for WafRule +type WafRule struct { + // Optional CoreRuleSet rule Id in case this is a CRS rule + Code *string `json:"code,omitempty"` + // LocalizedString is a map from language to string value + Description map[string]string `json:"description"` + Id string `json:"id"` +} + +type _WafRule WafRule + +// NewWafRule instantiates a new WafRule 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 NewWafRule(description map[string]string, id string) *WafRule { + this := WafRule{} + this.Description = description + this.Id = id + return &this +} + +// NewWafRuleWithDefaults instantiates a new WafRule 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 NewWafRuleWithDefaults() *WafRule { + this := WafRule{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *WafRule) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafRule) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *WafRule) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *WafRule) SetCode(v string) { + o.Code = &v +} + +// GetDescription returns the Description field value +func (o *WafRule) GetDescription() map[string]string { + if o == nil { + var ret map[string]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 *WafRule) GetDescriptionOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *WafRule) SetDescription(v map[string]string) { + o.Description = v +} + +// GetId returns the Id field value +func (o *WafRule) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WafRule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WafRule) SetId(v string) { + o.Id = v +} + +func (o WafRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + toSerialize["description"] = o.Description + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *WafRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafRule := _WafRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafRule) + + if err != nil { + return err + } + + *o = WafRule(varWafRule) + + return err +} + +type NullableWafRule struct { + value *WafRule + isSet bool +} + +func (v NullableWafRule) Get() *WafRule { + return v.value +} + +func (v *NullableWafRule) Set(val *WafRule) { + v.value = val + v.isSet = true +} + +func (v NullableWafRule) IsSet() bool { + return v.isSet +} + +func (v *NullableWafRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafRule(val *WafRule) *NullableWafRule { + return &NullableWafRule{value: val, isSet: true} +} + +func (v NullableWafRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_rule_action.go b/services/cdn/v1api/model_waf_rule_action.go new file mode 100644 index 000000000..7752a95a4 --- /dev/null +++ b/services/cdn/v1api/model_waf_rule_action.go @@ -0,0 +1,112 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// WAFRuleAction The action a WAF rule can take based on a request +type WAFRuleAction string + +// List of WAFRuleAction +const ( + WAFRULEACTION_BLOCKED WAFRuleAction = "BLOCKED" + WAFRULEACTION_LOGGED WAFRuleAction = "LOGGED" + WAFRULEACTION_ALLOWED WAFRuleAction = "ALLOWED" +) + +// All allowed values of WAFRuleAction enum +var AllowedWAFRuleActionEnumValues = []WAFRuleAction{ + "BLOCKED", + "LOGGED", + "ALLOWED", +} + +func (v *WAFRuleAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WAFRuleAction(value) + for _, existing := range AllowedWAFRuleActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WAFRuleAction", value) +} + +// NewWAFRuleActionFromValue returns a pointer to a valid WAFRuleAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWAFRuleActionFromValue(v string) (*WAFRuleAction, error) { + ev := WAFRuleAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WAFRuleAction: valid values are %v", v, AllowedWAFRuleActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WAFRuleAction) IsValid() bool { + for _, existing := range AllowedWAFRuleActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WAFRuleAction value +func (v WAFRuleAction) Ptr() *WAFRuleAction { + return &v +} + +type NullableWAFRuleAction struct { + value *WAFRuleAction + isSet bool +} + +func (v NullableWAFRuleAction) Get() *WAFRuleAction { + return v.value +} + +func (v *NullableWAFRuleAction) Set(val *WAFRuleAction) { + v.value = val + v.isSet = true +} + +func (v NullableWAFRuleAction) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFRuleAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFRuleAction(val *WAFRuleAction) *NullableWAFRuleAction { + return &NullableWAFRuleAction{value: val, isSet: true} +} + +func (v NullableWAFRuleAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFRuleAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_rule_collection.go b/services/cdn/v1api/model_waf_rule_collection.go new file mode 100644 index 000000000..a42f622cc --- /dev/null +++ b/services/cdn/v1api/model_waf_rule_collection.go @@ -0,0 +1,213 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafRuleCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafRuleCollection{} + +// WafRuleCollection struct for WafRuleCollection +type WafRuleCollection struct { + Groups []WafRuleGroup `json:"groups"` + Id string `json:"id"` + // LocalizedString is a map from language to string value + Name map[string]string `json:"name"` +} + +type _WafRuleCollection WafRuleCollection + +// NewWafRuleCollection instantiates a new WafRuleCollection 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 NewWafRuleCollection(groups []WafRuleGroup, id string, name map[string]string) *WafRuleCollection { + this := WafRuleCollection{} + this.Groups = groups + this.Id = id + this.Name = name + return &this +} + +// NewWafRuleCollectionWithDefaults instantiates a new WafRuleCollection 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 NewWafRuleCollectionWithDefaults() *WafRuleCollection { + this := WafRuleCollection{} + return &this +} + +// GetGroups returns the Groups field value +func (o *WafRuleCollection) GetGroups() []WafRuleGroup { + if o == nil { + var ret []WafRuleGroup + return ret + } + + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *WafRuleCollection) GetGroupsOk() ([]WafRuleGroup, bool) { + if o == nil { + return nil, false + } + return o.Groups, true +} + +// SetGroups sets field value +func (o *WafRuleCollection) SetGroups(v []WafRuleGroup) { + o.Groups = v +} + +// GetId returns the Id field value +func (o *WafRuleCollection) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WafRuleCollection) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WafRuleCollection) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *WafRuleCollection) GetName() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WafRuleCollection) GetNameOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WafRuleCollection) SetName(v map[string]string) { + o.Name = v +} + +func (o WafRuleCollection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafRuleCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["groups"] = o.Groups + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *WafRuleCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "groups", + "id", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafRuleCollection := _WafRuleCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafRuleCollection) + + if err != nil { + return err + } + + *o = WafRuleCollection(varWafRuleCollection) + + return err +} + +type NullableWafRuleCollection struct { + value *WafRuleCollection + isSet bool +} + +func (v NullableWafRuleCollection) Get() *WafRuleCollection { + return v.value +} + +func (v *NullableWafRuleCollection) Set(val *WafRuleCollection) { + v.value = val + v.isSet = true +} + +func (v NullableWafRuleCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableWafRuleCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafRuleCollection(val *WafRuleCollection) *NullableWafRuleCollection { + return &NullableWafRuleCollection{value: val, isSet: true} +} + +func (v NullableWafRuleCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafRuleCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_rule_group.go b/services/cdn/v1api/model_waf_rule_group.go new file mode 100644 index 000000000..d0e31e24a --- /dev/null +++ b/services/cdn/v1api/model_waf_rule_group.go @@ -0,0 +1,214 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafRuleGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafRuleGroup{} + +// WafRuleGroup struct for WafRuleGroup +type WafRuleGroup struct { + // LocalizedString is a map from language to string value + Description map[string]string `json:"description"` + // LocalizedString is a map from language to string value + Name map[string]string `json:"name"` + Rules []WafRule `json:"rules"` +} + +type _WafRuleGroup WafRuleGroup + +// NewWafRuleGroup instantiates a new WafRuleGroup 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 NewWafRuleGroup(description map[string]string, name map[string]string, rules []WafRule) *WafRuleGroup { + this := WafRuleGroup{} + this.Description = description + this.Name = name + this.Rules = rules + return &this +} + +// NewWafRuleGroupWithDefaults instantiates a new WafRuleGroup 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 NewWafRuleGroupWithDefaults() *WafRuleGroup { + this := WafRuleGroup{} + return &this +} + +// GetDescription returns the Description field value +func (o *WafRuleGroup) GetDescription() map[string]string { + if o == nil { + var ret map[string]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 *WafRuleGroup) GetDescriptionOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *WafRuleGroup) SetDescription(v map[string]string) { + o.Description = v +} + +// GetName returns the Name field value +func (o *WafRuleGroup) GetName() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WafRuleGroup) GetNameOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WafRuleGroup) SetName(v map[string]string) { + o.Name = v +} + +// GetRules returns the Rules field value +func (o *WafRuleGroup) GetRules() []WafRule { + if o == nil { + var ret []WafRule + return ret + } + + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value +// and a boolean to check if the value has been set. +func (o *WafRuleGroup) GetRulesOk() ([]WafRule, bool) { + if o == nil { + return nil, false + } + return o.Rules, true +} + +// SetRules sets field value +func (o *WafRuleGroup) SetRules(v []WafRule) { + o.Rules = v +} + +func (o WafRuleGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafRuleGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["name"] = o.Name + toSerialize["rules"] = o.Rules + return toSerialize, nil +} + +func (o *WafRuleGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "name", + "rules", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafRuleGroup := _WafRuleGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafRuleGroup) + + if err != nil { + return err + } + + *o = WafRuleGroup(varWafRuleGroup) + + return err +} + +type NullableWafRuleGroup struct { + value *WafRuleGroup + isSet bool +} + +func (v NullableWafRuleGroup) Get() *WafRuleGroup { + return v.value +} + +func (v *NullableWafRuleGroup) Set(val *WafRuleGroup) { + v.value = val + v.isSet = true +} + +func (v NullableWafRuleGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableWafRuleGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafRuleGroup(val *WafRuleGroup) *NullableWafRuleGroup { + return &NullableWafRuleGroup{value: val, isSet: true} +} + +func (v NullableWafRuleGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafRuleGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_status_rule_block.go b/services/cdn/v1api/model_waf_status_rule_block.go new file mode 100644 index 000000000..8f5e2be2f --- /dev/null +++ b/services/cdn/v1api/model_waf_status_rule_block.go @@ -0,0 +1,185 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlock type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlock{} + +// WafStatusRuleBlock struct for WafStatusRuleBlock +type WafStatusRuleBlock struct { + // Specifies the Id of the Rule. + Id string `json:"id"` + Reason WafStatusRuleBlockReason `json:"reason"` +} + +type _WafStatusRuleBlock WafStatusRuleBlock + +// NewWafStatusRuleBlock instantiates a new WafStatusRuleBlock 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 NewWafStatusRuleBlock(id string, reason WafStatusRuleBlockReason) *WafStatusRuleBlock { + this := WafStatusRuleBlock{} + this.Id = id + this.Reason = reason + return &this +} + +// NewWafStatusRuleBlockWithDefaults instantiates a new WafStatusRuleBlock 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 NewWafStatusRuleBlockWithDefaults() *WafStatusRuleBlock { + this := WafStatusRuleBlock{} + return &this +} + +// GetId returns the Id field value +func (o *WafStatusRuleBlock) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlock) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WafStatusRuleBlock) SetId(v string) { + o.Id = v +} + +// GetReason returns the Reason field value +func (o *WafStatusRuleBlock) GetReason() WafStatusRuleBlockReason { + if o == nil { + var ret WafStatusRuleBlockReason + return ret + } + + return o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlock) GetReasonOk() (*WafStatusRuleBlockReason, bool) { + if o == nil { + return nil, false + } + return &o.Reason, true +} + +// SetReason sets field value +func (o *WafStatusRuleBlock) SetReason(v WafStatusRuleBlockReason) { + o.Reason = v +} + +func (o WafStatusRuleBlock) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlock) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["reason"] = o.Reason + return toSerialize, nil +} + +func (o *WafStatusRuleBlock) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "reason", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlock := _WafStatusRuleBlock{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlock) + + if err != nil { + return err + } + + *o = WafStatusRuleBlock(varWafStatusRuleBlock) + + return err +} + +type NullableWafStatusRuleBlock struct { + value *WafStatusRuleBlock + isSet bool +} + +func (v NullableWafStatusRuleBlock) Get() *WafStatusRuleBlock { + return v.value +} + +func (v *NullableWafStatusRuleBlock) Set(val *WafStatusRuleBlock) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlock) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlock) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlock(val *WafStatusRuleBlock) *NullableWafStatusRuleBlock { + return &NullableWafStatusRuleBlock{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlock) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlock) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_status_rule_block_reason.go b/services/cdn/v1api/model_waf_status_rule_block_reason.go new file mode 100644 index 000000000..23d7b8956 --- /dev/null +++ b/services/cdn/v1api/model_waf_status_rule_block_reason.go @@ -0,0 +1,249 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// WafStatusRuleBlockReason - Defines the Reason why a Rule is in the specified state (set to be enabled, disabled or logOnly). +type WafStatusRuleBlockReason struct { + WafStatusRuleBlockReasonDirectlyDefined *WafStatusRuleBlockReasonDirectlyDefined + WafStatusRuleBlockReasonInheritedFromCollection *WafStatusRuleBlockReasonInheritedFromCollection + WafStatusRuleBlockReasonInheritedFromGroup *WafStatusRuleBlockReasonInheritedFromGroup + WafStatusRuleBlockReasonInvalidWafType *WafStatusRuleBlockReasonInvalidWafType + WafStatusRuleBlockReasonNeverDefined *WafStatusRuleBlockReasonNeverDefined +} + +// WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonDirectlyDefined wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonDirectlyDefined) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonDirectlyDefined: v, + } +} + +// WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInheritedFromCollection wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInheritedFromCollection) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonInheritedFromCollection: v, + } +} + +// WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInheritedFromGroup wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInheritedFromGroup) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonInheritedFromGroup: v, + } +} + +// WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInvalidWafType wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInvalidWafType) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonInvalidWafType: v, + } +} + +// WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonNeverDefined wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonNeverDefined) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonNeverDefined: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WafStatusRuleBlockReason) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'directlyDefined' + if jsonDict["type"] == "directlyDefined" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonDirectlyDefined + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonDirectlyDefined) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonDirectlyDefined, return on the first match + } else { + dst.WafStatusRuleBlockReasonDirectlyDefined = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonDirectlyDefined: %s", err.Error()) + } + } + + // check if the discriminator value is 'inheritedFromCollection' + if jsonDict["type"] == "inheritedFromCollection" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonInheritedFromCollection + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInheritedFromCollection) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonInheritedFromCollection, return on the first match + } else { + dst.WafStatusRuleBlockReasonInheritedFromCollection = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInheritedFromCollection: %s", err.Error()) + } + } + + // check if the discriminator value is 'inheritedFromGroup' + if jsonDict["type"] == "inheritedFromGroup" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonInheritedFromGroup + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInheritedFromGroup) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonInheritedFromGroup, return on the first match + } else { + dst.WafStatusRuleBlockReasonInheritedFromGroup = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInheritedFromGroup: %s", err.Error()) + } + } + + // check if the discriminator value is 'invalidWafType' + if jsonDict["type"] == "invalidWafType" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonInvalidWafType + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInvalidWafType) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonInvalidWafType, return on the first match + } else { + dst.WafStatusRuleBlockReasonInvalidWafType = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInvalidWafType: %s", err.Error()) + } + } + + // check if the discriminator value is 'neverDefined' + if jsonDict["type"] == "neverDefined" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonNeverDefined + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonNeverDefined) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonNeverDefined, return on the first match + } else { + dst.WafStatusRuleBlockReasonNeverDefined = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonNeverDefined: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { + if src.WafStatusRuleBlockReasonDirectlyDefined != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonDirectlyDefined) + } + + if src.WafStatusRuleBlockReasonInheritedFromCollection != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonInheritedFromCollection) + } + + if src.WafStatusRuleBlockReasonInheritedFromGroup != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonInheritedFromGroup) + } + + if src.WafStatusRuleBlockReasonInvalidWafType != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonInvalidWafType) + } + + if src.WafStatusRuleBlockReasonNeverDefined != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonNeverDefined) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WafStatusRuleBlockReason) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.WafStatusRuleBlockReasonDirectlyDefined != nil { + return obj.WafStatusRuleBlockReasonDirectlyDefined + } + + if obj.WafStatusRuleBlockReasonInheritedFromCollection != nil { + return obj.WafStatusRuleBlockReasonInheritedFromCollection + } + + if obj.WafStatusRuleBlockReasonInheritedFromGroup != nil { + return obj.WafStatusRuleBlockReasonInheritedFromGroup + } + + if obj.WafStatusRuleBlockReasonInvalidWafType != nil { + return obj.WafStatusRuleBlockReasonInvalidWafType + } + + if obj.WafStatusRuleBlockReasonNeverDefined != nil { + return obj.WafStatusRuleBlockReasonNeverDefined + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj WafStatusRuleBlockReason) GetActualInstanceValue() interface{} { + if obj.WafStatusRuleBlockReasonDirectlyDefined != nil { + return *obj.WafStatusRuleBlockReasonDirectlyDefined + } + + if obj.WafStatusRuleBlockReasonInheritedFromCollection != nil { + return *obj.WafStatusRuleBlockReasonInheritedFromCollection + } + + if obj.WafStatusRuleBlockReasonInheritedFromGroup != nil { + return *obj.WafStatusRuleBlockReasonInheritedFromGroup + } + + if obj.WafStatusRuleBlockReasonInvalidWafType != nil { + return *obj.WafStatusRuleBlockReasonInvalidWafType + } + + if obj.WafStatusRuleBlockReasonNeverDefined != nil { + return *obj.WafStatusRuleBlockReasonNeverDefined + } + + // all schemas are nil + return nil +} + +type NullableWafStatusRuleBlockReason struct { + value *WafStatusRuleBlockReason + isSet bool +} + +func (v NullableWafStatusRuleBlockReason) Get() *WafStatusRuleBlockReason { + return v.value +} + +func (v *NullableWafStatusRuleBlockReason) Set(val *WafStatusRuleBlockReason) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReason) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReason) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReason(val *WafStatusRuleBlockReason) *NullableWafStatusRuleBlockReason { + return &NullableWafStatusRuleBlockReason{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReason) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_status_rule_block_reason_directly_defined.go b/services/cdn/v1api/model_waf_status_rule_block_reason_directly_defined.go new file mode 100644 index 000000000..af97cf84c --- /dev/null +++ b/services/cdn/v1api/model_waf_status_rule_block_reason_directly_defined.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonDirectlyDefined type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonDirectlyDefined{} + +// WafStatusRuleBlockReasonDirectlyDefined struct for WafStatusRuleBlockReasonDirectlyDefined +type WafStatusRuleBlockReasonDirectlyDefined struct { + // This is always `directlyDefined` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonDirectlyDefined WafStatusRuleBlockReasonDirectlyDefined + +// NewWafStatusRuleBlockReasonDirectlyDefined instantiates a new WafStatusRuleBlockReasonDirectlyDefined 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 NewWafStatusRuleBlockReasonDirectlyDefined(types string) *WafStatusRuleBlockReasonDirectlyDefined { + this := WafStatusRuleBlockReasonDirectlyDefined{} + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonDirectlyDefinedWithDefaults instantiates a new WafStatusRuleBlockReasonDirectlyDefined 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 NewWafStatusRuleBlockReasonDirectlyDefinedWithDefaults() *WafStatusRuleBlockReasonDirectlyDefined { + this := WafStatusRuleBlockReasonDirectlyDefined{} + return &this +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonDirectlyDefined) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonDirectlyDefined) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonDirectlyDefined) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonDirectlyDefined) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonDirectlyDefined) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonDirectlyDefined) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonDirectlyDefined := _WafStatusRuleBlockReasonDirectlyDefined{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonDirectlyDefined) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonDirectlyDefined(varWafStatusRuleBlockReasonDirectlyDefined) + + return err +} + +type NullableWafStatusRuleBlockReasonDirectlyDefined struct { + value *WafStatusRuleBlockReasonDirectlyDefined + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonDirectlyDefined) Get() *WafStatusRuleBlockReasonDirectlyDefined { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) Set(val *WafStatusRuleBlockReasonDirectlyDefined) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonDirectlyDefined) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonDirectlyDefined(val *WafStatusRuleBlockReasonDirectlyDefined) *NullableWafStatusRuleBlockReasonDirectlyDefined { + return &NullableWafStatusRuleBlockReasonDirectlyDefined{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonDirectlyDefined) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_status_rule_block_reason_inherited_from_collection.go b/services/cdn/v1api/model_waf_status_rule_block_reason_inherited_from_collection.go new file mode 100644 index 000000000..75a154913 --- /dev/null +++ b/services/cdn/v1api/model_waf_status_rule_block_reason_inherited_from_collection.go @@ -0,0 +1,186 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonInheritedFromCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonInheritedFromCollection{} + +// WafStatusRuleBlockReasonInheritedFromCollection struct for WafStatusRuleBlockReasonInheritedFromCollection +type WafStatusRuleBlockReasonInheritedFromCollection struct { + // The Collection that caused this rule to be in its current state. + CollectionId string `json:"collectionId"` + // This is always `inheritedFromCollection` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonInheritedFromCollection WafStatusRuleBlockReasonInheritedFromCollection + +// NewWafStatusRuleBlockReasonInheritedFromCollection instantiates a new WafStatusRuleBlockReasonInheritedFromCollection 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 NewWafStatusRuleBlockReasonInheritedFromCollection(collectionId string, types string) *WafStatusRuleBlockReasonInheritedFromCollection { + this := WafStatusRuleBlockReasonInheritedFromCollection{} + this.CollectionId = collectionId + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonInheritedFromCollectionWithDefaults instantiates a new WafStatusRuleBlockReasonInheritedFromCollection 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 NewWafStatusRuleBlockReasonInheritedFromCollectionWithDefaults() *WafStatusRuleBlockReasonInheritedFromCollection { + this := WafStatusRuleBlockReasonInheritedFromCollection{} + return &this +} + +// GetCollectionId returns the CollectionId field value +func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionId() string { + if o == nil { + var ret string + return ret + } + + return o.CollectionId +} + +// GetCollectionIdOk returns a tuple with the CollectionId field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CollectionId, true +} + +// SetCollectionId sets field value +func (o *WafStatusRuleBlockReasonInheritedFromCollection) SetCollectionId(v string) { + o.CollectionId = v +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonInheritedFromCollection) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonInheritedFromCollection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonInheritedFromCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["collectionId"] = o.CollectionId + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonInheritedFromCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "collectionId", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonInheritedFromCollection := _WafStatusRuleBlockReasonInheritedFromCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonInheritedFromCollection) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonInheritedFromCollection(varWafStatusRuleBlockReasonInheritedFromCollection) + + return err +} + +type NullableWafStatusRuleBlockReasonInheritedFromCollection struct { + value *WafStatusRuleBlockReasonInheritedFromCollection + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) Get() *WafStatusRuleBlockReasonInheritedFromCollection { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) Set(val *WafStatusRuleBlockReasonInheritedFromCollection) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonInheritedFromCollection(val *WafStatusRuleBlockReasonInheritedFromCollection) *NullableWafStatusRuleBlockReasonInheritedFromCollection { + return &NullableWafStatusRuleBlockReasonInheritedFromCollection{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_status_rule_block_reason_inherited_from_group.go b/services/cdn/v1api/model_waf_status_rule_block_reason_inherited_from_group.go new file mode 100644 index 000000000..adde295c4 --- /dev/null +++ b/services/cdn/v1api/model_waf_status_rule_block_reason_inherited_from_group.go @@ -0,0 +1,186 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonInheritedFromGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonInheritedFromGroup{} + +// WafStatusRuleBlockReasonInheritedFromGroup struct for WafStatusRuleBlockReasonInheritedFromGroup +type WafStatusRuleBlockReasonInheritedFromGroup struct { + // The Group that caused this rule to be in its current state. + GroupId string `json:"groupId"` + // This is always `inheritedFromGroup` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonInheritedFromGroup WafStatusRuleBlockReasonInheritedFromGroup + +// NewWafStatusRuleBlockReasonInheritedFromGroup instantiates a new WafStatusRuleBlockReasonInheritedFromGroup 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 NewWafStatusRuleBlockReasonInheritedFromGroup(groupId string, types string) *WafStatusRuleBlockReasonInheritedFromGroup { + this := WafStatusRuleBlockReasonInheritedFromGroup{} + this.GroupId = groupId + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonInheritedFromGroupWithDefaults instantiates a new WafStatusRuleBlockReasonInheritedFromGroup 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 NewWafStatusRuleBlockReasonInheritedFromGroupWithDefaults() *WafStatusRuleBlockReasonInheritedFromGroup { + this := WafStatusRuleBlockReasonInheritedFromGroup{} + return &this +} + +// GetGroupId returns the GroupId field value +func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupId() string { + if o == nil { + var ret string + return ret + } + + return o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GroupId, true +} + +// SetGroupId sets field value +func (o *WafStatusRuleBlockReasonInheritedFromGroup) SetGroupId(v string) { + o.GroupId = v +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonInheritedFromGroup) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonInheritedFromGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonInheritedFromGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["groupId"] = o.GroupId + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonInheritedFromGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "groupId", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonInheritedFromGroup := _WafStatusRuleBlockReasonInheritedFromGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonInheritedFromGroup) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonInheritedFromGroup(varWafStatusRuleBlockReasonInheritedFromGroup) + + return err +} + +type NullableWafStatusRuleBlockReasonInheritedFromGroup struct { + value *WafStatusRuleBlockReasonInheritedFromGroup + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) Get() *WafStatusRuleBlockReasonInheritedFromGroup { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) Set(val *WafStatusRuleBlockReasonInheritedFromGroup) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonInheritedFromGroup(val *WafStatusRuleBlockReasonInheritedFromGroup) *NullableWafStatusRuleBlockReasonInheritedFromGroup { + return &NullableWafStatusRuleBlockReasonInheritedFromGroup{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_status_rule_block_reason_invalid_waf_type.go b/services/cdn/v1api/model_waf_status_rule_block_reason_invalid_waf_type.go new file mode 100644 index 000000000..58175ffc5 --- /dev/null +++ b/services/cdn/v1api/model_waf_status_rule_block_reason_invalid_waf_type.go @@ -0,0 +1,186 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonInvalidWafType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonInvalidWafType{} + +// WafStatusRuleBlockReasonInvalidWafType struct for WafStatusRuleBlockReasonInvalidWafType +type WafStatusRuleBlockReasonInvalidWafType struct { + // A list containing all WAF Types which can use this Rule. You must patch you WAF to one of these WAF Types to make use of this rule. Rules show up with this state if they would have been enabled or logOnly otherwise. + AllowedWafTypes []WafType `json:"allowedWafTypes"` + // This is always `invalidWafType` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonInvalidWafType WafStatusRuleBlockReasonInvalidWafType + +// NewWafStatusRuleBlockReasonInvalidWafType instantiates a new WafStatusRuleBlockReasonInvalidWafType 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 NewWafStatusRuleBlockReasonInvalidWafType(allowedWafTypes []WafType, types string) *WafStatusRuleBlockReasonInvalidWafType { + this := WafStatusRuleBlockReasonInvalidWafType{} + this.AllowedWafTypes = allowedWafTypes + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonInvalidWafTypeWithDefaults instantiates a new WafStatusRuleBlockReasonInvalidWafType 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 NewWafStatusRuleBlockReasonInvalidWafTypeWithDefaults() *WafStatusRuleBlockReasonInvalidWafType { + this := WafStatusRuleBlockReasonInvalidWafType{} + return &this +} + +// GetAllowedWafTypes returns the AllowedWafTypes field value +func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypes() []WafType { + if o == nil { + var ret []WafType + return ret + } + + return o.AllowedWafTypes +} + +// GetAllowedWafTypesOk returns a tuple with the AllowedWafTypes field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypesOk() ([]WafType, bool) { + if o == nil { + return nil, false + } + return o.AllowedWafTypes, true +} + +// SetAllowedWafTypes sets field value +func (o *WafStatusRuleBlockReasonInvalidWafType) SetAllowedWafTypes(v []WafType) { + o.AllowedWafTypes = v +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonInvalidWafType) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInvalidWafType) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonInvalidWafType) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonInvalidWafType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonInvalidWafType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["allowedWafTypes"] = o.AllowedWafTypes + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonInvalidWafType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "allowedWafTypes", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonInvalidWafType := _WafStatusRuleBlockReasonInvalidWafType{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonInvalidWafType) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonInvalidWafType(varWafStatusRuleBlockReasonInvalidWafType) + + return err +} + +type NullableWafStatusRuleBlockReasonInvalidWafType struct { + value *WafStatusRuleBlockReasonInvalidWafType + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonInvalidWafType) Get() *WafStatusRuleBlockReasonInvalidWafType { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonInvalidWafType) Set(val *WafStatusRuleBlockReasonInvalidWafType) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonInvalidWafType) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonInvalidWafType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonInvalidWafType(val *WafStatusRuleBlockReasonInvalidWafType) *NullableWafStatusRuleBlockReasonInvalidWafType { + return &NullableWafStatusRuleBlockReasonInvalidWafType{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonInvalidWafType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonInvalidWafType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_status_rule_block_reason_never_defined.go b/services/cdn/v1api/model_waf_status_rule_block_reason_never_defined.go new file mode 100644 index 000000000..088c2069d --- /dev/null +++ b/services/cdn/v1api/model_waf_status_rule_block_reason_never_defined.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonNeverDefined type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonNeverDefined{} + +// WafStatusRuleBlockReasonNeverDefined This object only ever shows up in the disabled rules section. If rules are never defined (e.g. no collection, rule group, or the rule itself is ever mentioned), they are implicitly disabled +type WafStatusRuleBlockReasonNeverDefined struct { + // This is always `neverDefined` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonNeverDefined WafStatusRuleBlockReasonNeverDefined + +// NewWafStatusRuleBlockReasonNeverDefined instantiates a new WafStatusRuleBlockReasonNeverDefined 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 NewWafStatusRuleBlockReasonNeverDefined(types string) *WafStatusRuleBlockReasonNeverDefined { + this := WafStatusRuleBlockReasonNeverDefined{} + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonNeverDefinedWithDefaults instantiates a new WafStatusRuleBlockReasonNeverDefined 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 NewWafStatusRuleBlockReasonNeverDefinedWithDefaults() *WafStatusRuleBlockReasonNeverDefined { + this := WafStatusRuleBlockReasonNeverDefined{} + return &this +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonNeverDefined) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonNeverDefined) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonNeverDefined) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonNeverDefined) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonNeverDefined) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonNeverDefined) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonNeverDefined := _WafStatusRuleBlockReasonNeverDefined{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonNeverDefined) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonNeverDefined(varWafStatusRuleBlockReasonNeverDefined) + + return err +} + +type NullableWafStatusRuleBlockReasonNeverDefined struct { + value *WafStatusRuleBlockReasonNeverDefined + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonNeverDefined) Get() *WafStatusRuleBlockReasonNeverDefined { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonNeverDefined) Set(val *WafStatusRuleBlockReasonNeverDefined) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonNeverDefined) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonNeverDefined) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonNeverDefined(val *WafStatusRuleBlockReasonNeverDefined) *NullableWafStatusRuleBlockReasonNeverDefined { + return &NullableWafStatusRuleBlockReasonNeverDefined{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonNeverDefined) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonNeverDefined) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_type.go b/services/cdn/v1api/model_waf_type.go new file mode 100644 index 000000000..922d0dc5c --- /dev/null +++ b/services/cdn/v1api/model_waf_type.go @@ -0,0 +1,110 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// WafType Enable or disable the Premium WAF. Do note that enabling the Premium WAF will cause additional fees. Some features are gated behind the Premium WAF, like additional, **premium-only rules** and the ability to create **custom rules** (not yet implemented) +type WafType string + +// List of WafType +const ( + WAFTYPE_FREE WafType = "FREE" + WAFTYPE_PREMIUM WafType = "PREMIUM" +) + +// All allowed values of WafType enum +var AllowedWafTypeEnumValues = []WafType{ + "FREE", + "PREMIUM", +} + +func (v *WafType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafType(value) + for _, existing := range AllowedWafTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafType", value) +} + +// NewWafTypeFromValue returns a pointer to a valid WafType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafTypeFromValue(v string) (*WafType, error) { + ev := WafType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafType: valid values are %v", v, AllowedWafTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafType) IsValid() bool { + for _, existing := range AllowedWafTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafType value +func (v WafType) Ptr() *WafType { + return &v +} + +type NullableWafType struct { + value *WafType + isSet bool +} + +func (v NullableWafType) Get() *WafType { + return v.value +} + +func (v *NullableWafType) Set(val *WafType) { + v.value = val + v.isSet = true +} + +func (v NullableWafType) IsSet() bool { + return v.isSet +} + +func (v *NullableWafType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafType(val *WafType) *NullableWafType { + return &NullableWafType{value: val, isSet: true} +} + +func (v NullableWafType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/model_waf_violation.go b/services/cdn/v1api/model_waf_violation.go new file mode 100644 index 000000000..c5fb04c97 --- /dev/null +++ b/services/cdn/v1api/model_waf_violation.go @@ -0,0 +1,300 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WAFViolation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFViolation{} + +// WAFViolation Information about a violated WAF rule in case the WAF is enabled and a rule was triggered (either in BLOCK or LOG_ONLY mode) +type WAFViolation struct { + Action WAFRuleAction `json:"action"` + // ASN for the request + Asn string `json:"asn"` + // Rule specific message explaining the violation + Message string `json:"message"` + // HTTP Method of the request that triggered the violation + Method string `json:"method"` + RequestHeaders map[string]string `json:"requestHeaders"` + // ID of the WAF rule that was triggered + RuleId string `json:"ruleId"` +} + +type _WAFViolation WAFViolation + +// NewWAFViolation instantiates a new WAFViolation 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 NewWAFViolation(action WAFRuleAction, asn string, message string, method string, requestHeaders map[string]string, ruleId string) *WAFViolation { + this := WAFViolation{} + this.Action = action + this.Asn = asn + this.Message = message + this.Method = method + this.RequestHeaders = requestHeaders + this.RuleId = ruleId + return &this +} + +// NewWAFViolationWithDefaults instantiates a new WAFViolation 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 NewWAFViolationWithDefaults() *WAFViolation { + this := WAFViolation{} + return &this +} + +// GetAction returns the Action field value +func (o *WAFViolation) GetAction() WAFRuleAction { + if o == nil { + var ret WAFRuleAction + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetActionOk() (*WAFRuleAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *WAFViolation) SetAction(v WAFRuleAction) { + o.Action = v +} + +// GetAsn returns the Asn field value +func (o *WAFViolation) GetAsn() string { + if o == nil { + var ret string + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetAsnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *WAFViolation) SetAsn(v string) { + o.Asn = v +} + +// GetMessage returns the Message field value +func (o *WAFViolation) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *WAFViolation) SetMessage(v string) { + o.Message = v +} + +// GetMethod returns the Method field value +func (o *WAFViolation) GetMethod() string { + if o == nil { + var ret string + return ret + } + + return o.Method +} + +// GetMethodOk returns a tuple with the Method field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Method, true +} + +// SetMethod sets field value +func (o *WAFViolation) SetMethod(v string) { + o.Method = v +} + +// GetRequestHeaders returns the RequestHeaders field value +func (o *WAFViolation) GetRequestHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.RequestHeaders +} + +// GetRequestHeadersOk returns a tuple with the RequestHeaders field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetRequestHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.RequestHeaders, true +} + +// SetRequestHeaders sets field value +func (o *WAFViolation) SetRequestHeaders(v map[string]string) { + o.RequestHeaders = v +} + +// GetRuleId returns the RuleId field value +func (o *WAFViolation) GetRuleId() string { + if o == nil { + var ret string + return ret + } + + return o.RuleId +} + +// GetRuleIdOk returns a tuple with the RuleId field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetRuleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RuleId, true +} + +// SetRuleId sets field value +func (o *WAFViolation) SetRuleId(v string) { + o.RuleId = v +} + +func (o WAFViolation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFViolation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["action"] = o.Action + toSerialize["asn"] = o.Asn + toSerialize["message"] = o.Message + toSerialize["method"] = o.Method + toSerialize["requestHeaders"] = o.RequestHeaders + toSerialize["ruleId"] = o.RuleId + return toSerialize, nil +} + +func (o *WAFViolation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "action", + "asn", + "message", + "method", + "requestHeaders", + "ruleId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWAFViolation := _WAFViolation{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWAFViolation) + + if err != nil { + return err + } + + *o = WAFViolation(varWAFViolation) + + return err +} + +type NullableWAFViolation struct { + value *WAFViolation + isSet bool +} + +func (v NullableWAFViolation) Get() *WAFViolation { + return v.value +} + +func (v *NullableWAFViolation) Set(val *WAFViolation) { + v.value = val + v.isSet = true +} + +func (v NullableWAFViolation) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFViolation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFViolation(val *WAFViolation) *NullableWAFViolation { + return &NullableWAFViolation{value: val, isSet: true} +} + +func (v NullableWAFViolation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFViolation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1api/response.go b/services/cdn/v1api/response.go new file mode 100644 index 000000000..097f7bfb9 --- /dev/null +++ b/services/cdn/v1api/response.go @@ -0,0 +1,47 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/cdn/v1api/utils.go b/services/cdn/v1api/utils.go new file mode 100644 index 000000000..5fc2645c6 --- /dev/null +++ b/services/cdn/v1api/utils.go @@ -0,0 +1,361 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/cdn/v1beta2api/api_default.go b/services/cdn/v1beta2api/api_default.go new file mode 100644 index 000000000..bcfc96768 --- /dev/null +++ b/services/cdn/v1beta2api/api_default.go @@ -0,0 +1,3150 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1beta2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateDistribution Create new distribution + + CreateDistribution will create a new CDN distribution + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiCreateDistributionRequest + */ + CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest + + // CreateDistributionExecute executes the request + // @return CreateDistributionResponse + CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) + + /* + DeleteCustomDomain Delete a custom domain + + Removes a custom domain + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiDeleteCustomDomainRequest + */ + DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest + + // DeleteCustomDomainExecute executes the request + // @return DeleteCustomDomainResponse + DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) + + /* + DeleteDistribution Delete distribution + + DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiDeleteDistributionRequest + */ + DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest + + // DeleteDistributionExecute executes the request + // @return DeleteDistributionResponse + DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) + + /* + FindCachePaths Return Paths that were purged + + This returns paths that are present in the cache purging history. + Only substrings of the provided input are returned. + The response is sorted in descending order by the most recent purge. + + So, assuming you have have the following purged for a distribution + - `/test/1` at `2025-01-01` + - `/test/2` at `2025-01-02` + - `/someOtherPath/1` at `2025-01-03` + - `/test/1` at `2025-01-04` + - `/test/3` at `2025-01-05`, + this would return the following paths, in the following order, assuming `/te` was the search parameter: + - `/test/3` + - `/test/1` + - `/test/2` + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiFindCachePathsRequest + */ + FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest + + // FindCachePathsExecute executes the request + // @return FindCachePathsResponse + FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) + + /* + GetCacheInfo Get Infos about the Caching State + + Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. + + If (and only if) you provide the path query parameter, the history will also contain granular cache purges. + The request will not fail if no data about a path is found. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetCacheInfoRequest + */ + GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest + + // GetCacheInfoExecute executes the request + // @return GetCacheInfoResponse + GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) + + /* + GetCustomDomain Retrieve a specific custom domain + + Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiGetCustomDomainRequest + */ + GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest + + // GetCustomDomainExecute executes the request + // @return GetCustomDomainResponse + GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) + + /* + GetDistribution Get distribution by Id + + This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetDistributionRequest + */ + GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest + + // GetDistributionExecute executes the request + // @return GetDistributionResponse + GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) + + /* + GetLogs Retrieve distribution logs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId Your CDN distribution Id + @return ApiGetLogsRequest + */ + GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest + + // GetLogsExecute executes the request + // @return GetLogsResponse + GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) + + /* + GetLogsSearchFilters Get relevant search filters for this distribution based on user input. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID. + @param distributionId Your CDN distribution ID. + @return ApiGetLogsSearchFiltersRequest + */ + GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest + + // GetLogsSearchFiltersExecute executes the request + // @return GetLogsSearchFiltersResponse + GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) + + /* + GetStatistics Retrieve the statistics of a distribution + + Returns the statistics of the distribution in the given + time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. + In case no statistics for a time interval exist, no record is returned. + The time range for which statistics should be returned can be configured using query parameters. + + Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. + + **Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. + + The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. + Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetStatisticsRequest + */ + GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest + + // GetStatisticsExecute executes the request + // @return GetStatisticsResponse + GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) + + /* + ListDistributions List all distributions belonging to a specific project + + ListDistributions returns a list of all CDN distributions associated with + a given project, ordered by their distribution Id. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiListDistributionsRequest + */ + ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest + + // ListDistributionsExecute executes the request + // @return ListDistributionsResponse + ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) + + /* + ListWafCollections List all WAF rule collections of the project + + Returns all WAF rule collections available to the project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiListWafCollectionsRequest + */ + ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest + + // ListWafCollectionsExecute executes the request + // @return ListWafCollectionsResponse + ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) + + /* + PatchDistribution Update existing distribution + + Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiPatchDistributionRequest + */ + PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest + + // PatchDistributionExecute executes the request + // @return PatchDistributionResponse + PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) + + /* + PurgeCache Clear distribution cache + + Clear the cache for this distribution. + All content, regardless of its staleness, will get refetched from the host. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiPurgeCacheRequest + */ + PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest + + // PurgeCacheExecute executes the request + // @return map[string]interface{} + PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) + + /* + PutCustomDomain Create or update a custom domain + + Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiPutCustomDomainRequest + */ + PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest + + // PutCustomDomainExecute executes the request + // @return PutCustomDomainResponse + PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createDistributionPayload *CreateDistributionPayload +} + +func (r ApiCreateDistributionRequest) CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest { + r.createDistributionPayload = &createDistributionPayload + return r +} + +func (r ApiCreateDistributionRequest) Execute() (*CreateDistributionResponse, error) { + return r.ApiService.CreateDistributionExecute(r) +} + +/* +CreateDistribution Create new distribution + +CreateDistribution will create a new CDN distribution + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiCreateDistributionRequest +*/ +func (a *DefaultAPIService) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { + return ApiCreateDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return CreateDistributionResponse +func (a *DefaultAPIService) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDistributionPayload == nil { + return localVarReturnValue, reportError("createDistributionPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createDistributionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string + intentId *string +} + +func (r ApiDeleteCustomDomainRequest) IntentId(intentId string) ApiDeleteCustomDomainRequest { + r.intentId = &intentId + return r +} + +func (r ApiDeleteCustomDomainRequest) Execute() (*DeleteCustomDomainResponse, error) { + return r.ApiService.DeleteCustomDomainExecute(r) +} + +/* +DeleteCustomDomain Delete a custom domain + +# Removes a custom domain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiDeleteCustomDomainRequest +*/ +func (a *DefaultAPIService) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { + return ApiDeleteCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return DeleteCustomDomainResponse +func (a *DefaultAPIService) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + if r.intentId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + intentId *string +} + +// While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. +func (r ApiDeleteDistributionRequest) IntentId(intentId string) ApiDeleteDistributionRequest { + r.intentId = &intentId + return r +} + +func (r ApiDeleteDistributionRequest) Execute() (*DeleteDistributionResponse, error) { + return r.ApiService.DeleteDistributionExecute(r) +} + +/* +DeleteDistribution Delete distribution + +DeleteDistribution accepts a project- and distribution-Id and will delete a distribution. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiDeleteDistributionRequest +*/ +func (a *DefaultAPIService) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { + return ApiDeleteDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return DeleteDistributionResponse +func (a *DefaultAPIService) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.intentId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiFindCachePathsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + path *string +} + +// A substring of the search query. +func (r ApiFindCachePathsRequest) Path(path string) ApiFindCachePathsRequest { + r.path = &path + return r +} + +func (r ApiFindCachePathsRequest) Execute() (*FindCachePathsResponse, error) { + return r.ApiService.FindCachePathsExecute(r) +} + +/* +FindCachePaths Return Paths that were purged + +This returns paths that are present in the cache purging history. +Only substrings of the provided input are returned. +The response is sorted in descending order by the most recent purge. + +So, assuming you have have the following purged for a distribution +- `/test/1` at `2025-01-01` +- `/test/2` at `2025-01-02` +- `/someOtherPath/1` at `2025-01-03` +- `/test/1` at `2025-01-04` +- `/test/3` at `2025-01-05`, +this would return the following paths, in the following order, assuming `/te` was the search parameter: +- `/test/3` +- `/test/1` +- `/test/2` + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiFindCachePathsRequest +*/ +func (a *DefaultAPIService) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { + return ApiFindCachePathsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return FindCachePathsResponse +func (a *DefaultAPIService) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindCachePathsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.FindCachePaths") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache/paths" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.path == nil { + return localVarReturnValue, reportError("path is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "path", r.path, "form", "") + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCacheInfoRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + purgePath *string +} + +func (r ApiGetCacheInfoRequest) PurgePath(purgePath string) ApiGetCacheInfoRequest { + r.purgePath = &purgePath + return r +} + +func (r ApiGetCacheInfoRequest) Execute() (*GetCacheInfoResponse, error) { + return r.ApiService.GetCacheInfoExecute(r) +} + +/* +GetCacheInfo Get Infos about the Caching State + +Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. + +If (and only if) you provide the path query parameter, the history will also contain granular cache purges. +The request will not fail if no data about a path is found. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetCacheInfoRequest +*/ +func (a *DefaultAPIService) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { + return ApiGetCacheInfoRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetCacheInfoResponse +func (a *DefaultAPIService) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCacheInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCacheInfo") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.purgePath != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "purgePath", r.purgePath, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string +} + +func (r ApiGetCustomDomainRequest) Execute() (*GetCustomDomainResponse, error) { + return r.ApiService.GetCustomDomainExecute(r) +} + +/* +GetCustomDomain Retrieve a specific custom domain + +# Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiGetCustomDomainRequest +*/ +func (a *DefaultAPIService) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { + return ApiGetCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return GetCustomDomainResponse +func (a *DefaultAPIService) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + withWafStatus *bool +} + +// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. +func (r ApiGetDistributionRequest) WithWafStatus(withWafStatus bool) ApiGetDistributionRequest { + r.withWafStatus = &withWafStatus + return r +} + +func (r ApiGetDistributionRequest) Execute() (*GetDistributionResponse, error) { + return r.ApiService.GetDistributionExecute(r) +} + +/* +GetDistribution Get distribution by Id + +This returns a specific distribution by its Id. If no distribution with the given Id exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetDistributionRequest +*/ +func (a *DefaultAPIService) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { + return ApiGetDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetDistributionResponse +func (a *DefaultAPIService) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.withWafStatus != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") + r.withWafStatus = &defaultValue + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetLogsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + from *time.Time + to *time.Time + pageSize *int32 + pageIdentifier *string + sortBy *string + sortOrder *string + wafAction *WAFRuleAction + dataCenterRegion *string + requestCountryCode *string + statusCode *int32 + cacheHit *bool +} + +// the start of the time range for which logs should be returned +func (r ApiGetLogsRequest) From(from time.Time) ApiGetLogsRequest { + r.from = &from + return r +} + +// the end of the time range for which logs should be returned. If not specified, \"now\" is used. +func (r ApiGetLogsRequest) To(to time.Time) ApiGetLogsRequest { + r.to = &to + return r +} + +// Quantifies how many log entries should be returned on this page. Must be a natural number between 1 and 1000 (inclusive) +func (r ApiGetLogsRequest) PageSize(pageSize int32) ApiGetLogsRequest { + r.pageSize = &pageSize + return r +} + +// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. +func (r ApiGetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsRequest { + r.pageIdentifier = &pageIdentifier + return r +} + +// Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` +func (r ApiGetLogsRequest) SortBy(sortBy string) ApiGetLogsRequest { + r.sortBy = &sortBy + return r +} + +func (r ApiGetLogsRequest) SortOrder(sortOrder string) ApiGetLogsRequest { + r.sortOrder = &sortOrder + return r +} + +// If this is set then only log entries with the chosen WAF rule action/outcome are returned. Specifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where a WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged but the request not blocked +func (r ApiGetLogsRequest) WafAction(wafAction WAFRuleAction) ApiGetLogsRequest { + r.wafAction = &wafAction + return r +} + +// Filters by the CDN data center region that served the request. Can be combined with other filters +func (r ApiGetLogsRequest) DataCenterRegion(dataCenterRegion string) ApiGetLogsRequest { + r.dataCenterRegion = &dataCenterRegion + return r +} + +// Filters by the originating country of the user request. Can be combined with other filters +func (r ApiGetLogsRequest) RequestCountryCode(requestCountryCode string) ApiGetLogsRequest { + r.requestCountryCode = &requestCountryCode + return r +} + +// Filters by the HTTP status code returned to the client. Can be combined with other filters +func (r ApiGetLogsRequest) StatusCode(statusCode int32) ApiGetLogsRequest { + r.statusCode = &statusCode + return r +} + +// Filters based on whether the request was served from the CDN cache. Can be combined with other filters +func (r ApiGetLogsRequest) CacheHit(cacheHit bool) ApiGetLogsRequest { + r.cacheHit = &cacheHit + return r +} + +func (r ApiGetLogsRequest) Execute() (*GetLogsResponse, error) { + return r.ApiService.GetLogsExecute(r) +} + +/* +GetLogs Retrieve distribution logs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId Your CDN distribution Id + @return ApiGetLogsRequest +*/ +func (a *DefaultAPIService) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { + return ApiGetLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetLogsResponse +func (a *DefaultAPIService) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetLogsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/logs" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.from != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + } + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } else { + var defaultValue int32 = 20 + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") + r.pageSize = &defaultValue + } + if r.pageIdentifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } else { + var defaultValue string = "timestamp" + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") + r.sortBy = &defaultValue + } + if r.sortOrder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") + } + if r.wafAction != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "wafAction", r.wafAction, "form", "") + } + if r.dataCenterRegion != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "dataCenterRegion", r.dataCenterRegion, "form", "") + } + if r.requestCountryCode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "requestCountryCode", r.requestCountryCode, "form", "") + } + if r.statusCode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "statusCode", r.statusCode, "form", "") + } + if r.cacheHit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cacheHit", r.cacheHit, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetLogsSearchFiltersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + filter *string +} + +// Optional search string. Will search the **values** for the text input. +func (r ApiGetLogsSearchFiltersRequest) Filter(filter string) ApiGetLogsSearchFiltersRequest { + r.filter = &filter + return r +} + +func (r ApiGetLogsSearchFiltersRequest) Execute() (*GetLogsSearchFiltersResponse, error) { + return r.ApiService.GetLogsSearchFiltersExecute(r) +} + +/* +GetLogsSearchFilters Get relevant search filters for this distribution based on user input. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID. + @param distributionId Your CDN distribution ID. + @return ApiGetLogsSearchFiltersRequest +*/ +func (a *DefaultAPIService) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { + return ApiGetLogsSearchFiltersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetLogsSearchFiltersResponse +func (a *DefaultAPIService) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetLogsSearchFiltersResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogsSearchFilters") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/logs/searchFilters" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetStatisticsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + from *time.Time + to *time.Time + interval *string +} + +// the start of the time range for which statistics should be returned +func (r ApiGetStatisticsRequest) From(from time.Time) ApiGetStatisticsRequest { + r.from = &from + return r +} + +// the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. +func (r ApiGetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { + r.to = &to + return r +} + +// Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` +func (r ApiGetStatisticsRequest) Interval(interval string) ApiGetStatisticsRequest { + r.interval = &interval + return r +} + +func (r ApiGetStatisticsRequest) Execute() (*GetStatisticsResponse, error) { + return r.ApiService.GetStatisticsExecute(r) +} + +/* +GetStatistics Retrieve the statistics of a distribution + +Returns the statistics of the distribution in the given +time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. +In case no statistics for a time interval exist, no record is returned. +The time range for which statistics should be returned can be configured using query parameters. + +Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. + +**Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. + +The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. +Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiGetStatisticsRequest +*/ +func (a *DefaultAPIService) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { + return ApiGetStatisticsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetStatisticsResponse +func (a *DefaultAPIService) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetStatisticsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetStatistics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/statistics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.from == nil { + return localVarReturnValue, reportError("from is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.interval != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval", r.interval, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDistributionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + pageSize *int32 + withWafStatus *bool + pageIdentifier *string + sortBy *string + sortOrder *string +} + +// Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) +func (r ApiListDistributionsRequest) PageSize(pageSize int32) ApiListDistributionsRequest { + r.pageSize = &pageSize + return r +} + +// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. +func (r ApiListDistributionsRequest) WithWafStatus(withWafStatus bool) ApiListDistributionsRequest { + r.withWafStatus = &withWafStatus + return r +} + +// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. +func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiListDistributionsRequest { + r.pageIdentifier = &pageIdentifier + return r +} + +// The following sort options exist. We default to `createdAt` - `id` - Sort by distribution Id using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originUrl using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The originUrl is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. +func (r ApiListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { + r.sortBy = &sortBy + return r +} + +func (r ApiListDistributionsRequest) SortOrder(sortOrder string) ApiListDistributionsRequest { + r.sortOrder = &sortOrder + return r +} + +func (r ApiListDistributionsRequest) Execute() (*ListDistributionsResponse, error) { + return r.ApiService.ListDistributionsExecute(r) +} + +/* +ListDistributions List all distributions belonging to a specific project + +ListDistributions returns a list of all CDN distributions associated with +a given project, ordered by their distribution Id. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiListDistributionsRequest +*/ +func (a *DefaultAPIService) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { + return ApiListDistributionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListDistributionsResponse +func (a *DefaultAPIService) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListDistributionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDistributions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } else { + var defaultValue int32 = 20 + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") + r.pageSize = &defaultValue + } + if r.withWafStatus != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") + r.withWafStatus = &defaultValue + } + if r.pageIdentifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } else { + var defaultValue string = "createdAt" + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") + r.sortBy = &defaultValue + } + if r.sortOrder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListWafCollectionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListWafCollectionsRequest) Execute() (*ListWafCollectionsResponse, error) { + return r.ApiService.ListWafCollectionsExecute(r) +} + +/* +ListWafCollections List all WAF rule collections of the project + +Returns all WAF rule collections available to the project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @return ApiListWafCollectionsRequest +*/ +func (a *DefaultAPIService) ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest { + return ApiListWafCollectionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListWafCollectionsResponse +func (a *DefaultAPIService) ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListWafCollectionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListWafCollections") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/waf/collections" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPatchDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + patchDistributionPayload *PatchDistributionPayload +} + +func (r ApiPatchDistributionRequest) PatchDistributionPayload(patchDistributionPayload PatchDistributionPayload) ApiPatchDistributionRequest { + r.patchDistributionPayload = &patchDistributionPayload + return r +} + +func (r ApiPatchDistributionRequest) Execute() (*PatchDistributionResponse, error) { + return r.ApiService.PatchDistributionExecute(r) +} + +/* +PatchDistribution Update existing distribution + +Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiPatchDistributionRequest +*/ +func (a *DefaultAPIService) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { + return ApiPatchDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return PatchDistributionResponse +func (a *DefaultAPIService) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PatchDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchDistributionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPurgeCacheRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + purgeCachePayload *PurgeCachePayload +} + +func (r ApiPurgeCacheRequest) PurgeCachePayload(purgeCachePayload PurgeCachePayload) ApiPurgeCacheRequest { + r.purgeCachePayload = &purgeCachePayload + return r +} + +func (r ApiPurgeCacheRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.PurgeCacheExecute(r) +} + +/* +PurgeCache Clear distribution cache + +Clear the cache for this distribution. +All content, regardless of its staleness, will get refetched from the host. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @return ApiPurgeCacheRequest +*/ +func (a *DefaultAPIService) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { + return ApiPurgeCacheRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *DefaultAPIService) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PurgeCache") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache/purge" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.purgeCachePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPutCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string + putCustomDomainPayload *PutCustomDomainPayload +} + +func (r ApiPutCustomDomainRequest) PutCustomDomainPayload(putCustomDomainPayload PutCustomDomainPayload) ApiPutCustomDomainRequest { + r.putCustomDomainPayload = &putCustomDomainPayload + return r +} + +func (r ApiPutCustomDomainRequest) Execute() (*PutCustomDomainResponse, error) { + return r.ApiService.PutCustomDomainExecute(r) +} + +/* +PutCustomDomain Create or update a custom domain + +Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project Id + @param distributionId + @param domain + @return ApiPutCustomDomainRequest +*/ +func (a *DefaultAPIService) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { + return ApiPutCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return PutCustomDomainResponse +func (a *DefaultAPIService) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PutCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PutCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.putCustomDomainPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJsonResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/cdn/v1beta2api/api_default_mock.go b/services/cdn/v1beta2api/api_default_mock.go new file mode 100644 index 000000000..5ae3f8d4b --- /dev/null +++ b/services/cdn/v1beta2api/api_default_mock.go @@ -0,0 +1,338 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateDistributionExecuteMock can be populated to implement the behavior of the CreateDistributionExecute function of this mock + CreateDistributionExecuteMock *func(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) + // DeleteCustomDomainExecuteMock can be populated to implement the behavior of the DeleteCustomDomainExecute function of this mock + DeleteCustomDomainExecuteMock *func(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) + // DeleteDistributionExecuteMock can be populated to implement the behavior of the DeleteDistributionExecute function of this mock + DeleteDistributionExecuteMock *func(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) + // FindCachePathsExecuteMock can be populated to implement the behavior of the FindCachePathsExecute function of this mock + FindCachePathsExecuteMock *func(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) + // GetCacheInfoExecuteMock can be populated to implement the behavior of the GetCacheInfoExecute function of this mock + GetCacheInfoExecuteMock *func(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) + // GetCustomDomainExecuteMock can be populated to implement the behavior of the GetCustomDomainExecute function of this mock + GetCustomDomainExecuteMock *func(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) + // GetDistributionExecuteMock can be populated to implement the behavior of the GetDistributionExecute function of this mock + GetDistributionExecuteMock *func(r ApiGetDistributionRequest) (*GetDistributionResponse, error) + // GetLogsExecuteMock can be populated to implement the behavior of the GetLogsExecute function of this mock + GetLogsExecuteMock *func(r ApiGetLogsRequest) (*GetLogsResponse, error) + // GetLogsSearchFiltersExecuteMock can be populated to implement the behavior of the GetLogsSearchFiltersExecute function of this mock + GetLogsSearchFiltersExecuteMock *func(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) + // GetStatisticsExecuteMock can be populated to implement the behavior of the GetStatisticsExecute function of this mock + GetStatisticsExecuteMock *func(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) + // ListDistributionsExecuteMock can be populated to implement the behavior of the ListDistributionsExecute function of this mock + ListDistributionsExecuteMock *func(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) + // ListWafCollectionsExecuteMock can be populated to implement the behavior of the ListWafCollectionsExecute function of this mock + ListWafCollectionsExecuteMock *func(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) + // PatchDistributionExecuteMock can be populated to implement the behavior of the PatchDistributionExecute function of this mock + PatchDistributionExecuteMock *func(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) + // PurgeCacheExecuteMock can be populated to implement the behavior of the PurgeCacheExecute function of this mock + PurgeCacheExecuteMock *func(r ApiPurgeCacheRequest) (map[string]interface{}, error) + // PutCustomDomainExecuteMock can be populated to implement the behavior of the PutCustomDomainExecute function of this mock + PutCustomDomainExecuteMock *func(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) +} + +func (a DefaultAPIServiceMock) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { + return ApiCreateDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// CreateDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { + if a.CreateDistributionExecuteMock == nil { + var localVarReturnValue *CreateDistributionResponse + return localVarReturnValue, nil + } + + return (*a.CreateDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { + return ApiDeleteCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// DeleteCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { + if a.DeleteCustomDomainExecuteMock == nil { + var localVarReturnValue *DeleteCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.DeleteCustomDomainExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { + return ApiDeleteDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// DeleteDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { + if a.DeleteDistributionExecuteMock == nil { + var localVarReturnValue *DeleteDistributionResponse + return localVarReturnValue, nil + } + + return (*a.DeleteDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { + return ApiFindCachePathsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// FindCachePathsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the FindCachePathsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { + if a.FindCachePathsExecuteMock == nil { + var localVarReturnValue *FindCachePathsResponse + return localVarReturnValue, nil + } + + return (*a.FindCachePathsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { + return ApiGetCacheInfoRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetCacheInfoExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCacheInfoExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { + if a.GetCacheInfoExecuteMock == nil { + var localVarReturnValue *GetCacheInfoResponse + return localVarReturnValue, nil + } + + return (*a.GetCacheInfoExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { + return ApiGetCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// GetCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { + if a.GetCustomDomainExecuteMock == nil { + var localVarReturnValue *GetCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.GetCustomDomainExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { + return ApiGetDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { + if a.GetDistributionExecuteMock == nil { + var localVarReturnValue *GetDistributionResponse + return localVarReturnValue, nil + } + + return (*a.GetDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { + return ApiGetLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetLogsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { + if a.GetLogsExecuteMock == nil { + var localVarReturnValue *GetLogsResponse + return localVarReturnValue, nil + } + + return (*a.GetLogsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { + return ApiGetLogsSearchFiltersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetLogsSearchFiltersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsSearchFiltersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { + if a.GetLogsSearchFiltersExecuteMock == nil { + var localVarReturnValue *GetLogsSearchFiltersResponse + return localVarReturnValue, nil + } + + return (*a.GetLogsSearchFiltersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { + return ApiGetStatisticsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetStatisticsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetStatisticsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { + if a.GetStatisticsExecuteMock == nil { + var localVarReturnValue *GetStatisticsResponse + return localVarReturnValue, nil + } + + return (*a.GetStatisticsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { + return ApiListDistributionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListDistributionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDistributionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { + if a.ListDistributionsExecuteMock == nil { + var localVarReturnValue *ListDistributionsResponse + return localVarReturnValue, nil + } + + return (*a.ListDistributionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListWafCollections(ctx context.Context, projectId string) ApiListWafCollectionsRequest { + return ApiListWafCollectionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListWafCollectionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListWafCollectionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListWafCollectionsExecute(r ApiListWafCollectionsRequest) (*ListWafCollectionsResponse, error) { + if a.ListWafCollectionsExecuteMock == nil { + var localVarReturnValue *ListWafCollectionsResponse + return localVarReturnValue, nil + } + + return (*a.ListWafCollectionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { + return ApiPatchDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// PatchDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { + if a.PatchDistributionExecuteMock == nil { + var localVarReturnValue *PatchDistributionResponse + return localVarReturnValue, nil + } + + return (*a.PatchDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { + return ApiPurgeCacheRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// PurgeCacheExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PurgeCacheExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { + if a.PurgeCacheExecuteMock == nil { + var localVarReturnValue map[string]interface{} + return localVarReturnValue, nil + } + + return (*a.PurgeCacheExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { + return ApiPutCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// PutCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PutCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { + if a.PutCustomDomainExecuteMock == nil { + var localVarReturnValue *PutCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.PutCustomDomainExecuteMock)(r) +} diff --git a/services/cdn/v1beta2api/client.go b/services/cdn/v1beta2api/client.go new file mode 100644 index 000000000..373081350 --- /dev/null +++ b/services/cdn/v1beta2api/client.go @@ -0,0 +1,658 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1beta2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the CDN API API v1beta2.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/cdn/v1beta2api/configuration.go b/services/cdn/v1beta2api/configuration.go new file mode 100644 index 000000000..73db69ae0 --- /dev/null +++ b/services/cdn/v1beta2api/configuration.go @@ -0,0 +1,37 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1beta2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/cdn", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://cdn.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/cdn/v1beta2api/model_bucket_backend.go b/services/cdn/v1beta2api/model_bucket_backend.go new file mode 100644 index 000000000..132248f42 --- /dev/null +++ b/services/cdn/v1beta2api/model_bucket_backend.go @@ -0,0 +1,212 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BucketBackend type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketBackend{} + +// BucketBackend struct for BucketBackend +type BucketBackend struct { + BucketUrl string `json:"bucketUrl"` + Region string `json:"region"` + Type string `json:"type"` +} + +type _BucketBackend BucketBackend + +// NewBucketBackend instantiates a new BucketBackend 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 NewBucketBackend(bucketUrl string, region string, types string) *BucketBackend { + this := BucketBackend{} + this.BucketUrl = bucketUrl + this.Region = region + this.Type = types + return &this +} + +// NewBucketBackendWithDefaults instantiates a new BucketBackend 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 NewBucketBackendWithDefaults() *BucketBackend { + this := BucketBackend{} + return &this +} + +// GetBucketUrl returns the BucketUrl field value +func (o *BucketBackend) GetBucketUrl() string { + if o == nil { + var ret string + return ret + } + + return o.BucketUrl +} + +// GetBucketUrlOk returns a tuple with the BucketUrl field value +// and a boolean to check if the value has been set. +func (o *BucketBackend) GetBucketUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BucketUrl, true +} + +// SetBucketUrl sets field value +func (o *BucketBackend) SetBucketUrl(v string) { + o.BucketUrl = v +} + +// GetRegion returns the Region field value +func (o *BucketBackend) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *BucketBackend) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *BucketBackend) SetRegion(v string) { + o.Region = v +} + +// GetType returns the Type field value +func (o *BucketBackend) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BucketBackend) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BucketBackend) SetType(v string) { + o.Type = v +} + +func (o BucketBackend) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketBackend) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bucketUrl"] = o.BucketUrl + toSerialize["region"] = o.Region + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BucketBackend) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "bucketUrl", + "region", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBucketBackend := _BucketBackend{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketBackend) + + if err != nil { + return err + } + + *o = BucketBackend(varBucketBackend) + + return err +} + +type NullableBucketBackend struct { + value *BucketBackend + isSet bool +} + +func (v NullableBucketBackend) Get() *BucketBackend { + return v.value +} + +func (v *NullableBucketBackend) Set(val *BucketBackend) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackend(val *BucketBackend) *NullableBucketBackend { + return &NullableBucketBackend{value: val, isSet: true} +} + +func (v NullableBucketBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_bucket_backend_create.go b/services/cdn/v1beta2api/model_bucket_backend_create.go new file mode 100644 index 000000000..e3e86649f --- /dev/null +++ b/services/cdn/v1beta2api/model_bucket_backend_create.go @@ -0,0 +1,240 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BucketBackendCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketBackendCreate{} + +// BucketBackendCreate struct for BucketBackendCreate +type BucketBackendCreate struct { + BucketUrl string `json:"bucketUrl"` + Credentials BucketCredentials `json:"credentials"` + Region string `json:"region"` + Type string `json:"type"` +} + +type _BucketBackendCreate BucketBackendCreate + +// NewBucketBackendCreate instantiates a new BucketBackendCreate 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 NewBucketBackendCreate(bucketUrl string, credentials BucketCredentials, region string, types string) *BucketBackendCreate { + this := BucketBackendCreate{} + this.BucketUrl = bucketUrl + this.Credentials = credentials + this.Region = region + this.Type = types + return &this +} + +// NewBucketBackendCreateWithDefaults instantiates a new BucketBackendCreate 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 NewBucketBackendCreateWithDefaults() *BucketBackendCreate { + this := BucketBackendCreate{} + return &this +} + +// GetBucketUrl returns the BucketUrl field value +func (o *BucketBackendCreate) GetBucketUrl() string { + if o == nil { + var ret string + return ret + } + + return o.BucketUrl +} + +// GetBucketUrlOk returns a tuple with the BucketUrl field value +// and a boolean to check if the value has been set. +func (o *BucketBackendCreate) GetBucketUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BucketUrl, true +} + +// SetBucketUrl sets field value +func (o *BucketBackendCreate) SetBucketUrl(v string) { + o.BucketUrl = v +} + +// GetCredentials returns the Credentials field value +func (o *BucketBackendCreate) GetCredentials() BucketCredentials { + if o == nil { + var ret BucketCredentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *BucketBackendCreate) GetCredentialsOk() (*BucketCredentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *BucketBackendCreate) SetCredentials(v BucketCredentials) { + o.Credentials = v +} + +// GetRegion returns the Region field value +func (o *BucketBackendCreate) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *BucketBackendCreate) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *BucketBackendCreate) SetRegion(v string) { + o.Region = v +} + +// GetType returns the Type field value +func (o *BucketBackendCreate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BucketBackendCreate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BucketBackendCreate) SetType(v string) { + o.Type = v +} + +func (o BucketBackendCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketBackendCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["bucketUrl"] = o.BucketUrl + toSerialize["credentials"] = o.Credentials + toSerialize["region"] = o.Region + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BucketBackendCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "bucketUrl", + "credentials", + "region", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBucketBackendCreate := _BucketBackendCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketBackendCreate) + + if err != nil { + return err + } + + *o = BucketBackendCreate(varBucketBackendCreate) + + return err +} + +type NullableBucketBackendCreate struct { + value *BucketBackendCreate + isSet bool +} + +func (v NullableBucketBackendCreate) Get() *BucketBackendCreate { + return v.value +} + +func (v *NullableBucketBackendCreate) Set(val *BucketBackendCreate) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackendCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackendCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackendCreate(val *BucketBackendCreate) *NullableBucketBackendCreate { + return &NullableBucketBackendCreate{value: val, isSet: true} +} + +func (v NullableBucketBackendCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackendCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_bucket_backend_patch.go b/services/cdn/v1beta2api/model_bucket_backend_patch.go new file mode 100644 index 000000000..34dd5aaa9 --- /dev/null +++ b/services/cdn/v1beta2api/model_bucket_backend_patch.go @@ -0,0 +1,264 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BucketBackendPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketBackendPatch{} + +// BucketBackendPatch struct for BucketBackendPatch +type BucketBackendPatch struct { + BucketUrl *string `json:"bucketUrl,omitempty"` + Credentials *BucketCredentials `json:"credentials,omitempty"` + Region *string `json:"region,omitempty"` + Type string `json:"type"` +} + +type _BucketBackendPatch BucketBackendPatch + +// NewBucketBackendPatch instantiates a new BucketBackendPatch 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 NewBucketBackendPatch(types string) *BucketBackendPatch { + this := BucketBackendPatch{} + this.Type = types + return &this +} + +// NewBucketBackendPatchWithDefaults instantiates a new BucketBackendPatch 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 NewBucketBackendPatchWithDefaults() *BucketBackendPatch { + this := BucketBackendPatch{} + return &this +} + +// GetBucketUrl returns the BucketUrl field value if set, zero value otherwise. +func (o *BucketBackendPatch) GetBucketUrl() string { + if o == nil || IsNil(o.BucketUrl) { + var ret string + return ret + } + return *o.BucketUrl +} + +// GetBucketUrlOk returns a tuple with the BucketUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketBackendPatch) GetBucketUrlOk() (*string, bool) { + if o == nil || IsNil(o.BucketUrl) { + return nil, false + } + return o.BucketUrl, true +} + +// HasBucketUrl returns a boolean if a field has been set. +func (o *BucketBackendPatch) HasBucketUrl() bool { + if o != nil && !IsNil(o.BucketUrl) { + return true + } + + return false +} + +// SetBucketUrl gets a reference to the given string and assigns it to the BucketUrl field. +func (o *BucketBackendPatch) SetBucketUrl(v string) { + o.BucketUrl = &v +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *BucketBackendPatch) GetCredentials() BucketCredentials { + if o == nil || IsNil(o.Credentials) { + var ret BucketCredentials + return ret + } + return *o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketBackendPatch) GetCredentialsOk() (*BucketCredentials, bool) { + if o == nil || IsNil(o.Credentials) { + return nil, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *BucketBackendPatch) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given BucketCredentials and assigns it to the Credentials field. +func (o *BucketBackendPatch) SetCredentials(v BucketCredentials) { + o.Credentials = &v +} + +// GetRegion returns the Region field value if set, zero value otherwise. +func (o *BucketBackendPatch) GetRegion() string { + if o == nil || IsNil(o.Region) { + 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 *BucketBackendPatch) GetRegionOk() (*string, bool) { + if o == nil || IsNil(o.Region) { + return nil, false + } + return o.Region, true +} + +// HasRegion returns a boolean if a field has been set. +func (o *BucketBackendPatch) HasRegion() bool { + if o != nil && !IsNil(o.Region) { + return true + } + + return false +} + +// SetRegion gets a reference to the given string and assigns it to the Region field. +func (o *BucketBackendPatch) SetRegion(v string) { + o.Region = &v +} + +// GetType returns the Type field value +func (o *BucketBackendPatch) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BucketBackendPatch) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BucketBackendPatch) SetType(v string) { + o.Type = v +} + +func (o BucketBackendPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketBackendPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BucketUrl) { + toSerialize["bucketUrl"] = o.BucketUrl + } + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + if !IsNil(o.Region) { + toSerialize["region"] = o.Region + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BucketBackendPatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBucketBackendPatch := _BucketBackendPatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketBackendPatch) + + if err != nil { + return err + } + + *o = BucketBackendPatch(varBucketBackendPatch) + + return err +} + +type NullableBucketBackendPatch struct { + value *BucketBackendPatch + isSet bool +} + +func (v NullableBucketBackendPatch) Get() *BucketBackendPatch { + return v.value +} + +func (v *NullableBucketBackendPatch) Set(val *BucketBackendPatch) { + v.value = val + v.isSet = true +} + +func (v NullableBucketBackendPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketBackendPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketBackendPatch(val *BucketBackendPatch) *NullableBucketBackendPatch { + return &NullableBucketBackendPatch{value: val, isSet: true} +} + +func (v NullableBucketBackendPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketBackendPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_bucket_credentials.go b/services/cdn/v1beta2api/model_bucket_credentials.go new file mode 100644 index 000000000..bf6020a7a --- /dev/null +++ b/services/cdn/v1beta2api/model_bucket_credentials.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BucketCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketCredentials{} + +// BucketCredentials struct for BucketCredentials +type BucketCredentials struct { + AccessKeyId string `json:"accessKeyId"` + SecretAccessKey string `json:"secretAccessKey"` +} + +type _BucketCredentials BucketCredentials + +// NewBucketCredentials instantiates a new BucketCredentials 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 NewBucketCredentials(accessKeyId string, secretAccessKey string) *BucketCredentials { + this := BucketCredentials{} + this.AccessKeyId = accessKeyId + this.SecretAccessKey = secretAccessKey + return &this +} + +// NewBucketCredentialsWithDefaults instantiates a new BucketCredentials 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 NewBucketCredentialsWithDefaults() *BucketCredentials { + this := BucketCredentials{} + return &this +} + +// GetAccessKeyId returns the AccessKeyId field value +func (o *BucketCredentials) GetAccessKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.AccessKeyId +} + +// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value +// and a boolean to check if the value has been set. +func (o *BucketCredentials) GetAccessKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccessKeyId, true +} + +// SetAccessKeyId sets field value +func (o *BucketCredentials) SetAccessKeyId(v string) { + o.AccessKeyId = v +} + +// GetSecretAccessKey returns the SecretAccessKey field value +func (o *BucketCredentials) GetSecretAccessKey() string { + if o == nil { + var ret string + return ret + } + + return o.SecretAccessKey +} + +// GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value +// and a boolean to check if the value has been set. +func (o *BucketCredentials) GetSecretAccessKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SecretAccessKey, true +} + +// SetSecretAccessKey sets field value +func (o *BucketCredentials) SetSecretAccessKey(v string) { + o.SecretAccessKey = v +} + +func (o BucketCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["accessKeyId"] = o.AccessKeyId + toSerialize["secretAccessKey"] = o.SecretAccessKey + return toSerialize, nil +} + +func (o *BucketCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "accessKeyId", + "secretAccessKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBucketCredentials := _BucketCredentials{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketCredentials) + + if err != nil { + return err + } + + *o = BucketCredentials(varBucketCredentials) + + return err +} + +type NullableBucketCredentials struct { + value *BucketCredentials + isSet bool +} + +func (v NullableBucketCredentials) Get() *BucketCredentials { + return v.value +} + +func (v *NullableBucketCredentials) Set(val *BucketCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableBucketCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketCredentials(val *BucketCredentials) *NullableBucketCredentials { + return &NullableBucketCredentials{value: val, isSet: true} +} + +func (v NullableBucketCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_config.go b/services/cdn/v1beta2api/model_config.go new file mode 100644 index 000000000..d54ee3270 --- /dev/null +++ b/services/cdn/v1beta2api/model_config.go @@ -0,0 +1,438 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Config type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Config{} + +// Config struct for Config +type Config struct { + Backend ConfigBackend `json:"backend"` + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g. DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIps []string `json:"blockedIps"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` + LogSink *LokiLogSink `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *Optimizer `json:"optimizer,omitempty"` + Regions []Region `json:"regions"` + Waf WafConfig `json:"waf"` +} + +type _Config Config + +// NewConfig instantiates a new Config 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 NewConfig(backend ConfigBackend, blockedCountries []string, blockedIps []string, regions []Region, waf WafConfig) *Config { + this := Config{} + this.Backend = backend + this.BlockedCountries = blockedCountries + this.BlockedIps = blockedIps + this.Regions = regions + this.Waf = waf + return &this +} + +// NewConfigWithDefaults instantiates a new Config 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 NewConfigWithDefaults() *Config { + this := Config{} + return &this +} + +// GetBackend returns the Backend field value +func (o *Config) GetBackend() ConfigBackend { + if o == nil { + var ret ConfigBackend + return ret + } + + return o.Backend +} + +// GetBackendOk returns a tuple with the Backend field value +// and a boolean to check if the value has been set. +func (o *Config) GetBackendOk() (*ConfigBackend, bool) { + if o == nil { + return nil, false + } + return &o.Backend, true +} + +// SetBackend sets field value +func (o *Config) SetBackend(v ConfigBackend) { + o.Backend = v +} + +// GetBlockedCountries returns the BlockedCountries field value +func (o *Config) GetBlockedCountries() []string { + if o == nil { + var ret []string + return ret + } + + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value +// and a boolean to check if the value has been set. +func (o *Config) GetBlockedCountriesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BlockedCountries, true +} + +// SetBlockedCountries sets field value +func (o *Config) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIps returns the BlockedIps field value +func (o *Config) GetBlockedIps() []string { + if o == nil { + var ret []string + return ret + } + + return o.BlockedIps +} + +// GetBlockedIpsOk returns a tuple with the BlockedIps field value +// and a boolean to check if the value has been set. +func (o *Config) GetBlockedIpsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BlockedIps, true +} + +// SetBlockedIps sets field value +func (o *Config) SetBlockedIps(v []string) { + o.BlockedIps = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Config) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration.Get()) { + var ret string + return ret + } + return *o.DefaultCacheDuration.Get() +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *Config) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *Config) HasDefaultCacheDuration() bool { + if o != nil && o.DefaultCacheDuration.IsSet() { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. +func (o *Config) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration.Set(&v) +} + +// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +func (o *Config) SetDefaultCacheDurationNil() { + o.DefaultCacheDuration.Set(nil) +} + +// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +func (o *Config) UnsetDefaultCacheDuration() { + o.DefaultCacheDuration.Unset() +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise. +func (o *Config) GetLogSink() LokiLogSink { + if o == nil || IsNil(o.LogSink) { + var ret LokiLogSink + return ret + } + return *o.LogSink +} + +// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Config) GetLogSinkOk() (*LokiLogSink, bool) { + if o == nil || IsNil(o.LogSink) { + return nil, false + } + return o.LogSink, true +} + +// HasLogSink returns a boolean if a field has been set. +func (o *Config) HasLogSink() bool { + if o != nil && !IsNil(o.LogSink) { + return true + } + + return false +} + +// SetLogSink gets a reference to the given LokiLogSink and assigns it to the LogSink field. +func (o *Config) SetLogSink(v LokiLogSink) { + o.LogSink = &v +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Config) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes.Get() +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *Config) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *Config) HasMonthlyLimitBytes() bool { + if o != nil && o.MonthlyLimitBytes.IsSet() { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. +func (o *Config) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes.Set(&v) +} + +// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +func (o *Config) SetMonthlyLimitBytesNil() { + o.MonthlyLimitBytes.Set(nil) +} + +// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +func (o *Config) UnsetMonthlyLimitBytes() { + o.MonthlyLimitBytes.Unset() +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *Config) GetOptimizer() Optimizer { + if o == nil || IsNil(o.Optimizer) { + var ret Optimizer + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Config) GetOptimizerOk() (*Optimizer, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *Config) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. +func (o *Config) SetOptimizer(v Optimizer) { + o.Optimizer = &v +} + +// GetRegions returns the Regions field value +func (o *Config) GetRegions() []Region { + if o == nil { + var ret []Region + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *Config) GetRegionsOk() ([]Region, bool) { + if o == nil { + return nil, false + } + return o.Regions, true +} + +// SetRegions sets field value +func (o *Config) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value +func (o *Config) GetWaf() WafConfig { + if o == nil { + var ret WafConfig + return ret + } + + return o.Waf +} + +// GetWafOk returns a tuple with the Waf field value +// and a boolean to check if the value has been set. +func (o *Config) GetWafOk() (*WafConfig, bool) { + if o == nil { + return nil, false + } + return &o.Waf, true +} + +// SetWaf sets field value +func (o *Config) SetWaf(v WafConfig) { + o.Waf = v +} + +func (o Config) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Config) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backend"] = o.Backend + toSerialize["blockedCountries"] = o.BlockedCountries + toSerialize["blockedIps"] = o.BlockedIps + if o.DefaultCacheDuration.IsSet() { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() + } + if !IsNil(o.LogSink) { + toSerialize["logSink"] = o.LogSink + } + if o.MonthlyLimitBytes.IsSet() { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + toSerialize["regions"] = o.Regions + toSerialize["waf"] = o.Waf + return toSerialize, nil +} + +func (o *Config) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backend", + "blockedCountries", + "blockedIps", + "regions", + "waf", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConfig := _Config{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varConfig) + + if err != nil { + return err + } + + *o = Config(varConfig) + + return err +} + +type NullableConfig struct { + value *Config + isSet bool +} + +func (v NullableConfig) Get() *Config { + return v.value +} + +func (v *NullableConfig) Set(val *Config) { + v.value = val + v.isSet = true +} + +func (v NullableConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfig(val *Config) *NullableConfig { + return &NullableConfig{value: val, isSet: true} +} + +func (v NullableConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_config_backend.go b/services/cdn/v1beta2api/model_config_backend.go new file mode 100644 index 000000000..3e82c3ad8 --- /dev/null +++ b/services/cdn/v1beta2api/model_config_backend.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// ConfigBackend - struct for ConfigBackend +type ConfigBackend struct { + BucketBackend *BucketBackend + HttpBackend *HttpBackend +} + +// BucketBackendAsConfigBackend is a convenience function that returns BucketBackend wrapped in ConfigBackend +func BucketBackendAsConfigBackend(v *BucketBackend) ConfigBackend { + return ConfigBackend{ + BucketBackend: v, + } +} + +// HttpBackendAsConfigBackend is a convenience function that returns HttpBackend wrapped in ConfigBackend +func HttpBackendAsConfigBackend(v *HttpBackend) ConfigBackend { + return ConfigBackend{ + HttpBackend: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ConfigBackend) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'bucket' + if jsonDict["type"] == "bucket" { + // try to unmarshal JSON data into BucketBackend + err = json.Unmarshal(data, &dst.BucketBackend) + if err == nil { + return nil // data stored in dst.BucketBackend, return on the first match + } else { + dst.BucketBackend = nil + return fmt.Errorf("failed to unmarshal ConfigBackend as BucketBackend: %s", err.Error()) + } + } + + // check if the discriminator value is 'http' + if jsonDict["type"] == "http" { + // try to unmarshal JSON data into HttpBackend + err = json.Unmarshal(data, &dst.HttpBackend) + if err == nil { + return nil // data stored in dst.HttpBackend, return on the first match + } else { + dst.HttpBackend = nil + return fmt.Errorf("failed to unmarshal ConfigBackend as HttpBackend: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ConfigBackend) MarshalJSON() ([]byte, error) { + if src.BucketBackend != nil { + return json.Marshal(&src.BucketBackend) + } + + if src.HttpBackend != nil { + return json.Marshal(&src.HttpBackend) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ConfigBackend) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.BucketBackend != nil { + return obj.BucketBackend + } + + if obj.HttpBackend != nil { + return obj.HttpBackend + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ConfigBackend) GetActualInstanceValue() interface{} { + if obj.BucketBackend != nil { + return *obj.BucketBackend + } + + if obj.HttpBackend != nil { + return *obj.HttpBackend + } + + // all schemas are nil + return nil +} + +type NullableConfigBackend struct { + value *ConfigBackend + isSet bool +} + +func (v NullableConfigBackend) Get() *ConfigBackend { + return v.value +} + +func (v *NullableConfigBackend) Set(val *ConfigBackend) { + v.value = val + v.isSet = true +} + +func (v NullableConfigBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigBackend(val *ConfigBackend) *NullableConfigBackend { + return &NullableConfigBackend{value: val, isSet: true} +} + +func (v NullableConfigBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_config_patch.go b/services/cdn/v1beta2api/model_config_patch.go new file mode 100644 index 000000000..3d90febd2 --- /dev/null +++ b/services/cdn/v1beta2api/model_config_patch.go @@ -0,0 +1,449 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" +) + +// checks if the ConfigPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigPatch{} + +// ConfigPatch struct for ConfigPatch +type ConfigPatch struct { + Backend *ConfigPatchBackend `json:"backend,omitempty"` + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries,omitempty"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIps []string `json:"blockedIps,omitempty"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` + LogSink NullableLokiLogSinkPatch `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *OptimizerPatch `json:"optimizer,omitempty"` + Regions []Region `json:"regions,omitempty"` + Waf *WafConfigPatch `json:"waf,omitempty"` +} + +// NewConfigPatch instantiates a new ConfigPatch 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 NewConfigPatch() *ConfigPatch { + this := ConfigPatch{} + return &this +} + +// NewConfigPatchWithDefaults instantiates a new ConfigPatch 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 NewConfigPatchWithDefaults() *ConfigPatch { + this := ConfigPatch{} + return &this +} + +// GetBackend returns the Backend field value if set, zero value otherwise. +func (o *ConfigPatch) GetBackend() ConfigPatchBackend { + if o == nil || IsNil(o.Backend) { + var ret ConfigPatchBackend + return ret + } + return *o.Backend +} + +// GetBackendOk returns a tuple with the Backend field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBackendOk() (*ConfigPatchBackend, bool) { + if o == nil || IsNil(o.Backend) { + return nil, false + } + return o.Backend, true +} + +// HasBackend returns a boolean if a field has been set. +func (o *ConfigPatch) HasBackend() bool { + if o != nil && !IsNil(o.Backend) { + return true + } + + return false +} + +// SetBackend gets a reference to the given ConfigPatchBackend and assigns it to the Backend field. +func (o *ConfigPatch) SetBackend(v ConfigPatchBackend) { + o.Backend = &v +} + +// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +func (o *ConfigPatch) GetBlockedCountries() []string { + if o == nil || IsNil(o.BlockedCountries) { + var ret []string + return ret + } + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBlockedCountriesOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedCountries) { + return nil, false + } + return o.BlockedCountries, true +} + +// HasBlockedCountries returns a boolean if a field has been set. +func (o *ConfigPatch) HasBlockedCountries() bool { + if o != nil && !IsNil(o.BlockedCountries) { + return true + } + + return false +} + +// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. +func (o *ConfigPatch) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. +func (o *ConfigPatch) GetBlockedIps() []string { + if o == nil || IsNil(o.BlockedIps) { + var ret []string + return ret + } + return o.BlockedIps +} + +// GetBlockedIpsOk returns a tuple with the BlockedIps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBlockedIpsOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedIps) { + return nil, false + } + return o.BlockedIps, true +} + +// HasBlockedIps returns a boolean if a field has been set. +func (o *ConfigPatch) HasBlockedIps() bool { + if o != nil && !IsNil(o.BlockedIps) { + return true + } + + return false +} + +// SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. +func (o *ConfigPatch) SetBlockedIps(v []string) { + o.BlockedIps = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration.Get()) { + var ret string + return ret + } + return *o.DefaultCacheDuration.Get() +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *ConfigPatch) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *ConfigPatch) HasDefaultCacheDuration() bool { + if o != nil && o.DefaultCacheDuration.IsSet() { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. +func (o *ConfigPatch) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration.Set(&v) +} + +// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +func (o *ConfigPatch) SetDefaultCacheDurationNil() { + o.DefaultCacheDuration.Set(nil) +} + +// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +func (o *ConfigPatch) UnsetDefaultCacheDuration() { + o.DefaultCacheDuration.Unset() +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetLogSink() LokiLogSinkPatch { + if o == nil || IsNil(o.LogSink.Get()) { + var ret LokiLogSinkPatch + return ret + } + return *o.LogSink.Get() +} + +// GetLogSinkOk returns a tuple with the LogSink 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 *ConfigPatch) GetLogSinkOk() (*LokiLogSinkPatch, bool) { + if o == nil { + return nil, false + } + return o.LogSink.Get(), o.LogSink.IsSet() +} + +// HasLogSink returns a boolean if a field has been set. +func (o *ConfigPatch) HasLogSink() bool { + if o != nil && o.LogSink.IsSet() { + return true + } + + return false +} + +// SetLogSink gets a reference to the given NullableLokiLogSinkPatch and assigns it to the LogSink field. +func (o *ConfigPatch) SetLogSink(v LokiLogSinkPatch) { + o.LogSink.Set(&v) +} + +// SetLogSinkNil sets the value for LogSink to be an explicit nil +func (o *ConfigPatch) SetLogSinkNil() { + o.LogSink.Set(nil) +} + +// UnsetLogSink ensures that no value is present for LogSink, not even an explicit nil +func (o *ConfigPatch) UnsetLogSink() { + o.LogSink.Unset() +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes.Get() +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *ConfigPatch) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *ConfigPatch) HasMonthlyLimitBytes() bool { + if o != nil && o.MonthlyLimitBytes.IsSet() { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. +func (o *ConfigPatch) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes.Set(&v) +} + +// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +func (o *ConfigPatch) SetMonthlyLimitBytesNil() { + o.MonthlyLimitBytes.Set(nil) +} + +// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +func (o *ConfigPatch) UnsetMonthlyLimitBytes() { + o.MonthlyLimitBytes.Unset() +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *ConfigPatch) GetOptimizer() OptimizerPatch { + if o == nil || IsNil(o.Optimizer) { + var ret OptimizerPatch + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetOptimizerOk() (*OptimizerPatch, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *ConfigPatch) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given OptimizerPatch and assigns it to the Optimizer field. +func (o *ConfigPatch) SetOptimizer(v OptimizerPatch) { + o.Optimizer = &v +} + +// GetRegions returns the Regions field value if set, zero value otherwise. +func (o *ConfigPatch) GetRegions() []Region { + if o == nil || IsNil(o.Regions) { + var ret []Region + return ret + } + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetRegionsOk() ([]Region, bool) { + if o == nil || IsNil(o.Regions) { + return nil, false + } + return o.Regions, true +} + +// HasRegions returns a boolean if a field has been set. +func (o *ConfigPatch) HasRegions() bool { + if o != nil && !IsNil(o.Regions) { + return true + } + + return false +} + +// SetRegions gets a reference to the given []Region and assigns it to the Regions field. +func (o *ConfigPatch) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *ConfigPatch) GetWaf() WafConfigPatch { + if o == nil || IsNil(o.Waf) { + var ret WafConfigPatch + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetWafOk() (*WafConfigPatch, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *ConfigPatch) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given WafConfigPatch and assigns it to the Waf field. +func (o *ConfigPatch) SetWaf(v WafConfigPatch) { + o.Waf = &v +} + +func (o ConfigPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Backend) { + toSerialize["backend"] = o.Backend + } + if !IsNil(o.BlockedCountries) { + toSerialize["blockedCountries"] = o.BlockedCountries + } + if !IsNil(o.BlockedIps) { + toSerialize["blockedIps"] = o.BlockedIps + } + if o.DefaultCacheDuration.IsSet() { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() + } + if o.LogSink.IsSet() { + toSerialize["logSink"] = o.LogSink.Get() + } + if o.MonthlyLimitBytes.IsSet() { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + if !IsNil(o.Regions) { + toSerialize["regions"] = o.Regions + } + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +type NullableConfigPatch struct { + value *ConfigPatch + isSet bool +} + +func (v NullableConfigPatch) Get() *ConfigPatch { + return v.value +} + +func (v *NullableConfigPatch) Set(val *ConfigPatch) { + v.value = val + v.isSet = true +} + +func (v NullableConfigPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigPatch(val *ConfigPatch) *NullableConfigPatch { + return &NullableConfigPatch{value: val, isSet: true} +} + +func (v NullableConfigPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_config_patch_backend.go b/services/cdn/v1beta2api/model_config_patch_backend.go new file mode 100644 index 000000000..a060a2c8d --- /dev/null +++ b/services/cdn/v1beta2api/model_config_patch_backend.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// ConfigPatchBackend - struct for ConfigPatchBackend +type ConfigPatchBackend struct { + BucketBackendPatch *BucketBackendPatch + HttpBackendPatch *HttpBackendPatch +} + +// BucketBackendPatchAsConfigPatchBackend is a convenience function that returns BucketBackendPatch wrapped in ConfigPatchBackend +func BucketBackendPatchAsConfigPatchBackend(v *BucketBackendPatch) ConfigPatchBackend { + return ConfigPatchBackend{ + BucketBackendPatch: v, + } +} + +// HttpBackendPatchAsConfigPatchBackend is a convenience function that returns HttpBackendPatch wrapped in ConfigPatchBackend +func HttpBackendPatchAsConfigPatchBackend(v *HttpBackendPatch) ConfigPatchBackend { + return ConfigPatchBackend{ + HttpBackendPatch: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ConfigPatchBackend) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'bucket' + if jsonDict["type"] == "bucket" { + // try to unmarshal JSON data into BucketBackendPatch + err = json.Unmarshal(data, &dst.BucketBackendPatch) + if err == nil { + return nil // data stored in dst.BucketBackendPatch, return on the first match + } else { + dst.BucketBackendPatch = nil + return fmt.Errorf("failed to unmarshal ConfigPatchBackend as BucketBackendPatch: %s", err.Error()) + } + } + + // check if the discriminator value is 'http' + if jsonDict["type"] == "http" { + // try to unmarshal JSON data into HttpBackendPatch + err = json.Unmarshal(data, &dst.HttpBackendPatch) + if err == nil { + return nil // data stored in dst.HttpBackendPatch, return on the first match + } else { + dst.HttpBackendPatch = nil + return fmt.Errorf("failed to unmarshal ConfigPatchBackend as HttpBackendPatch: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ConfigPatchBackend) MarshalJSON() ([]byte, error) { + if src.BucketBackendPatch != nil { + return json.Marshal(&src.BucketBackendPatch) + } + + if src.HttpBackendPatch != nil { + return json.Marshal(&src.HttpBackendPatch) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ConfigPatchBackend) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.BucketBackendPatch != nil { + return obj.BucketBackendPatch + } + + if obj.HttpBackendPatch != nil { + return obj.HttpBackendPatch + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ConfigPatchBackend) GetActualInstanceValue() interface{} { + if obj.BucketBackendPatch != nil { + return *obj.BucketBackendPatch + } + + if obj.HttpBackendPatch != nil { + return *obj.HttpBackendPatch + } + + // all schemas are nil + return nil +} + +type NullableConfigPatchBackend struct { + value *ConfigPatchBackend + isSet bool +} + +func (v NullableConfigPatchBackend) Get() *ConfigPatchBackend { + return v.value +} + +func (v *NullableConfigPatchBackend) Set(val *ConfigPatchBackend) { + v.value = val + v.isSet = true +} + +func (v NullableConfigPatchBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigPatchBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigPatchBackend(val *ConfigPatchBackend) *NullableConfigPatchBackend { + return &NullableConfigPatchBackend{value: val, isSet: true} +} + +func (v NullableConfigPatchBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigPatchBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_create_distribution_payload.go b/services/cdn/v1beta2api/model_create_distribution_payload.go new file mode 100644 index 000000000..a98e89077 --- /dev/null +++ b/services/cdn/v1beta2api/model_create_distribution_payload.go @@ -0,0 +1,478 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateDistributionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDistributionPayload{} + +// CreateDistributionPayload struct for CreateDistributionPayload +type CreateDistributionPayload struct { + Backend CreateDistributionPayloadBackend `json:"backend"` + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries,omitempty"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIps []string `json:"blockedIps,omitempty"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration *string `json:"defaultCacheDuration,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` + LogSink *LokiLogSinkCreate `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes *int64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *Optimizer `json:"optimizer,omitempty"` + // Define in which regions you would like your content to be cached. + Regions []Region `json:"regions"` + Waf *WafConfig `json:"waf,omitempty"` +} + +type _CreateDistributionPayload CreateDistributionPayload + +// NewCreateDistributionPayload instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayload(backend CreateDistributionPayloadBackend, regions []Region) *CreateDistributionPayload { + this := CreateDistributionPayload{} + this.Backend = backend + this.Regions = regions + return &this +} + +// NewCreateDistributionPayloadWithDefaults instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayloadWithDefaults() *CreateDistributionPayload { + this := CreateDistributionPayload{} + return &this +} + +// GetBackend returns the Backend field value +func (o *CreateDistributionPayload) GetBackend() CreateDistributionPayloadBackend { + if o == nil { + var ret CreateDistributionPayloadBackend + return ret + } + + return o.Backend +} + +// GetBackendOk returns a tuple with the Backend field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetBackendOk() (*CreateDistributionPayloadBackend, bool) { + if o == nil { + return nil, false + } + return &o.Backend, true +} + +// SetBackend sets field value +func (o *CreateDistributionPayload) SetBackend(v CreateDistributionPayloadBackend) { + o.Backend = v +} + +// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetBlockedCountries() []string { + if o == nil || IsNil(o.BlockedCountries) { + var ret []string + return ret + } + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetBlockedCountriesOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedCountries) { + return nil, false + } + return o.BlockedCountries, true +} + +// HasBlockedCountries returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasBlockedCountries() bool { + if o != nil && !IsNil(o.BlockedCountries) { + return true + } + + return false +} + +// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. +func (o *CreateDistributionPayload) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIps returns the BlockedIps field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetBlockedIps() []string { + if o == nil || IsNil(o.BlockedIps) { + var ret []string + return ret + } + return o.BlockedIps +} + +// GetBlockedIpsOk returns a tuple with the BlockedIps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetBlockedIpsOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedIps) { + return nil, false + } + return o.BlockedIps, true +} + +// HasBlockedIps returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasBlockedIps() bool { + if o != nil && !IsNil(o.BlockedIps) { + return true + } + + return false +} + +// SetBlockedIps gets a reference to the given []string and assigns it to the BlockedIps field. +func (o *CreateDistributionPayload) SetBlockedIps(v []string) { + o.BlockedIps = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration) { + var ret string + return ret + } + return *o.DefaultCacheDuration +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil || IsNil(o.DefaultCacheDuration) { + return nil, false + } + return o.DefaultCacheDuration, true +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasDefaultCacheDuration() bool { + if o != nil && !IsNil(o.DefaultCacheDuration) { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +func (o *CreateDistributionPayload) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *CreateDistributionPayload) SetIntentId(v string) { + o.IntentId = &v +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetLogSink() LokiLogSinkCreate { + if o == nil || IsNil(o.LogSink) { + var ret LokiLogSinkCreate + return ret + } + return *o.LogSink +} + +// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetLogSinkOk() (*LokiLogSinkCreate, bool) { + if o == nil || IsNil(o.LogSink) { + return nil, false + } + return o.LogSink, true +} + +// HasLogSink returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasLogSink() bool { + if o != nil && !IsNil(o.LogSink) { + return true + } + + return false +} + +// SetLogSink gets a reference to the given LokiLogSinkCreate and assigns it to the LogSink field. +func (o *CreateDistributionPayload) SetLogSink(v LokiLogSinkCreate) { + o.LogSink = &v +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil || IsNil(o.MonthlyLimitBytes) { + return nil, false + } + return o.MonthlyLimitBytes, true +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasMonthlyLimitBytes() bool { + if o != nil && !IsNil(o.MonthlyLimitBytes) { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. +func (o *CreateDistributionPayload) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes = &v +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetOptimizer() Optimizer { + if o == nil || IsNil(o.Optimizer) { + var ret Optimizer + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetOptimizerOk() (*Optimizer, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. +func (o *CreateDistributionPayload) SetOptimizer(v Optimizer) { + o.Optimizer = &v +} + +// GetRegions returns the Regions field value +func (o *CreateDistributionPayload) GetRegions() []Region { + if o == nil { + var ret []Region + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetRegionsOk() ([]Region, bool) { + if o == nil { + return nil, false + } + return o.Regions, true +} + +// SetRegions sets field value +func (o *CreateDistributionPayload) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetWaf() WafConfig { + if o == nil || IsNil(o.Waf) { + var ret WafConfig + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetWafOk() (*WafConfig, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given WafConfig and assigns it to the Waf field. +func (o *CreateDistributionPayload) SetWaf(v WafConfig) { + o.Waf = &v +} + +func (o CreateDistributionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backend"] = o.Backend + if !IsNil(o.BlockedCountries) { + toSerialize["blockedCountries"] = o.BlockedCountries + } + if !IsNil(o.BlockedIps) { + toSerialize["blockedIps"] = o.BlockedIps + } + if !IsNil(o.DefaultCacheDuration) { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + if !IsNil(o.LogSink) { + toSerialize["logSink"] = o.LogSink + } + if !IsNil(o.MonthlyLimitBytes) { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + toSerialize["regions"] = o.Regions + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +func (o *CreateDistributionPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backend", + "regions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDistributionPayload := _CreateDistributionPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDistributionPayload) + + if err != nil { + return err + } + + *o = CreateDistributionPayload(varCreateDistributionPayload) + + return err +} + +type NullableCreateDistributionPayload struct { + value *CreateDistributionPayload + isSet bool +} + +func (v NullableCreateDistributionPayload) Get() *CreateDistributionPayload { + return v.value +} + +func (v *NullableCreateDistributionPayload) Set(val *CreateDistributionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDistributionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDistributionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDistributionPayload(val *CreateDistributionPayload) *NullableCreateDistributionPayload { + return &NullableCreateDistributionPayload{value: val, isSet: true} +} + +func (v NullableCreateDistributionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDistributionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_create_distribution_payload_backend.go b/services/cdn/v1beta2api/model_create_distribution_payload_backend.go new file mode 100644 index 000000000..6baa7d8e5 --- /dev/null +++ b/services/cdn/v1beta2api/model_create_distribution_payload_backend.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// CreateDistributionPayloadBackend - Configuration for the content origin backend. +type CreateDistributionPayloadBackend struct { + BucketBackendCreate *BucketBackendCreate + HttpBackendCreate *HttpBackendCreate +} + +// BucketBackendCreateAsCreateDistributionPayloadBackend is a convenience function that returns BucketBackendCreate wrapped in CreateDistributionPayloadBackend +func BucketBackendCreateAsCreateDistributionPayloadBackend(v *BucketBackendCreate) CreateDistributionPayloadBackend { + return CreateDistributionPayloadBackend{ + BucketBackendCreate: v, + } +} + +// HttpBackendCreateAsCreateDistributionPayloadBackend is a convenience function that returns HttpBackendCreate wrapped in CreateDistributionPayloadBackend +func HttpBackendCreateAsCreateDistributionPayloadBackend(v *HttpBackendCreate) CreateDistributionPayloadBackend { + return CreateDistributionPayloadBackend{ + HttpBackendCreate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateDistributionPayloadBackend) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'bucket' + if jsonDict["type"] == "bucket" { + // try to unmarshal JSON data into BucketBackendCreate + err = json.Unmarshal(data, &dst.BucketBackendCreate) + if err == nil { + return nil // data stored in dst.BucketBackendCreate, return on the first match + } else { + dst.BucketBackendCreate = nil + return fmt.Errorf("failed to unmarshal CreateDistributionPayloadBackend as BucketBackendCreate: %s", err.Error()) + } + } + + // check if the discriminator value is 'http' + if jsonDict["type"] == "http" { + // try to unmarshal JSON data into HttpBackendCreate + err = json.Unmarshal(data, &dst.HttpBackendCreate) + if err == nil { + return nil // data stored in dst.HttpBackendCreate, return on the first match + } else { + dst.HttpBackendCreate = nil + return fmt.Errorf("failed to unmarshal CreateDistributionPayloadBackend as HttpBackendCreate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { + if src.BucketBackendCreate != nil { + return json.Marshal(&src.BucketBackendCreate) + } + + if src.HttpBackendCreate != nil { + return json.Marshal(&src.HttpBackendCreate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateDistributionPayloadBackend) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.BucketBackendCreate != nil { + return obj.BucketBackendCreate + } + + if obj.HttpBackendCreate != nil { + return obj.HttpBackendCreate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateDistributionPayloadBackend) GetActualInstanceValue() interface{} { + if obj.BucketBackendCreate != nil { + return *obj.BucketBackendCreate + } + + if obj.HttpBackendCreate != nil { + return *obj.HttpBackendCreate + } + + // all schemas are nil + return nil +} + +type NullableCreateDistributionPayloadBackend struct { + value *CreateDistributionPayloadBackend + isSet bool +} + +func (v NullableCreateDistributionPayloadBackend) Get() *CreateDistributionPayloadBackend { + return v.value +} + +func (v *NullableCreateDistributionPayloadBackend) Set(val *CreateDistributionPayloadBackend) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDistributionPayloadBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDistributionPayloadBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDistributionPayloadBackend(val *CreateDistributionPayloadBackend) *NullableCreateDistributionPayloadBackend { + return &NullableCreateDistributionPayloadBackend{value: val, isSet: true} +} + +func (v NullableCreateDistributionPayloadBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDistributionPayloadBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_create_distribution_response.go b/services/cdn/v1beta2api/model_create_distribution_response.go new file mode 100644 index 000000000..227db7045 --- /dev/null +++ b/services/cdn/v1beta2api/model_create_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDistributionResponse{} + +// CreateDistributionResponse struct for CreateDistributionResponse +type CreateDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _CreateDistributionResponse CreateDistributionResponse + +// NewCreateDistributionResponse instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponse(distribution Distribution) *CreateDistributionResponse { + this := CreateDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewCreateDistributionResponseWithDefaults instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponseWithDefaults() *CreateDistributionResponse { + this := CreateDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *CreateDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *CreateDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o CreateDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *CreateDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDistributionResponse := _CreateDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDistributionResponse) + + if err != nil { + return err + } + + *o = CreateDistributionResponse(varCreateDistributionResponse) + + return err +} + +type NullableCreateDistributionResponse struct { + value *CreateDistributionResponse + isSet bool +} + +func (v NullableCreateDistributionResponse) Get() *CreateDistributionResponse { + return v.value +} + +func (v *NullableCreateDistributionResponse) Set(val *CreateDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDistributionResponse(val *CreateDistributionResponse) *NullableCreateDistributionResponse { + return &NullableCreateDistributionResponse{value: val, isSet: true} +} + +func (v NullableCreateDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_custom_domain.go b/services/cdn/v1beta2api/model_custom_domain.go new file mode 100644 index 000000000..3bcd1e34e --- /dev/null +++ b/services/cdn/v1beta2api/model_custom_domain.go @@ -0,0 +1,222 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CustomDomain type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomDomain{} + +// CustomDomain Definition of a custom domain +type CustomDomain struct { + // This object is present if the custom domain has errors. + Errors []StatusError `json:"errors,omitempty"` + // The domain. Can be used as input for the GetCustomDomain endpoint + Name string `json:"name"` + Status DomainStatus `json:"status"` +} + +type _CustomDomain CustomDomain + +// NewCustomDomain instantiates a new CustomDomain 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 NewCustomDomain(name string, status DomainStatus) *CustomDomain { + this := CustomDomain{} + this.Name = name + this.Status = status + return &this +} + +// NewCustomDomainWithDefaults instantiates a new CustomDomain 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 NewCustomDomainWithDefaults() *CustomDomain { + this := CustomDomain{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *CustomDomain) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *CustomDomain) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *CustomDomain) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetName returns the Name field value +func (o *CustomDomain) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomDomain) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *CustomDomain) GetStatus() DomainStatus { + if o == nil { + var ret DomainStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetStatusOk() (*DomainStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *CustomDomain) SetStatus(v DomainStatus) { + o.Status = v +} + +func (o CustomDomain) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomDomain) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *CustomDomain) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomDomain := _CustomDomain{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCustomDomain) + + if err != nil { + return err + } + + *o = CustomDomain(varCustomDomain) + + return err +} + +type NullableCustomDomain struct { + value *CustomDomain + isSet bool +} + +func (v NullableCustomDomain) Get() *CustomDomain { + return v.value +} + +func (v *NullableCustomDomain) Set(val *CustomDomain) { + v.value = val + v.isSet = true +} + +func (v NullableCustomDomain) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomDomain) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomDomain(val *CustomDomain) *NullableCustomDomain { + return &NullableCustomDomain{value: val, isSet: true} +} + +func (v NullableCustomDomain) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomDomain) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_delete_custom_domain_response.go b/services/cdn/v1beta2api/model_delete_custom_domain_response.go new file mode 100644 index 000000000..41364a7f4 --- /dev/null +++ b/services/cdn/v1beta2api/model_delete_custom_domain_response.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" +) + +// checks if the DeleteCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteCustomDomainResponse{} + +// DeleteCustomDomainResponse Returns the custom domain that was deleted while the deletion has not completed yet. After the deletion was successful the response will be empty. +type DeleteCustomDomainResponse struct { + CustomDomain *CustomDomain `json:"customDomain,omitempty"` +} + +// NewDeleteCustomDomainResponse instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponse() *DeleteCustomDomainResponse { + this := DeleteCustomDomainResponse{} + return &this +} + +// NewDeleteCustomDomainResponseWithDefaults instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponseWithDefaults() *DeleteCustomDomainResponse { + this := DeleteCustomDomainResponse{} + return &this +} + +// GetCustomDomain returns the CustomDomain field value if set, zero value otherwise. +func (o *DeleteCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil || IsNil(o.CustomDomain) { + var ret CustomDomain + return ret + } + return *o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil || IsNil(o.CustomDomain) { + return nil, false + } + return o.CustomDomain, true +} + +// HasCustomDomain returns a boolean if a field has been set. +func (o *DeleteCustomDomainResponse) HasCustomDomain() bool { + if o != nil && !IsNil(o.CustomDomain) { + return true + } + + return false +} + +// SetCustomDomain gets a reference to the given CustomDomain and assigns it to the CustomDomain field. +func (o *DeleteCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = &v +} + +func (o DeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomDomain) { + toSerialize["customDomain"] = o.CustomDomain + } + return toSerialize, nil +} + +type NullableDeleteCustomDomainResponse struct { + value *DeleteCustomDomainResponse + isSet bool +} + +func (v NullableDeleteCustomDomainResponse) Get() *DeleteCustomDomainResponse { + return v.value +} + +func (v *NullableDeleteCustomDomainResponse) Set(val *DeleteCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteCustomDomainResponse(val *DeleteCustomDomainResponse) *NullableDeleteCustomDomainResponse { + return &NullableDeleteCustomDomainResponse{value: val, isSet: true} +} + +func (v NullableDeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_delete_distribution_response.go b/services/cdn/v1beta2api/model_delete_distribution_response.go new file mode 100644 index 000000000..d0d9d9717 --- /dev/null +++ b/services/cdn/v1beta2api/model_delete_distribution_response.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" +) + +// checks if the DeleteDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteDistributionResponse{} + +// DeleteDistributionResponse struct for DeleteDistributionResponse +type DeleteDistributionResponse struct { + Distribution *Distribution `json:"distribution,omitempty"` +} + +// NewDeleteDistributionResponse instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponse() *DeleteDistributionResponse { + this := DeleteDistributionResponse{} + return &this +} + +// NewDeleteDistributionResponseWithDefaults instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponseWithDefaults() *DeleteDistributionResponse { + this := DeleteDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value if set, zero value otherwise. +func (o *DeleteDistributionResponse) GetDistribution() Distribution { + if o == nil || IsNil(o.Distribution) { + var ret Distribution + return ret + } + return *o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil || IsNil(o.Distribution) { + return nil, false + } + return o.Distribution, true +} + +// HasDistribution returns a boolean if a field has been set. +func (o *DeleteDistributionResponse) HasDistribution() bool { + if o != nil && !IsNil(o.Distribution) { + return true + } + + return false +} + +// SetDistribution gets a reference to the given Distribution and assigns it to the Distribution field. +func (o *DeleteDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = &v +} + +func (o DeleteDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Distribution) { + toSerialize["distribution"] = o.Distribution + } + return toSerialize, nil +} + +type NullableDeleteDistributionResponse struct { + value *DeleteDistributionResponse + isSet bool +} + +func (v NullableDeleteDistributionResponse) Get() *DeleteDistributionResponse { + return v.value +} + +func (v *NullableDeleteDistributionResponse) Set(val *DeleteDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteDistributionResponse(val *DeleteDistributionResponse) *NullableDeleteDistributionResponse { + return &NullableDeleteDistributionResponse{value: val, isSet: true} +} + +func (v NullableDeleteDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_distribution.go b/services/cdn/v1beta2api/model_distribution.go new file mode 100644 index 000000000..abd8d4aea --- /dev/null +++ b/services/cdn/v1beta2api/model_distribution.go @@ -0,0 +1,401 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Distribution type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Distribution{} + +// Distribution struct for Distribution +type Distribution struct { + Config Config `json:"config"` + // RFC3339 string defining when the distribution was created + CreatedAt time.Time `json:"createdAt"` + Domains []Domain `json:"domains"` + // This object may be present if, and only if the distribution has encountered an error state. + Errors []StatusError `json:"errors,omitempty"` + Id string `json:"id"` + ProjectId string `json:"projectId"` + // - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. + Status string `json:"status"` + // RFC3339 string which returns the last time the distribution configuration was modified. + UpdatedAt time.Time `json:"updatedAt"` + Waf *DistributionWaf `json:"waf,omitempty"` +} + +type _Distribution Distribution + +// NewDistribution instantiates a new Distribution 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 NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status string, updatedAt time.Time) *Distribution { + this := Distribution{} + this.Config = config + this.CreatedAt = createdAt + this.Domains = domains + this.Id = id + this.ProjectId = projectId + this.Status = status + this.UpdatedAt = updatedAt + return &this +} + +// NewDistributionWithDefaults instantiates a new Distribution 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 NewDistributionWithDefaults() *Distribution { + this := Distribution{} + return &this +} + +// GetConfig returns the Config field value +func (o *Distribution) GetConfig() Config { + if o == nil { + var ret Config + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetConfigOk() (*Config, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *Distribution) SetConfig(v Config) { + o.Config = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Distribution) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Distribution) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDomains returns the Domains field value +func (o *Distribution) GetDomains() []Domain { + if o == nil { + var ret []Domain + return ret + } + + return o.Domains +} + +// GetDomainsOk returns a tuple with the Domains field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetDomainsOk() ([]Domain, bool) { + if o == nil { + return nil, false + } + return o.Domains, true +} + +// SetDomains sets field value +func (o *Distribution) SetDomains(v []Domain) { + o.Domains = v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Distribution) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Distribution) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Distribution) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *Distribution) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetId returns the Id field value +func (o *Distribution) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Distribution) SetId(v string) { + o.Id = v +} + +// GetProjectId returns the ProjectId field value +func (o *Distribution) GetProjectId() string { + if o == nil { + var ret string + return ret + } + + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value +func (o *Distribution) SetProjectId(v string) { + o.ProjectId = v +} + +// GetStatus returns the Status field value +func (o *Distribution) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Distribution) SetStatus(v string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *Distribution) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *Distribution) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *Distribution) GetWaf() DistributionWaf { + if o == nil || IsNil(o.Waf) { + var ret DistributionWaf + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Distribution) GetWafOk() (*DistributionWaf, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *Distribution) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given DistributionWaf and assigns it to the Waf field. +func (o *Distribution) SetWaf(v DistributionWaf) { + o.Waf = &v +} + +func (o Distribution) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Distribution) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["config"] = o.Config + toSerialize["createdAt"] = o.CreatedAt + toSerialize["domains"] = o.Domains + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["id"] = o.Id + toSerialize["projectId"] = o.ProjectId + toSerialize["status"] = o.Status + toSerialize["updatedAt"] = o.UpdatedAt + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +func (o *Distribution) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "config", + "createdAt", + "domains", + "id", + "projectId", + "status", + "updatedAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistribution := _Distribution{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistribution) + + if err != nil { + return err + } + + *o = Distribution(varDistribution) + + return err +} + +type NullableDistribution struct { + value *Distribution + isSet bool +} + +func (v NullableDistribution) Get() *Distribution { + return v.value +} + +func (v *NullableDistribution) Set(val *Distribution) { + v.value = val + v.isSet = true +} + +func (v NullableDistribution) IsSet() bool { + return v.isSet +} + +func (v *NullableDistribution) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistribution(val *Distribution) *NullableDistribution { + return &NullableDistribution{value: val, isSet: true} +} + +func (v NullableDistribution) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistribution) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_distribution_logs_record.go b/services/cdn/v1beta2api/model_distribution_logs_record.go new file mode 100644 index 000000000..9e89b1b64 --- /dev/null +++ b/services/cdn/v1beta2api/model_distribution_logs_record.go @@ -0,0 +1,418 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the DistributionLogsRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionLogsRecord{} + +// DistributionLogsRecord struct for DistributionLogsRecord +type DistributionLogsRecord struct { + CacheHit bool `json:"cacheHit"` + DataCenterRegion string `json:"dataCenterRegion"` + DistributionId string `json:"distributionId"` + Host string `json:"host"` + Path string `json:"path"` + // ISO 3166-1 A2 compliant country code + RequestCountryCode string `json:"requestCountryCode"` + Size int64 `json:"size"` + StatusCode int32 `json:"statusCode"` + Timestamp time.Time `json:"timestamp"` + WafViolation *WAFViolation `json:"wafViolation,omitempty"` +} + +type _DistributionLogsRecord DistributionLogsRecord + +// NewDistributionLogsRecord instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecord(cacheHit bool, dataCenterRegion string, distributionId string, host string, path string, requestCountryCode string, size int64, statusCode int32, timestamp time.Time) *DistributionLogsRecord { + this := DistributionLogsRecord{} + this.CacheHit = cacheHit + this.DataCenterRegion = dataCenterRegion + this.DistributionId = distributionId + this.Host = host + this.Path = path + this.RequestCountryCode = requestCountryCode + this.Size = size + this.StatusCode = statusCode + this.Timestamp = timestamp + return &this +} + +// NewDistributionLogsRecordWithDefaults instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecordWithDefaults() *DistributionLogsRecord { + this := DistributionLogsRecord{} + return &this +} + +// GetCacheHit returns the CacheHit field value +func (o *DistributionLogsRecord) GetCacheHit() bool { + if o == nil { + var ret bool + return ret + } + + return o.CacheHit +} + +// GetCacheHitOk returns a tuple with the CacheHit field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetCacheHitOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CacheHit, true +} + +// SetCacheHit sets field value +func (o *DistributionLogsRecord) SetCacheHit(v bool) { + o.CacheHit = v +} + +// GetDataCenterRegion returns the DataCenterRegion field value +func (o *DistributionLogsRecord) GetDataCenterRegion() string { + if o == nil { + var ret string + return ret + } + + return o.DataCenterRegion +} + +// GetDataCenterRegionOk returns a tuple with the DataCenterRegion field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetDataCenterRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DataCenterRegion, true +} + +// SetDataCenterRegion sets field value +func (o *DistributionLogsRecord) SetDataCenterRegion(v string) { + o.DataCenterRegion = v +} + +// GetDistributionId returns the DistributionId field value +func (o *DistributionLogsRecord) GetDistributionId() string { + if o == nil { + var ret string + return ret + } + + return o.DistributionId +} + +// GetDistributionIdOk returns a tuple with the DistributionId field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetDistributionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DistributionId, true +} + +// SetDistributionId sets field value +func (o *DistributionLogsRecord) SetDistributionId(v string) { + o.DistributionId = v +} + +// GetHost returns the Host field value +func (o *DistributionLogsRecord) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *DistributionLogsRecord) SetHost(v string) { + o.Host = v +} + +// GetPath returns the Path field value +func (o *DistributionLogsRecord) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *DistributionLogsRecord) SetPath(v string) { + o.Path = v +} + +// GetRequestCountryCode returns the RequestCountryCode field value +func (o *DistributionLogsRecord) GetRequestCountryCode() string { + if o == nil { + var ret string + return ret + } + + return o.RequestCountryCode +} + +// GetRequestCountryCodeOk returns a tuple with the RequestCountryCode field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetRequestCountryCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestCountryCode, true +} + +// SetRequestCountryCode sets field value +func (o *DistributionLogsRecord) SetRequestCountryCode(v string) { + o.RequestCountryCode = v +} + +// GetSize returns the Size field value +func (o *DistributionLogsRecord) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *DistributionLogsRecord) SetSize(v int64) { + o.Size = v +} + +// GetStatusCode returns the StatusCode field value +func (o *DistributionLogsRecord) GetStatusCode() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetStatusCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.StatusCode, true +} + +// SetStatusCode sets field value +func (o *DistributionLogsRecord) SetStatusCode(v int32) { + o.StatusCode = v +} + +// GetTimestamp returns the Timestamp field value +func (o *DistributionLogsRecord) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *DistributionLogsRecord) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +// GetWafViolation returns the WafViolation field value if set, zero value otherwise. +func (o *DistributionLogsRecord) GetWafViolation() WAFViolation { + if o == nil || IsNil(o.WafViolation) { + var ret WAFViolation + return ret + } + return *o.WafViolation +} + +// GetWafViolationOk returns a tuple with the WafViolation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetWafViolationOk() (*WAFViolation, bool) { + if o == nil || IsNil(o.WafViolation) { + return nil, false + } + return o.WafViolation, true +} + +// HasWafViolation returns a boolean if a field has been set. +func (o *DistributionLogsRecord) HasWafViolation() bool { + if o != nil && !IsNil(o.WafViolation) { + return true + } + + return false +} + +// SetWafViolation gets a reference to the given WAFViolation and assigns it to the WafViolation field. +func (o *DistributionLogsRecord) SetWafViolation(v WAFViolation) { + o.WafViolation = &v +} + +func (o DistributionLogsRecord) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionLogsRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cacheHit"] = o.CacheHit + toSerialize["dataCenterRegion"] = o.DataCenterRegion + toSerialize["distributionId"] = o.DistributionId + toSerialize["host"] = o.Host + toSerialize["path"] = o.Path + toSerialize["requestCountryCode"] = o.RequestCountryCode + toSerialize["size"] = o.Size + toSerialize["statusCode"] = o.StatusCode + toSerialize["timestamp"] = o.Timestamp + if !IsNil(o.WafViolation) { + toSerialize["wafViolation"] = o.WafViolation + } + return toSerialize, nil +} + +func (o *DistributionLogsRecord) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cacheHit", + "dataCenterRegion", + "distributionId", + "host", + "path", + "requestCountryCode", + "size", + "statusCode", + "timestamp", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionLogsRecord := _DistributionLogsRecord{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionLogsRecord) + + if err != nil { + return err + } + + *o = DistributionLogsRecord(varDistributionLogsRecord) + + return err +} + +type NullableDistributionLogsRecord struct { + value *DistributionLogsRecord + isSet bool +} + +func (v NullableDistributionLogsRecord) Get() *DistributionLogsRecord { + return v.value +} + +func (v *NullableDistributionLogsRecord) Set(val *DistributionLogsRecord) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionLogsRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionLogsRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionLogsRecord(val *DistributionLogsRecord) *NullableDistributionLogsRecord { + return &NullableDistributionLogsRecord{value: val, isSet: true} +} + +func (v NullableDistributionLogsRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionLogsRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_distribution_statistics_record.go b/services/cdn/v1beta2api/model_distribution_statistics_record.go new file mode 100644 index 000000000..a5baab869 --- /dev/null +++ b/services/cdn/v1beta2api/model_distribution_statistics_record.go @@ -0,0 +1,302 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the DistributionStatisticsRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecord{} + +// DistributionStatisticsRecord Aggregated statistics of a distribution during a time interval +type DistributionStatisticsRecord struct { + // Number of cached requests that were served + CachedRequests int64 `json:"cachedRequests"` + // Total number of requests that were served + TotalRequests int64 `json:"totalRequests"` + // Total traffic in bytes that occurred during the time interval + TotalTrafficBytes int64 `json:"totalTrafficBytes"` + // Exclusive end of the time interval the statistics refer to + End time.Time `json:"end"` + Regions DistributionStatisticsRecordRegions `json:"regions"` + // Start of the time interval the statistics refer to + Start time.Time `json:"start"` +} + +type _DistributionStatisticsRecord DistributionStatisticsRecord + +// NewDistributionStatisticsRecord instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecord(cachedRequests int64, totalRequests int64, totalTrafficBytes int64, end time.Time, regions DistributionStatisticsRecordRegions, start time.Time) *DistributionStatisticsRecord { + this := DistributionStatisticsRecord{} + this.CachedRequests = cachedRequests + this.TotalRequests = totalRequests + this.TotalTrafficBytes = totalTrafficBytes + this.End = end + this.Regions = regions + this.Start = start + return &this +} + +// NewDistributionStatisticsRecordWithDefaults instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecordWithDefaults() *DistributionStatisticsRecord { + this := DistributionStatisticsRecord{} + return &this +} + +// GetCachedRequests returns the CachedRequests field value +func (o *DistributionStatisticsRecord) GetCachedRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.CachedRequests +} + +// GetCachedRequestsOk returns a tuple with the CachedRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetCachedRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.CachedRequests, true +} + +// SetCachedRequests sets field value +func (o *DistributionStatisticsRecord) SetCachedRequests(v int64) { + o.CachedRequests = v +} + +// GetTotalRequests returns the TotalRequests field value +func (o *DistributionStatisticsRecord) GetTotalRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalRequests +} + +// GetTotalRequestsOk returns a tuple with the TotalRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetTotalRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequests, true +} + +// SetTotalRequests sets field value +func (o *DistributionStatisticsRecord) SetTotalRequests(v int64) { + o.TotalRequests = v +} + +// GetTotalTrafficBytes returns the TotalTrafficBytes field value +func (o *DistributionStatisticsRecord) GetTotalTrafficBytes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalTrafficBytes +} + +// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetTotalTrafficBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalTrafficBytes, true +} + +// SetTotalTrafficBytes sets field value +func (o *DistributionStatisticsRecord) SetTotalTrafficBytes(v int64) { + o.TotalTrafficBytes = v +} + +// GetEnd returns the End field value +func (o *DistributionStatisticsRecord) GetEnd() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetEndOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value +func (o *DistributionStatisticsRecord) SetEnd(v time.Time) { + o.End = v +} + +// GetRegions returns the Regions field value +func (o *DistributionStatisticsRecord) GetRegions() DistributionStatisticsRecordRegions { + if o == nil { + var ret DistributionStatisticsRecordRegions + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetRegionsOk() (*DistributionStatisticsRecordRegions, bool) { + if o == nil { + return nil, false + } + return &o.Regions, true +} + +// SetRegions sets field value +func (o *DistributionStatisticsRecord) SetRegions(v DistributionStatisticsRecordRegions) { + o.Regions = v +} + +// GetStart returns the Start field value +func (o *DistributionStatisticsRecord) GetStart() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetStartOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value +func (o *DistributionStatisticsRecord) SetStart(v time.Time) { + o.Start = v +} + +func (o DistributionStatisticsRecord) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cachedRequests"] = o.CachedRequests + toSerialize["totalRequests"] = o.TotalRequests + toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes + toSerialize["end"] = o.End + toSerialize["regions"] = o.Regions + toSerialize["start"] = o.Start + return toSerialize, nil +} + +func (o *DistributionStatisticsRecord) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cachedRequests", + "totalRequests", + "totalTrafficBytes", + "end", + "regions", + "start", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecord := _DistributionStatisticsRecord{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecord) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecord(varDistributionStatisticsRecord) + + return err +} + +type NullableDistributionStatisticsRecord struct { + value *DistributionStatisticsRecord + isSet bool +} + +func (v NullableDistributionStatisticsRecord) Get() *DistributionStatisticsRecord { + return v.value +} + +func (v *NullableDistributionStatisticsRecord) Set(val *DistributionStatisticsRecord) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecord(val *DistributionStatisticsRecord) *NullableDistributionStatisticsRecord { + return &NullableDistributionStatisticsRecord{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_distribution_statistics_record_entry.go b/services/cdn/v1beta2api/model_distribution_statistics_record_entry.go new file mode 100644 index 000000000..953470fe6 --- /dev/null +++ b/services/cdn/v1beta2api/model_distribution_statistics_record_entry.go @@ -0,0 +1,215 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionStatisticsRecordEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecordEntry{} + +// DistributionStatisticsRecordEntry struct for DistributionStatisticsRecordEntry +type DistributionStatisticsRecordEntry struct { + // Number of cached requests that were served + CachedRequests int64 `json:"cachedRequests"` + // Total number of requests that were served + TotalRequests int64 `json:"totalRequests"` + // Total traffic in bytes that occurred during the time interval + TotalTrafficBytes int64 `json:"totalTrafficBytes"` +} + +type _DistributionStatisticsRecordEntry DistributionStatisticsRecordEntry + +// NewDistributionStatisticsRecordEntry instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntry(cachedRequests int64, totalRequests int64, totalTrafficBytes int64) *DistributionStatisticsRecordEntry { + this := DistributionStatisticsRecordEntry{} + this.CachedRequests = cachedRequests + this.TotalRequests = totalRequests + this.TotalTrafficBytes = totalTrafficBytes + return &this +} + +// NewDistributionStatisticsRecordEntryWithDefaults instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntryWithDefaults() *DistributionStatisticsRecordEntry { + this := DistributionStatisticsRecordEntry{} + return &this +} + +// GetCachedRequests returns the CachedRequests field value +func (o *DistributionStatisticsRecordEntry) GetCachedRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.CachedRequests +} + +// GetCachedRequestsOk returns a tuple with the CachedRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetCachedRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.CachedRequests, true +} + +// SetCachedRequests sets field value +func (o *DistributionStatisticsRecordEntry) SetCachedRequests(v int64) { + o.CachedRequests = v +} + +// GetTotalRequests returns the TotalRequests field value +func (o *DistributionStatisticsRecordEntry) GetTotalRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalRequests +} + +// GetTotalRequestsOk returns a tuple with the TotalRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetTotalRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequests, true +} + +// SetTotalRequests sets field value +func (o *DistributionStatisticsRecordEntry) SetTotalRequests(v int64) { + o.TotalRequests = v +} + +// GetTotalTrafficBytes returns the TotalTrafficBytes field value +func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalTrafficBytes +} + +// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalTrafficBytes, true +} + +// SetTotalTrafficBytes sets field value +func (o *DistributionStatisticsRecordEntry) SetTotalTrafficBytes(v int64) { + o.TotalTrafficBytes = v +} + +func (o DistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecordEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cachedRequests"] = o.CachedRequests + toSerialize["totalRequests"] = o.TotalRequests + toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes + return toSerialize, nil +} + +func (o *DistributionStatisticsRecordEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cachedRequests", + "totalRequests", + "totalTrafficBytes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecordEntry := _DistributionStatisticsRecordEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecordEntry) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecordEntry(varDistributionStatisticsRecordEntry) + + return err +} + +type NullableDistributionStatisticsRecordEntry struct { + value *DistributionStatisticsRecordEntry + isSet bool +} + +func (v NullableDistributionStatisticsRecordEntry) Get() *DistributionStatisticsRecordEntry { + return v.value +} + +func (v *NullableDistributionStatisticsRecordEntry) Set(val *DistributionStatisticsRecordEntry) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecordEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecordEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecordEntry(val *DistributionStatisticsRecordEntry) *NullableDistributionStatisticsRecordEntry { + return &NullableDistributionStatisticsRecordEntry{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecordEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_distribution_statistics_record_regions.go b/services/cdn/v1beta2api/model_distribution_statistics_record_regions.go new file mode 100644 index 000000000..0bff23445 --- /dev/null +++ b/services/cdn/v1beta2api/model_distribution_statistics_record_regions.go @@ -0,0 +1,268 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionStatisticsRecordRegions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecordRegions{} + +// DistributionStatisticsRecordRegions Mapping of regions to the metrics for this region for the defined time interval All regions are always present. If no traffic was reported for a region, it will still contain 0-filled properties +type DistributionStatisticsRecordRegions struct { + AF DistributionStatisticsRecordEntry `json:"AF"` + ASIA DistributionStatisticsRecordEntry `json:"ASIA"` + EU DistributionStatisticsRecordEntry `json:"EU"` + SA DistributionStatisticsRecordEntry `json:"SA"` + US DistributionStatisticsRecordEntry `json:"US"` +} + +type _DistributionStatisticsRecordRegions DistributionStatisticsRecordRegions + +// NewDistributionStatisticsRecordRegions instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegions(aF DistributionStatisticsRecordEntry, aSIA DistributionStatisticsRecordEntry, eU DistributionStatisticsRecordEntry, sA DistributionStatisticsRecordEntry, uS DistributionStatisticsRecordEntry) *DistributionStatisticsRecordRegions { + this := DistributionStatisticsRecordRegions{} + this.AF = aF + this.ASIA = aSIA + this.EU = eU + this.SA = sA + this.US = uS + return &this +} + +// NewDistributionStatisticsRecordRegionsWithDefaults instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegionsWithDefaults() *DistributionStatisticsRecordRegions { + this := DistributionStatisticsRecordRegions{} + return &this +} + +// GetAF returns the AF field value +func (o *DistributionStatisticsRecordRegions) GetAF() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.AF +} + +// GetAFOk returns a tuple with the AF field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetAFOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.AF, true +} + +// SetAF sets field value +func (o *DistributionStatisticsRecordRegions) SetAF(v DistributionStatisticsRecordEntry) { + o.AF = v +} + +// GetASIA returns the ASIA field value +func (o *DistributionStatisticsRecordRegions) GetASIA() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.ASIA +} + +// GetASIAOk returns a tuple with the ASIA field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetASIAOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.ASIA, true +} + +// SetASIA sets field value +func (o *DistributionStatisticsRecordRegions) SetASIA(v DistributionStatisticsRecordEntry) { + o.ASIA = v +} + +// GetEU returns the EU field value +func (o *DistributionStatisticsRecordRegions) GetEU() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.EU +} + +// GetEUOk returns a tuple with the EU field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetEUOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.EU, true +} + +// SetEU sets field value +func (o *DistributionStatisticsRecordRegions) SetEU(v DistributionStatisticsRecordEntry) { + o.EU = v +} + +// GetSA returns the SA field value +func (o *DistributionStatisticsRecordRegions) GetSA() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.SA +} + +// GetSAOk returns a tuple with the SA field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetSAOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.SA, true +} + +// SetSA sets field value +func (o *DistributionStatisticsRecordRegions) SetSA(v DistributionStatisticsRecordEntry) { + o.SA = v +} + +// GetUS returns the US field value +func (o *DistributionStatisticsRecordRegions) GetUS() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.US +} + +// GetUSOk returns a tuple with the US field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetUSOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.US, true +} + +// SetUS sets field value +func (o *DistributionStatisticsRecordRegions) SetUS(v DistributionStatisticsRecordEntry) { + o.US = v +} + +func (o DistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecordRegions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["AF"] = o.AF + toSerialize["ASIA"] = o.ASIA + toSerialize["EU"] = o.EU + toSerialize["SA"] = o.SA + toSerialize["US"] = o.US + return toSerialize, nil +} + +func (o *DistributionStatisticsRecordRegions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "AF", + "ASIA", + "EU", + "SA", + "US", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecordRegions := _DistributionStatisticsRecordRegions{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecordRegions) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecordRegions(varDistributionStatisticsRecordRegions) + + return err +} + +type NullableDistributionStatisticsRecordRegions struct { + value *DistributionStatisticsRecordRegions + isSet bool +} + +func (v NullableDistributionStatisticsRecordRegions) Get() *DistributionStatisticsRecordRegions { + return v.value +} + +func (v *NullableDistributionStatisticsRecordRegions) Set(val *DistributionStatisticsRecordRegions) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecordRegions) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecordRegions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecordRegions(val *DistributionStatisticsRecordRegions) *NullableDistributionStatisticsRecordRegions { + return &NullableDistributionStatisticsRecordRegions{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecordRegions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_distribution_waf.go b/services/cdn/v1beta2api/model_distribution_waf.go new file mode 100644 index 000000000..c6b718c56 --- /dev/null +++ b/services/cdn/v1beta2api/model_distribution_waf.go @@ -0,0 +1,212 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionWaf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionWaf{} + +// DistributionWaf For this property to be present two pre-conditions must be met: - the WAF was enabled at least once - the query parameter ?withWafStatus is truthy This property contains the waf Status. At this point in time, this contains all resolved rules. Rules are split into 3 groups: - enabledRules - logOnlyRules - disabledRules **Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!** +type DistributionWaf struct { + DisabledRules []WafStatusRuleBlock `json:"disabledRules"` + EnabledRules []WafStatusRuleBlock `json:"enabledRules"` + LogOnlyRules []WafStatusRuleBlock `json:"logOnlyRules"` +} + +type _DistributionWaf DistributionWaf + +// NewDistributionWaf instantiates a new DistributionWaf 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 NewDistributionWaf(disabledRules []WafStatusRuleBlock, enabledRules []WafStatusRuleBlock, logOnlyRules []WafStatusRuleBlock) *DistributionWaf { + this := DistributionWaf{} + this.DisabledRules = disabledRules + this.EnabledRules = enabledRules + this.LogOnlyRules = logOnlyRules + return &this +} + +// NewDistributionWafWithDefaults instantiates a new DistributionWaf 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 NewDistributionWafWithDefaults() *DistributionWaf { + this := DistributionWaf{} + return &this +} + +// GetDisabledRules returns the DisabledRules field value +func (o *DistributionWaf) GetDisabledRules() []WafStatusRuleBlock { + if o == nil { + var ret []WafStatusRuleBlock + return ret + } + + return o.DisabledRules +} + +// GetDisabledRulesOk returns a tuple with the DisabledRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetDisabledRulesOk() ([]WafStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.DisabledRules, true +} + +// SetDisabledRules sets field value +func (o *DistributionWaf) SetDisabledRules(v []WafStatusRuleBlock) { + o.DisabledRules = v +} + +// GetEnabledRules returns the EnabledRules field value +func (o *DistributionWaf) GetEnabledRules() []WafStatusRuleBlock { + if o == nil { + var ret []WafStatusRuleBlock + return ret + } + + return o.EnabledRules +} + +// GetEnabledRulesOk returns a tuple with the EnabledRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetEnabledRulesOk() ([]WafStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.EnabledRules, true +} + +// SetEnabledRules sets field value +func (o *DistributionWaf) SetEnabledRules(v []WafStatusRuleBlock) { + o.EnabledRules = v +} + +// GetLogOnlyRules returns the LogOnlyRules field value +func (o *DistributionWaf) GetLogOnlyRules() []WafStatusRuleBlock { + if o == nil { + var ret []WafStatusRuleBlock + return ret + } + + return o.LogOnlyRules +} + +// GetLogOnlyRulesOk returns a tuple with the LogOnlyRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetLogOnlyRulesOk() ([]WafStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.LogOnlyRules, true +} + +// SetLogOnlyRules sets field value +func (o *DistributionWaf) SetLogOnlyRules(v []WafStatusRuleBlock) { + o.LogOnlyRules = v +} + +func (o DistributionWaf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionWaf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["disabledRules"] = o.DisabledRules + toSerialize["enabledRules"] = o.EnabledRules + toSerialize["logOnlyRules"] = o.LogOnlyRules + return toSerialize, nil +} + +func (o *DistributionWaf) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "disabledRules", + "enabledRules", + "logOnlyRules", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionWaf := _DistributionWaf{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionWaf) + + if err != nil { + return err + } + + *o = DistributionWaf(varDistributionWaf) + + return err +} + +type NullableDistributionWaf struct { + value *DistributionWaf + isSet bool +} + +func (v NullableDistributionWaf) Get() *DistributionWaf { + return v.value +} + +func (v *NullableDistributionWaf) Set(val *DistributionWaf) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionWaf) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionWaf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionWaf(val *DistributionWaf) *NullableDistributionWaf { + return &NullableDistributionWaf{value: val, isSet: true} +} + +func (v NullableDistributionWaf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionWaf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_domain.go b/services/cdn/v1beta2api/model_domain.go new file mode 100644 index 000000000..50e9d4f4d --- /dev/null +++ b/services/cdn/v1beta2api/model_domain.go @@ -0,0 +1,251 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Domain type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Domain{} + +// Domain Definition of a custom or managed domain without any certificates or keys +type Domain struct { + // This object is present if the custom domain has errors. + Errors []StatusError `json:"errors,omitempty"` + // The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint + Name string `json:"name"` + Status DomainStatus `json:"status"` + // Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint + Type string `json:"type"` +} + +type _Domain Domain + +// NewDomain instantiates a new Domain 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 NewDomain(name string, status DomainStatus, types string) *Domain { + this := Domain{} + this.Name = name + this.Status = status + this.Type = types + return &this +} + +// NewDomainWithDefaults instantiates a new Domain 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 NewDomainWithDefaults() *Domain { + this := Domain{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Domain) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Domain) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Domain) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *Domain) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetName returns the Name field value +func (o *Domain) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Domain) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Domain) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *Domain) GetStatus() DomainStatus { + if o == nil { + var ret DomainStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Domain) GetStatusOk() (*DomainStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Domain) SetStatus(v DomainStatus) { + o.Status = v +} + +// GetType returns the Type field value +func (o *Domain) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Domain) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Domain) SetType(v string) { + o.Type = v +} + +func (o Domain) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Domain) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *Domain) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "status", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDomain := _Domain{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDomain) + + if err != nil { + return err + } + + *o = Domain(varDomain) + + return err +} + +type NullableDomain struct { + value *Domain + isSet bool +} + +func (v NullableDomain) Get() *Domain { + return v.value +} + +func (v *NullableDomain) Set(val *Domain) { + v.value = val + v.isSet = true +} + +func (v NullableDomain) IsSet() bool { + return v.isSet +} + +func (v *NullableDomain) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomain(val *Domain) *NullableDomain { + return &NullableDomain{value: val, isSet: true} +} + +func (v NullableDomain) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomain) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_domain_status.go b/services/cdn/v1beta2api/model_domain_status.go new file mode 100644 index 000000000..1d411dd23 --- /dev/null +++ b/services/cdn/v1beta2api/model_domain_status.go @@ -0,0 +1,116 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// DomainStatus The status of the domain: CREATING indicates that the custom domain is being set up. UPDATING means that requested changes are being applied to the custom domain. ACTIVE means the custom domain is currently configured and active. DELETING means that the domain is in the process of being removed from the distribution. In case the domain has the ERROR state, more information will be available in the errors list. +type DomainStatus string + +// List of DomainStatus +const ( + DOMAINSTATUS_CREATING DomainStatus = "CREATING" + DOMAINSTATUS_ACTIVE DomainStatus = "ACTIVE" + DOMAINSTATUS_UPDATING DomainStatus = "UPDATING" + DOMAINSTATUS_DELETING DomainStatus = "DELETING" + DOMAINSTATUS_ERROR DomainStatus = "ERROR" +) + +// All allowed values of DomainStatus enum +var AllowedDomainStatusEnumValues = []DomainStatus{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "ERROR", +} + +func (v *DomainStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DomainStatus(value) + for _, existing := range AllowedDomainStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DomainStatus", value) +} + +// NewDomainStatusFromValue returns a pointer to a valid DomainStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDomainStatusFromValue(v string) (*DomainStatus, error) { + ev := DomainStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainStatus: valid values are %v", v, AllowedDomainStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DomainStatus) IsValid() bool { + for _, existing := range AllowedDomainStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DomainStatus value +func (v DomainStatus) Ptr() *DomainStatus { + return &v +} + +type NullableDomainStatus struct { + value *DomainStatus + isSet bool +} + +func (v NullableDomainStatus) Get() *DomainStatus { + return v.value +} + +func (v *NullableDomainStatus) Set(val *DomainStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDomainStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainStatus(val *DomainStatus) *NullableDomainStatus { + return &NullableDomainStatus{value: val, isSet: true} +} + +func (v NullableDomainStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_error_details.go b/services/cdn/v1beta2api/model_error_details.go new file mode 100644 index 000000000..63b16df4a --- /dev/null +++ b/services/cdn/v1beta2api/model_error_details.go @@ -0,0 +1,259 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ErrorDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorDetails{} + +// ErrorDetails struct for ErrorDetails +type ErrorDetails struct { + // German description of the error + De *string `json:"de,omitempty"` + // English description of the error + En string `json:"en"` + // Optional field in the request this error detail refers to + Field *string `json:"field,omitempty"` + Key string `json:"key"` +} + +type _ErrorDetails ErrorDetails + +// NewErrorDetails instantiates a new ErrorDetails 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 NewErrorDetails(en string, key string) *ErrorDetails { + this := ErrorDetails{} + this.En = en + this.Key = key + return &this +} + +// NewErrorDetailsWithDefaults instantiates a new ErrorDetails 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 NewErrorDetailsWithDefaults() *ErrorDetails { + this := ErrorDetails{} + return &this +} + +// GetDe returns the De field value if set, zero value otherwise. +func (o *ErrorDetails) GetDe() string { + if o == nil || IsNil(o.De) { + var ret string + return ret + } + return *o.De +} + +// GetDeOk returns a tuple with the De field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetDeOk() (*string, bool) { + if o == nil || IsNil(o.De) { + return nil, false + } + return o.De, true +} + +// HasDe returns a boolean if a field has been set. +func (o *ErrorDetails) HasDe() bool { + if o != nil && !IsNil(o.De) { + return true + } + + return false +} + +// SetDe gets a reference to the given string and assigns it to the De field. +func (o *ErrorDetails) SetDe(v string) { + o.De = &v +} + +// GetEn returns the En field value +func (o *ErrorDetails) GetEn() string { + if o == nil { + var ret string + return ret + } + + return o.En +} + +// GetEnOk returns a tuple with the En field value +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetEnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.En, true +} + +// SetEn sets field value +func (o *ErrorDetails) SetEn(v string) { + o.En = v +} + +// GetField returns the Field field value if set, zero value otherwise. +func (o *ErrorDetails) GetField() string { + if o == nil || IsNil(o.Field) { + var ret string + return ret + } + return *o.Field +} + +// GetFieldOk returns a tuple with the Field field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetFieldOk() (*string, bool) { + if o == nil || IsNil(o.Field) { + return nil, false + } + return o.Field, true +} + +// HasField returns a boolean if a field has been set. +func (o *ErrorDetails) HasField() bool { + if o != nil && !IsNil(o.Field) { + return true + } + + return false +} + +// SetField gets a reference to the given string and assigns it to the Field field. +func (o *ErrorDetails) SetField(v string) { + o.Field = &v +} + +// GetKey returns the Key field value +func (o *ErrorDetails) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *ErrorDetails) SetKey(v string) { + o.Key = v +} + +func (o ErrorDetails) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.De) { + toSerialize["de"] = o.De + } + toSerialize["en"] = o.En + if !IsNil(o.Field) { + toSerialize["field"] = o.Field + } + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *ErrorDetails) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "en", + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varErrorDetails := _ErrorDetails{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varErrorDetails) + + if err != nil { + return err + } + + *o = ErrorDetails(varErrorDetails) + + return err +} + +type NullableErrorDetails struct { + value *ErrorDetails + isSet bool +} + +func (v NullableErrorDetails) Get() *ErrorDetails { + return v.value +} + +func (v *NullableErrorDetails) Set(val *ErrorDetails) { + v.value = val + v.isSet = true +} + +func (v NullableErrorDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorDetails(val *ErrorDetails) *NullableErrorDetails { + return &NullableErrorDetails{value: val, isSet: true} +} + +func (v NullableErrorDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_find_cache_paths_response.go b/services/cdn/v1beta2api/model_find_cache_paths_response.go new file mode 100644 index 000000000..c94e679b0 --- /dev/null +++ b/services/cdn/v1beta2api/model_find_cache_paths_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the FindCachePathsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindCachePathsResponse{} + +// FindCachePathsResponse struct for FindCachePathsResponse +type FindCachePathsResponse struct { + Response []FindCachePathsResponseEntry `json:"response"` +} + +type _FindCachePathsResponse FindCachePathsResponse + +// NewFindCachePathsResponse instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponse(response []FindCachePathsResponseEntry) *FindCachePathsResponse { + this := FindCachePathsResponse{} + this.Response = response + return &this +} + +// NewFindCachePathsResponseWithDefaults instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponseWithDefaults() *FindCachePathsResponse { + this := FindCachePathsResponse{} + return &this +} + +// GetResponse returns the Response field value +func (o *FindCachePathsResponse) GetResponse() []FindCachePathsResponseEntry { + if o == nil { + var ret []FindCachePathsResponseEntry + return ret + } + + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value +// and a boolean to check if the value has been set. +func (o *FindCachePathsResponse) GetResponseOk() ([]FindCachePathsResponseEntry, bool) { + if o == nil { + return nil, false + } + return o.Response, true +} + +// SetResponse sets field value +func (o *FindCachePathsResponse) SetResponse(v []FindCachePathsResponseEntry) { + o.Response = v +} + +func (o FindCachePathsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindCachePathsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["response"] = o.Response + return toSerialize, nil +} + +func (o *FindCachePathsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "response", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFindCachePathsResponse := _FindCachePathsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFindCachePathsResponse) + + if err != nil { + return err + } + + *o = FindCachePathsResponse(varFindCachePathsResponse) + + return err +} + +type NullableFindCachePathsResponse struct { + value *FindCachePathsResponse + isSet bool +} + +func (v NullableFindCachePathsResponse) Get() *FindCachePathsResponse { + return v.value +} + +func (v *NullableFindCachePathsResponse) Set(val *FindCachePathsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFindCachePathsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFindCachePathsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindCachePathsResponse(val *FindCachePathsResponse) *NullableFindCachePathsResponse { + return &NullableFindCachePathsResponse{value: val, isSet: true} +} + +func (v NullableFindCachePathsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindCachePathsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_find_cache_paths_response_entry.go b/services/cdn/v1beta2api/model_find_cache_paths_response_entry.go new file mode 100644 index 000000000..f2e5ca01d --- /dev/null +++ b/services/cdn/v1beta2api/model_find_cache_paths_response_entry.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the FindCachePathsResponseEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindCachePathsResponseEntry{} + +// FindCachePathsResponseEntry struct for FindCachePathsResponseEntry +type FindCachePathsResponseEntry struct { + // Defines one path that was previously used as part of a granular purge + Path string `json:"path"` +} + +type _FindCachePathsResponseEntry FindCachePathsResponseEntry + +// NewFindCachePathsResponseEntry instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntry(path string) *FindCachePathsResponseEntry { + this := FindCachePathsResponseEntry{} + this.Path = path + return &this +} + +// NewFindCachePathsResponseEntryWithDefaults instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntryWithDefaults() *FindCachePathsResponseEntry { + this := FindCachePathsResponseEntry{} + return &this +} + +// GetPath returns the Path field value +func (o *FindCachePathsResponseEntry) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *FindCachePathsResponseEntry) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *FindCachePathsResponseEntry) SetPath(v string) { + o.Path = v +} + +func (o FindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindCachePathsResponseEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["path"] = o.Path + return toSerialize, nil +} + +func (o *FindCachePathsResponseEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "path", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFindCachePathsResponseEntry := _FindCachePathsResponseEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFindCachePathsResponseEntry) + + if err != nil { + return err + } + + *o = FindCachePathsResponseEntry(varFindCachePathsResponseEntry) + + return err +} + +type NullableFindCachePathsResponseEntry struct { + value *FindCachePathsResponseEntry + isSet bool +} + +func (v NullableFindCachePathsResponseEntry) Get() *FindCachePathsResponseEntry { + return v.value +} + +func (v *NullableFindCachePathsResponseEntry) Set(val *FindCachePathsResponseEntry) { + v.value = val + v.isSet = true +} + +func (v NullableFindCachePathsResponseEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableFindCachePathsResponseEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindCachePathsResponseEntry(val *FindCachePathsResponseEntry) *NullableFindCachePathsResponseEntry { + return &NullableFindCachePathsResponseEntry{value: val, isSet: true} +} + +func (v NullableFindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindCachePathsResponseEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_generic_json_response.go b/services/cdn/v1beta2api/model_generic_json_response.go new file mode 100644 index 000000000..94290ab4d --- /dev/null +++ b/services/cdn/v1beta2api/model_generic_json_response.go @@ -0,0 +1,193 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GenericJsonResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenericJsonResponse{} + +// GenericJsonResponse struct for GenericJsonResponse +type GenericJsonResponse struct { + // Listing of issues with your request + Details []ErrorDetails `json:"details,omitempty"` + Message string `json:"message"` +} + +type _GenericJsonResponse GenericJsonResponse + +// NewGenericJsonResponse instantiates a new GenericJsonResponse 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 NewGenericJsonResponse(message string) *GenericJsonResponse { + this := GenericJsonResponse{} + this.Message = message + return &this +} + +// NewGenericJsonResponseWithDefaults instantiates a new GenericJsonResponse 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 NewGenericJsonResponseWithDefaults() *GenericJsonResponse { + this := GenericJsonResponse{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *GenericJsonResponse) GetDetails() []ErrorDetails { + if o == nil || IsNil(o.Details) { + var ret []ErrorDetails + return ret + } + return o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericJsonResponse) GetDetailsOk() ([]ErrorDetails, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *GenericJsonResponse) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given []ErrorDetails and assigns it to the Details field. +func (o *GenericJsonResponse) SetDetails(v []ErrorDetails) { + o.Details = v +} + +// GetMessage returns the Message field value +func (o *GenericJsonResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *GenericJsonResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *GenericJsonResponse) SetMessage(v string) { + o.Message = v +} + +func (o GenericJsonResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericJsonResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["message"] = o.Message + return toSerialize, nil +} + +func (o *GenericJsonResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGenericJsonResponse := _GenericJsonResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGenericJsonResponse) + + if err != nil { + return err + } + + *o = GenericJsonResponse(varGenericJsonResponse) + + return err +} + +type NullableGenericJsonResponse struct { + value *GenericJsonResponse + isSet bool +} + +func (v NullableGenericJsonResponse) Get() *GenericJsonResponse { + return v.value +} + +func (v *NullableGenericJsonResponse) Set(val *GenericJsonResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGenericJsonResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericJsonResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericJsonResponse(val *GenericJsonResponse) *NullableGenericJsonResponse { + return &NullableGenericJsonResponse{value: val, isSet: true} +} + +func (v NullableGenericJsonResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericJsonResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_cache_info_response.go b/services/cdn/v1beta2api/model_get_cache_info_response.go new file mode 100644 index 000000000..1640235b9 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_cache_info_response.go @@ -0,0 +1,188 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the GetCacheInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCacheInfoResponse{} + +// GetCacheInfoResponse struct for GetCacheInfoResponse +type GetCacheInfoResponse struct { + History []GetCacheInfoResponseHistoryEntry `json:"history"` + // Returns the last time the cache was purged by calling the PurgeCache endpoint. Time represented as RFC3339 compliant string. If the cache was never purged, this returns `null` + LastPurgeTime NullableTime `json:"lastPurgeTime"` +} + +type _GetCacheInfoResponse GetCacheInfoResponse + +// NewGetCacheInfoResponse instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponse(history []GetCacheInfoResponseHistoryEntry, lastPurgeTime NullableTime) *GetCacheInfoResponse { + this := GetCacheInfoResponse{} + this.History = history + this.LastPurgeTime = lastPurgeTime + return &this +} + +// NewGetCacheInfoResponseWithDefaults instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponseWithDefaults() *GetCacheInfoResponse { + this := GetCacheInfoResponse{} + return &this +} + +// GetHistory returns the History field value +func (o *GetCacheInfoResponse) GetHistory() []GetCacheInfoResponseHistoryEntry { + if o == nil { + var ret []GetCacheInfoResponseHistoryEntry + return ret + } + + return o.History +} + +// GetHistoryOk returns a tuple with the History field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponse) GetHistoryOk() ([]GetCacheInfoResponseHistoryEntry, bool) { + if o == nil { + return nil, false + } + return o.History, true +} + +// SetHistory sets field value +func (o *GetCacheInfoResponse) SetHistory(v []GetCacheInfoResponseHistoryEntry) { + o.History = v +} + +// GetLastPurgeTime returns the LastPurgeTime field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *GetCacheInfoResponse) GetLastPurgeTime() time.Time { + if o == nil || o.LastPurgeTime.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastPurgeTime.Get() +} + +// GetLastPurgeTimeOk returns a tuple with the LastPurgeTime field value +// 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 *GetCacheInfoResponse) GetLastPurgeTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastPurgeTime.Get(), o.LastPurgeTime.IsSet() +} + +// SetLastPurgeTime sets field value +func (o *GetCacheInfoResponse) SetLastPurgeTime(v time.Time) { + o.LastPurgeTime.Set(&v) +} + +func (o GetCacheInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCacheInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["history"] = o.History + toSerialize["lastPurgeTime"] = o.LastPurgeTime.Get() + return toSerialize, nil +} + +func (o *GetCacheInfoResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "history", + "lastPurgeTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCacheInfoResponse := _GetCacheInfoResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCacheInfoResponse) + + if err != nil { + return err + } + + *o = GetCacheInfoResponse(varGetCacheInfoResponse) + + return err +} + +type NullableGetCacheInfoResponse struct { + value *GetCacheInfoResponse + isSet bool +} + +func (v NullableGetCacheInfoResponse) Get() *GetCacheInfoResponse { + return v.value +} + +func (v *NullableGetCacheInfoResponse) Set(val *GetCacheInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponse(val *GetCacheInfoResponse) *NullableGetCacheInfoResponse { + return &NullableGetCacheInfoResponse{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go b/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go new file mode 100644 index 000000000..47a6544c1 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_cache_info_response_history_entry.go @@ -0,0 +1,185 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the GetCacheInfoResponseHistoryEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} + +// GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry +type GetCacheInfoResponseHistoryEntry struct { + OccurredAt time.Time `json:"occurredAt"` + Type string `json:"type"` +} + +type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry + +// NewGetCacheInfoResponseHistoryEntry instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntry(occurredAt time.Time, types string) *GetCacheInfoResponseHistoryEntry { + this := GetCacheInfoResponseHistoryEntry{} + this.OccurredAt = occurredAt + this.Type = types + return &this +} + +// NewGetCacheInfoResponseHistoryEntryWithDefaults instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntryWithDefaults() *GetCacheInfoResponseHistoryEntry { + this := GetCacheInfoResponseHistoryEntry{} + return &this +} + +// GetOccurredAt returns the OccurredAt field value +func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.OccurredAt +} + +// GetOccurredAtOk returns a tuple with the OccurredAt field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.OccurredAt, true +} + +// SetOccurredAt sets field value +func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v time.Time) { + o.OccurredAt = v +} + +// GetType returns the Type field value +func (o *GetCacheInfoResponseHistoryEntry) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCacheInfoResponseHistoryEntry) SetType(v string) { + o.Type = v +} + +func (o GetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCacheInfoResponseHistoryEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["occurredAt"] = o.OccurredAt + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *GetCacheInfoResponseHistoryEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "occurredAt", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCacheInfoResponseHistoryEntry := _GetCacheInfoResponseHistoryEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCacheInfoResponseHistoryEntry) + + if err != nil { + return err + } + + *o = GetCacheInfoResponseHistoryEntry(varGetCacheInfoResponseHistoryEntry) + + return err +} + +type NullableGetCacheInfoResponseHistoryEntry struct { + value *GetCacheInfoResponseHistoryEntry + isSet bool +} + +func (v NullableGetCacheInfoResponseHistoryEntry) Get() *GetCacheInfoResponseHistoryEntry { + return v.value +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) Set(val *GetCacheInfoResponseHistoryEntry) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponseHistoryEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponseHistoryEntry(val *GetCacheInfoResponseHistoryEntry) *NullableGetCacheInfoResponseHistoryEntry { + return &NullableGetCacheInfoResponseHistoryEntry{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_custom_domain_custom_certificate.go b/services/cdn/v1beta2api/model_get_custom_domain_custom_certificate.go new file mode 100644 index 000000000..d615e8c76 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_custom_domain_custom_certificate.go @@ -0,0 +1,185 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainCustomCertificate{} + +// GetCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. +type GetCustomDomainCustomCertificate struct { + Type string `json:"type"` + // Whenever a new custom certificate is added the version is increased by 1. + Version int32 `json:"version"` +} + +type _GetCustomDomainCustomCertificate GetCustomDomainCustomCertificate + +// NewGetCustomDomainCustomCertificate instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificate(types string, version int32) *GetCustomDomainCustomCertificate { + this := GetCustomDomainCustomCertificate{} + this.Type = types + this.Version = version + return &this +} + +// NewGetCustomDomainCustomCertificateWithDefaults instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificateWithDefaults() *GetCustomDomainCustomCertificate { + this := GetCustomDomainCustomCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *GetCustomDomainCustomCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCustomDomainCustomCertificate) SetType(v string) { + o.Type = v +} + +// GetVersion returns the Version field value +func (o *GetCustomDomainCustomCertificate) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainCustomCertificate) GetVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *GetCustomDomainCustomCertificate) SetVersion(v int32) { + o.Version = v +} + +func (o GetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *GetCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainCustomCertificate := _GetCustomDomainCustomCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainCustomCertificate) + + if err != nil { + return err + } + + *o = GetCustomDomainCustomCertificate(varGetCustomDomainCustomCertificate) + + return err +} + +type NullableGetCustomDomainCustomCertificate struct { + value *GetCustomDomainCustomCertificate + isSet bool +} + +func (v NullableGetCustomDomainCustomCertificate) Get() *GetCustomDomainCustomCertificate { + return v.value +} + +func (v *NullableGetCustomDomainCustomCertificate) Set(val *GetCustomDomainCustomCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainCustomCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainCustomCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainCustomCertificate(val *GetCustomDomainCustomCertificate) *NullableGetCustomDomainCustomCertificate { + return &NullableGetCustomDomainCustomCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_custom_domain_managed_certificate.go b/services/cdn/v1beta2api/model_get_custom_domain_managed_certificate.go new file mode 100644 index 000000000..250e59b90 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_custom_domain_managed_certificate.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainManagedCertificate{} + +// GetCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you +type GetCustomDomainManagedCertificate struct { + Type string `json:"type"` +} + +type _GetCustomDomainManagedCertificate GetCustomDomainManagedCertificate + +// NewGetCustomDomainManagedCertificate instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificate(types string) *GetCustomDomainManagedCertificate { + this := GetCustomDomainManagedCertificate{} + this.Type = types + return &this +} + +// NewGetCustomDomainManagedCertificateWithDefaults instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificateWithDefaults() *GetCustomDomainManagedCertificate { + this := GetCustomDomainManagedCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *GetCustomDomainManagedCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCustomDomainManagedCertificate) SetType(v string) { + o.Type = v +} + +func (o GetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *GetCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainManagedCertificate := _GetCustomDomainManagedCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainManagedCertificate) + + if err != nil { + return err + } + + *o = GetCustomDomainManagedCertificate(varGetCustomDomainManagedCertificate) + + return err +} + +type NullableGetCustomDomainManagedCertificate struct { + value *GetCustomDomainManagedCertificate + isSet bool +} + +func (v NullableGetCustomDomainManagedCertificate) Get() *GetCustomDomainManagedCertificate { + return v.value +} + +func (v *NullableGetCustomDomainManagedCertificate) Set(val *GetCustomDomainManagedCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainManagedCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainManagedCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainManagedCertificate(val *GetCustomDomainManagedCertificate) *NullableGetCustomDomainManagedCertificate { + return &NullableGetCustomDomainManagedCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_custom_domain_response.go b/services/cdn/v1beta2api/model_get_custom_domain_response.go new file mode 100644 index 000000000..adc046bb6 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_custom_domain_response.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainResponse{} + +// GetCustomDomainResponse struct for GetCustomDomainResponse +type GetCustomDomainResponse struct { + Certificate GetCustomDomainResponseCertificate `json:"certificate"` + CustomDomain CustomDomain `json:"customDomain"` +} + +type _GetCustomDomainResponse GetCustomDomainResponse + +// NewGetCustomDomainResponse instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponse(certificate GetCustomDomainResponseCertificate, customDomain CustomDomain) *GetCustomDomainResponse { + this := GetCustomDomainResponse{} + this.Certificate = certificate + this.CustomDomain = customDomain + return &this +} + +// NewGetCustomDomainResponseWithDefaults instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponseWithDefaults() *GetCustomDomainResponse { + this := GetCustomDomainResponse{} + return &this +} + +// GetCertificate returns the Certificate field value +func (o *GetCustomDomainResponse) GetCertificate() GetCustomDomainResponseCertificate { + if o == nil { + var ret GetCustomDomainResponseCertificate + return ret + } + + return o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainResponse) GetCertificateOk() (*GetCustomDomainResponseCertificate, bool) { + if o == nil { + return nil, false + } + return &o.Certificate, true +} + +// SetCertificate sets field value +func (o *GetCustomDomainResponse) SetCertificate(v GetCustomDomainResponseCertificate) { + o.Certificate = v +} + +// GetCustomDomain returns the CustomDomain field value +func (o *GetCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil { + var ret CustomDomain + return ret + } + + return o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil { + return nil, false + } + return &o.CustomDomain, true +} + +// SetCustomDomain sets field value +func (o *GetCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = v +} + +func (o GetCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["certificate"] = o.Certificate + toSerialize["customDomain"] = o.CustomDomain + return toSerialize, nil +} + +func (o *GetCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "certificate", + "customDomain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainResponse := _GetCustomDomainResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainResponse) + + if err != nil { + return err + } + + *o = GetCustomDomainResponse(varGetCustomDomainResponse) + + return err +} + +type NullableGetCustomDomainResponse struct { + value *GetCustomDomainResponse + isSet bool +} + +func (v NullableGetCustomDomainResponse) Get() *GetCustomDomainResponse { + return v.value +} + +func (v *NullableGetCustomDomainResponse) Set(val *GetCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainResponse(val *GetCustomDomainResponse) *NullableGetCustomDomainResponse { + return &NullableGetCustomDomainResponse{value: val, isSet: true} +} + +func (v NullableGetCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_custom_domain_response_certificate.go b/services/cdn/v1beta2api/model_get_custom_domain_response_certificate.go new file mode 100644 index 000000000..d6f35c9cc --- /dev/null +++ b/services/cdn/v1beta2api/model_get_custom_domain_response_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// GetCustomDomainResponseCertificate - struct for GetCustomDomainResponseCertificate +type GetCustomDomainResponseCertificate struct { + GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate + GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate +} + +// GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in GetCustomDomainResponseCertificate +func GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) GetCustomDomainResponseCertificate { + return GetCustomDomainResponseCertificate{ + GetCustomDomainCustomCertificate: v, + } +} + +// GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in GetCustomDomainResponseCertificate +func GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) GetCustomDomainResponseCertificate { + return GetCustomDomainResponseCertificate{ + GetCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GetCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into GetCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match + } else { + dst.GetCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into GetCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match + } else { + dst.GetCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + if src.GetCustomDomainCustomCertificate != nil { + return json.Marshal(&src.GetCustomDomainCustomCertificate) + } + + if src.GetCustomDomainManagedCertificate != nil { + return json.Marshal(&src.GetCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GetCustomDomainResponseCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.GetCustomDomainCustomCertificate != nil { + return obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj GetCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { + if obj.GetCustomDomainCustomCertificate != nil { + return *obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return *obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullableGetCustomDomainResponseCertificate struct { + value *GetCustomDomainResponseCertificate + isSet bool +} + +func (v NullableGetCustomDomainResponseCertificate) Get() *GetCustomDomainResponseCertificate { + return v.value +} + +func (v *NullableGetCustomDomainResponseCertificate) Set(val *GetCustomDomainResponseCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainResponseCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainResponseCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainResponseCertificate(val *GetCustomDomainResponseCertificate) *NullableGetCustomDomainResponseCertificate { + return &NullableGetCustomDomainResponseCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_distribution_response.go b/services/cdn/v1beta2api/model_get_distribution_response.go new file mode 100644 index 000000000..0b5fd11ea --- /dev/null +++ b/services/cdn/v1beta2api/model_get_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDistributionResponse{} + +// GetDistributionResponse struct for GetDistributionResponse +type GetDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _GetDistributionResponse GetDistributionResponse + +// NewGetDistributionResponse instantiates a new GetDistributionResponse 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 NewGetDistributionResponse(distribution Distribution) *GetDistributionResponse { + this := GetDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewGetDistributionResponseWithDefaults instantiates a new GetDistributionResponse 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 NewGetDistributionResponseWithDefaults() *GetDistributionResponse { + this := GetDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *GetDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *GetDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *GetDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o GetDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *GetDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetDistributionResponse := _GetDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetDistributionResponse) + + if err != nil { + return err + } + + *o = GetDistributionResponse(varGetDistributionResponse) + + return err +} + +type NullableGetDistributionResponse struct { + value *GetDistributionResponse + isSet bool +} + +func (v NullableGetDistributionResponse) Get() *GetDistributionResponse { + return v.value +} + +func (v *NullableGetDistributionResponse) Set(val *GetDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetDistributionResponse(val *GetDistributionResponse) *NullableGetDistributionResponse { + return &NullableGetDistributionResponse{value: val, isSet: true} +} + +func (v NullableGetDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_logs_response.go b/services/cdn/v1beta2api/model_get_logs_response.go new file mode 100644 index 000000000..3d61552ad --- /dev/null +++ b/services/cdn/v1beta2api/model_get_logs_response.go @@ -0,0 +1,192 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsResponse{} + +// GetLogsResponse struct for GetLogsResponse +type GetLogsResponse struct { + Logs []DistributionLogsRecord `json:"logs"` + NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` +} + +type _GetLogsResponse GetLogsResponse + +// NewGetLogsResponse instantiates a new GetLogsResponse 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 NewGetLogsResponse(logs []DistributionLogsRecord) *GetLogsResponse { + this := GetLogsResponse{} + this.Logs = logs + return &this +} + +// NewGetLogsResponseWithDefaults instantiates a new GetLogsResponse 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 NewGetLogsResponseWithDefaults() *GetLogsResponse { + this := GetLogsResponse{} + return &this +} + +// GetLogs returns the Logs field value +func (o *GetLogsResponse) GetLogs() []DistributionLogsRecord { + if o == nil { + var ret []DistributionLogsRecord + return ret + } + + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *GetLogsResponse) GetLogsOk() ([]DistributionLogsRecord, bool) { + if o == nil { + return nil, false + } + return o.Logs, true +} + +// SetLogs sets field value +func (o *GetLogsResponse) SetLogs(v []DistributionLogsRecord) { + o.Logs = v +} + +// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +func (o *GetLogsResponse) GetNextPageIdentifier() string { + if o == nil || IsNil(o.NextPageIdentifier) { + var ret string + return ret + } + return *o.NextPageIdentifier +} + +// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLogsResponse) GetNextPageIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.NextPageIdentifier) { + return nil, false + } + return o.NextPageIdentifier, true +} + +// HasNextPageIdentifier returns a boolean if a field has been set. +func (o *GetLogsResponse) HasNextPageIdentifier() bool { + if o != nil && !IsNil(o.NextPageIdentifier) { + return true + } + + return false +} + +// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. +func (o *GetLogsResponse) SetNextPageIdentifier(v string) { + o.NextPageIdentifier = &v +} + +func (o GetLogsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["logs"] = o.Logs + if !IsNil(o.NextPageIdentifier) { + toSerialize["nextPageIdentifier"] = o.NextPageIdentifier + } + return toSerialize, nil +} + +func (o *GetLogsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "logs", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsResponse := _GetLogsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsResponse) + + if err != nil { + return err + } + + *o = GetLogsResponse(varGetLogsResponse) + + return err +} + +type NullableGetLogsResponse struct { + value *GetLogsResponse + isSet bool +} + +func (v NullableGetLogsResponse) Get() *GetLogsResponse { + return v.value +} + +func (v *NullableGetLogsResponse) Set(val *GetLogsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsResponse(val *GetLogsResponse) *NullableGetLogsResponse { + return &NullableGetLogsResponse{value: val, isSet: true} +} + +func (v NullableGetLogsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response.go new file mode 100644 index 000000000..e52f99a5f --- /dev/null +++ b/services/cdn/v1beta2api/model_get_logs_search_filters_response.go @@ -0,0 +1,242 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsSearchFiltersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsSearchFiltersResponse{} + +// GetLogsSearchFiltersResponse struct for GetLogsSearchFiltersResponse +type GetLogsSearchFiltersResponse struct { + Cache []string `json:"cache"` + DataCenter GetLogsSearchFiltersResponseDatacenterBlock `json:"dataCenter"` + // List of ISO-3166 Alpha2 Country Codes matching the input filter. Response is ordered in ascending order. For more Info about the country codes, see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + RemoteCountry []string `json:"remoteCountry"` + // List of Status Codes matching the input filter. Response is ordered in ascending order. + Status []int32 `json:"status"` +} + +type _GetLogsSearchFiltersResponse GetLogsSearchFiltersResponse + +// NewGetLogsSearchFiltersResponse instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponse(cache []string, dataCenter GetLogsSearchFiltersResponseDatacenterBlock, remoteCountry []string, status []int32) *GetLogsSearchFiltersResponse { + this := GetLogsSearchFiltersResponse{} + this.Cache = cache + this.DataCenter = dataCenter + this.RemoteCountry = remoteCountry + this.Status = status + return &this +} + +// NewGetLogsSearchFiltersResponseWithDefaults instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponseWithDefaults() *GetLogsSearchFiltersResponse { + this := GetLogsSearchFiltersResponse{} + return &this +} + +// GetCache returns the Cache field value +func (o *GetLogsSearchFiltersResponse) GetCache() []string { + if o == nil { + var ret []string + return ret + } + + return o.Cache +} + +// GetCacheOk returns a tuple with the Cache field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetCacheOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Cache, true +} + +// SetCache sets field value +func (o *GetLogsSearchFiltersResponse) SetCache(v []string) { + o.Cache = v +} + +// GetDataCenter returns the DataCenter field value +func (o *GetLogsSearchFiltersResponse) GetDataCenter() GetLogsSearchFiltersResponseDatacenterBlock { + if o == nil { + var ret GetLogsSearchFiltersResponseDatacenterBlock + return ret + } + + return o.DataCenter +} + +// GetDataCenterOk returns a tuple with the DataCenter field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetDataCenterOk() (*GetLogsSearchFiltersResponseDatacenterBlock, bool) { + if o == nil { + return nil, false + } + return &o.DataCenter, true +} + +// SetDataCenter sets field value +func (o *GetLogsSearchFiltersResponse) SetDataCenter(v GetLogsSearchFiltersResponseDatacenterBlock) { + o.DataCenter = v +} + +// GetRemoteCountry returns the RemoteCountry field value +func (o *GetLogsSearchFiltersResponse) GetRemoteCountry() []string { + if o == nil { + var ret []string + return ret + } + + return o.RemoteCountry +} + +// GetRemoteCountryOk returns a tuple with the RemoteCountry field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetRemoteCountryOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.RemoteCountry, true +} + +// SetRemoteCountry sets field value +func (o *GetLogsSearchFiltersResponse) SetRemoteCountry(v []string) { + o.RemoteCountry = v +} + +// GetStatus returns the Status field value +func (o *GetLogsSearchFiltersResponse) GetStatus() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetStatusOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Status, true +} + +// SetStatus sets field value +func (o *GetLogsSearchFiltersResponse) SetStatus(v []int32) { + o.Status = v +} + +func (o GetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsSearchFiltersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cache"] = o.Cache + toSerialize["dataCenter"] = o.DataCenter + toSerialize["remoteCountry"] = o.RemoteCountry + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *GetLogsSearchFiltersResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cache", + "dataCenter", + "remoteCountry", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsSearchFiltersResponse := _GetLogsSearchFiltersResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsSearchFiltersResponse) + + if err != nil { + return err + } + + *o = GetLogsSearchFiltersResponse(varGetLogsSearchFiltersResponse) + + return err +} + +type NullableGetLogsSearchFiltersResponse struct { + value *GetLogsSearchFiltersResponse + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponse) Get() *GetLogsSearchFiltersResponse { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponse) Set(val *GetLogsSearchFiltersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponse(val *GetLogsSearchFiltersResponse) *NullableGetLogsSearchFiltersResponse { + return &NullableGetLogsSearchFiltersResponse{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block.go new file mode 100644 index 000000000..42c5615f1 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block.go @@ -0,0 +1,268 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsSearchFiltersResponseDatacenterBlock type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsSearchFiltersResponseDatacenterBlock{} + +// GetLogsSearchFiltersResponseDatacenterBlock Object containing Datacenters to filter for. Each datacenter is grouped to the respective region. +type GetLogsSearchFiltersResponseDatacenterBlock struct { + AF []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"AF"` + ASIA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"ASIA"` + EU []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"EU"` + NA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"NA"` + SA []GetLogsSearchFiltersResponseDatacenterBlockItem `json:"SA"` +} + +type _GetLogsSearchFiltersResponseDatacenterBlock GetLogsSearchFiltersResponseDatacenterBlock + +// NewGetLogsSearchFiltersResponseDatacenterBlock instantiates a new GetLogsSearchFiltersResponseDatacenterBlock 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 NewGetLogsSearchFiltersResponseDatacenterBlock(aF []GetLogsSearchFiltersResponseDatacenterBlockItem, aSIA []GetLogsSearchFiltersResponseDatacenterBlockItem, eU []GetLogsSearchFiltersResponseDatacenterBlockItem, nA []GetLogsSearchFiltersResponseDatacenterBlockItem, sA []GetLogsSearchFiltersResponseDatacenterBlockItem) *GetLogsSearchFiltersResponseDatacenterBlock { + this := GetLogsSearchFiltersResponseDatacenterBlock{} + this.AF = aF + this.ASIA = aSIA + this.EU = eU + this.NA = nA + this.SA = sA + return &this +} + +// NewGetLogsSearchFiltersResponseDatacenterBlockWithDefaults instantiates a new GetLogsSearchFiltersResponseDatacenterBlock 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 NewGetLogsSearchFiltersResponseDatacenterBlockWithDefaults() *GetLogsSearchFiltersResponseDatacenterBlock { + this := GetLogsSearchFiltersResponseDatacenterBlock{} + return &this +} + +// GetAF returns the AF field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAF() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.AF +} + +// GetAFOk returns a tuple with the AF field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetAFOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.AF, true +} + +// SetAF sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetAF(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.AF = v +} + +// GetASIA returns the ASIA field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIA() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.ASIA +} + +// GetASIAOk returns a tuple with the ASIA field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetASIAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.ASIA, true +} + +// SetASIA sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetASIA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.ASIA = v +} + +// GetEU returns the EU field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEU() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.EU +} + +// GetEUOk returns a tuple with the EU field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetEUOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.EU, true +} + +// SetEU sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetEU(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.EU = v +} + +// GetNA returns the NA field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNA() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.NA +} + +// GetNAOk returns a tuple with the NA field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetNAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.NA, true +} + +// SetNA sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetNA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.NA = v +} + +// GetSA returns the SA field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSA() []GetLogsSearchFiltersResponseDatacenterBlockItem { + if o == nil { + var ret []GetLogsSearchFiltersResponseDatacenterBlockItem + return ret + } + + return o.SA +} + +// GetSAOk returns a tuple with the SA field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlock) GetSAOk() ([]GetLogsSearchFiltersResponseDatacenterBlockItem, bool) { + if o == nil { + return nil, false + } + return o.SA, true +} + +// SetSA sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlock) SetSA(v []GetLogsSearchFiltersResponseDatacenterBlockItem) { + o.SA = v +} + +func (o GetLogsSearchFiltersResponseDatacenterBlock) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsSearchFiltersResponseDatacenterBlock) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["AF"] = o.AF + toSerialize["ASIA"] = o.ASIA + toSerialize["EU"] = o.EU + toSerialize["NA"] = o.NA + toSerialize["SA"] = o.SA + return toSerialize, nil +} + +func (o *GetLogsSearchFiltersResponseDatacenterBlock) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "AF", + "ASIA", + "EU", + "NA", + "SA", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsSearchFiltersResponseDatacenterBlock := _GetLogsSearchFiltersResponseDatacenterBlock{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsSearchFiltersResponseDatacenterBlock) + + if err != nil { + return err + } + + *o = GetLogsSearchFiltersResponseDatacenterBlock(varGetLogsSearchFiltersResponseDatacenterBlock) + + return err +} + +type NullableGetLogsSearchFiltersResponseDatacenterBlock struct { + value *GetLogsSearchFiltersResponseDatacenterBlock + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) Get() *GetLogsSearchFiltersResponseDatacenterBlock { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) Set(val *GetLogsSearchFiltersResponseDatacenterBlock) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponseDatacenterBlock(val *GetLogsSearchFiltersResponseDatacenterBlock) *NullableGetLogsSearchFiltersResponseDatacenterBlock { + return &NullableGetLogsSearchFiltersResponseDatacenterBlock{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlock) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlock) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block_item.go b/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block_item.go new file mode 100644 index 000000000..5ac0c0a3b --- /dev/null +++ b/services/cdn/v1beta2api/model_get_logs_search_filters_response_datacenter_block_item.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsSearchFiltersResponseDatacenterBlockItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsSearchFiltersResponseDatacenterBlockItem{} + +// GetLogsSearchFiltersResponseDatacenterBlockItem A datacenter. The `id` defines the key needed to filter against the logs endpoint, while the `displayName` defines a human-readable Name. +type GetLogsSearchFiltersResponseDatacenterBlockItem struct { + DisplayName string `json:"displayName"` + Id string `json:"id"` +} + +type _GetLogsSearchFiltersResponseDatacenterBlockItem GetLogsSearchFiltersResponseDatacenterBlockItem + +// NewGetLogsSearchFiltersResponseDatacenterBlockItem instantiates a new GetLogsSearchFiltersResponseDatacenterBlockItem 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 NewGetLogsSearchFiltersResponseDatacenterBlockItem(displayName string, id string) *GetLogsSearchFiltersResponseDatacenterBlockItem { + this := GetLogsSearchFiltersResponseDatacenterBlockItem{} + this.DisplayName = displayName + this.Id = id + return &this +} + +// NewGetLogsSearchFiltersResponseDatacenterBlockItemWithDefaults instantiates a new GetLogsSearchFiltersResponseDatacenterBlockItem 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 NewGetLogsSearchFiltersResponseDatacenterBlockItemWithDefaults() *GetLogsSearchFiltersResponseDatacenterBlockItem { + this := GetLogsSearchFiltersResponseDatacenterBlockItem{} + return &this +} + +// GetDisplayName returns the DisplayName field value +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetId returns the Id field value +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) SetId(v string) { + o.Id = v +} + +func (o GetLogsSearchFiltersResponseDatacenterBlockItem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsSearchFiltersResponseDatacenterBlockItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["displayName"] = o.DisplayName + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *GetLogsSearchFiltersResponseDatacenterBlockItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "displayName", + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsSearchFiltersResponseDatacenterBlockItem := _GetLogsSearchFiltersResponseDatacenterBlockItem{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsSearchFiltersResponseDatacenterBlockItem) + + if err != nil { + return err + } + + *o = GetLogsSearchFiltersResponseDatacenterBlockItem(varGetLogsSearchFiltersResponseDatacenterBlockItem) + + return err +} + +type NullableGetLogsSearchFiltersResponseDatacenterBlockItem struct { + value *GetLogsSearchFiltersResponseDatacenterBlockItem + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Get() *GetLogsSearchFiltersResponseDatacenterBlockItem { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Set(val *GetLogsSearchFiltersResponseDatacenterBlockItem) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponseDatacenterBlockItem(val *GetLogsSearchFiltersResponseDatacenterBlockItem) *NullableGetLogsSearchFiltersResponseDatacenterBlockItem { + return &NullableGetLogsSearchFiltersResponseDatacenterBlockItem{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponseDatacenterBlockItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponseDatacenterBlockItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_get_statistics_response.go b/services/cdn/v1beta2api/model_get_statistics_response.go new file mode 100644 index 000000000..6f33a8fd2 --- /dev/null +++ b/services/cdn/v1beta2api/model_get_statistics_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetStatisticsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStatisticsResponse{} + +// GetStatisticsResponse struct for GetStatisticsResponse +type GetStatisticsResponse struct { + Records []DistributionStatisticsRecord `json:"records"` +} + +type _GetStatisticsResponse GetStatisticsResponse + +// NewGetStatisticsResponse instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponse(records []DistributionStatisticsRecord) *GetStatisticsResponse { + this := GetStatisticsResponse{} + this.Records = records + return &this +} + +// NewGetStatisticsResponseWithDefaults instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponseWithDefaults() *GetStatisticsResponse { + this := GetStatisticsResponse{} + return &this +} + +// GetRecords returns the Records field value +func (o *GetStatisticsResponse) GetRecords() []DistributionStatisticsRecord { + if o == nil { + var ret []DistributionStatisticsRecord + return ret + } + + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value +// and a boolean to check if the value has been set. +func (o *GetStatisticsResponse) GetRecordsOk() ([]DistributionStatisticsRecord, bool) { + if o == nil { + return nil, false + } + return o.Records, true +} + +// SetRecords sets field value +func (o *GetStatisticsResponse) SetRecords(v []DistributionStatisticsRecord) { + o.Records = v +} + +func (o GetStatisticsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStatisticsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["records"] = o.Records + return toSerialize, nil +} + +func (o *GetStatisticsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "records", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetStatisticsResponse := _GetStatisticsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetStatisticsResponse) + + if err != nil { + return err + } + + *o = GetStatisticsResponse(varGetStatisticsResponse) + + return err +} + +type NullableGetStatisticsResponse struct { + value *GetStatisticsResponse + isSet bool +} + +func (v NullableGetStatisticsResponse) Get() *GetStatisticsResponse { + return v.value +} + +func (v *NullableGetStatisticsResponse) Set(val *GetStatisticsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatisticsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatisticsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatisticsResponse(val *GetStatisticsResponse) *NullableGetStatisticsResponse { + return &NullableGetStatisticsResponse{value: val, isSet: true} +} + +func (v NullableGetStatisticsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatisticsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_http_backend.go b/services/cdn/v1beta2api/model_http_backend.go new file mode 100644 index 000000000..f3d95c736 --- /dev/null +++ b/services/cdn/v1beta2api/model_http_backend.go @@ -0,0 +1,243 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the HttpBackend type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpBackend{} + +// HttpBackend struct for HttpBackend +type HttpBackend struct { + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. + Geofencing map[string][]string `json:"geofencing"` + // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. + OriginRequestHeaders map[string]string `json:"originRequestHeaders"` + // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` + OriginUrl string `json:"originUrl"` + Type string `json:"type"` +} + +type _HttpBackend HttpBackend + +// NewHttpBackend instantiates a new HttpBackend 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 NewHttpBackend(geofencing map[string][]string, originRequestHeaders map[string]string, originUrl string, types string) *HttpBackend { + this := HttpBackend{} + this.Geofencing = geofencing + this.OriginRequestHeaders = originRequestHeaders + this.OriginUrl = originUrl + this.Type = types + return &this +} + +// NewHttpBackendWithDefaults instantiates a new HttpBackend 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 NewHttpBackendWithDefaults() *HttpBackend { + this := HttpBackend{} + return &this +} + +// GetGeofencing returns the Geofencing field value +func (o *HttpBackend) GetGeofencing() map[string][]string { + if o == nil { + var ret map[string][]string + return ret + } + + return o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil { + return nil, false + } + return &o.Geofencing, true +} + +// SetGeofencing sets field value +func (o *HttpBackend) SetGeofencing(v map[string][]string) { + o.Geofencing = v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value +func (o *HttpBackend) GetOriginRequestHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.OriginRequestHeaders, true +} + +// SetOriginRequestHeaders sets field value +func (o *HttpBackend) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = v +} + +// GetOriginUrl returns the OriginUrl field value +func (o *HttpBackend) GetOriginUrl() string { + if o == nil { + var ret string + return ret + } + + return o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetOriginUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginUrl, true +} + +// SetOriginUrl sets field value +func (o *HttpBackend) SetOriginUrl(v string) { + o.OriginUrl = v +} + +// GetType returns the Type field value +func (o *HttpBackend) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HttpBackend) SetType(v string) { + o.Type = v +} + +func (o HttpBackend) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpBackend) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["geofencing"] = o.Geofencing + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + toSerialize["originUrl"] = o.OriginUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *HttpBackend) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "geofencing", + "originRequestHeaders", + "originUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHttpBackend := _HttpBackend{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpBackend) + + if err != nil { + return err + } + + *o = HttpBackend(varHttpBackend) + + return err +} + +type NullableHttpBackend struct { + value *HttpBackend + isSet bool +} + +func (v NullableHttpBackend) Get() *HttpBackend { + return v.value +} + +func (v *NullableHttpBackend) Set(val *HttpBackend) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackend(val *HttpBackend) *NullableHttpBackend { + return &NullableHttpBackend{value: val, isSet: true} +} + +func (v NullableHttpBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_http_backend_create.go b/services/cdn/v1beta2api/model_http_backend_create.go new file mode 100644 index 000000000..9df41e9e9 --- /dev/null +++ b/services/cdn/v1beta2api/model_http_backend_create.go @@ -0,0 +1,259 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the HttpBackendCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpBackendCreate{} + +// HttpBackendCreate struct for HttpBackendCreate +type HttpBackendCreate struct { + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. + Geofencing *map[string][]string `json:"geofencing,omitempty"` + // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. + OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` + // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` + OriginUrl string `json:"originUrl"` + Type string `json:"type"` +} + +type _HttpBackendCreate HttpBackendCreate + +// NewHttpBackendCreate instantiates a new HttpBackendCreate 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 NewHttpBackendCreate(originUrl string, types string) *HttpBackendCreate { + this := HttpBackendCreate{} + this.OriginUrl = originUrl + this.Type = types + return &this +} + +// NewHttpBackendCreateWithDefaults instantiates a new HttpBackendCreate 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 NewHttpBackendCreateWithDefaults() *HttpBackendCreate { + this := HttpBackendCreate{} + return &this +} + +// GetGeofencing returns the Geofencing field value if set, zero value otherwise. +func (o *HttpBackendCreate) GetGeofencing() map[string][]string { + if o == nil || IsNil(o.Geofencing) { + var ret map[string][]string + return ret + } + return *o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendCreate) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil || IsNil(o.Geofencing) { + return nil, false + } + return o.Geofencing, true +} + +// HasGeofencing returns a boolean if a field has been set. +func (o *HttpBackendCreate) HasGeofencing() bool { + if o != nil && !IsNil(o.Geofencing) { + return true + } + + return false +} + +// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. +func (o *HttpBackendCreate) SetGeofencing(v map[string][]string) { + o.Geofencing = &v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. +func (o *HttpBackendCreate) GetOriginRequestHeaders() map[string]string { + if o == nil || IsNil(o.OriginRequestHeaders) { + var ret map[string]string + return ret + } + return *o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendCreate) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil || IsNil(o.OriginRequestHeaders) { + return nil, false + } + return o.OriginRequestHeaders, true +} + +// HasOriginRequestHeaders returns a boolean if a field has been set. +func (o *HttpBackendCreate) HasOriginRequestHeaders() bool { + if o != nil && !IsNil(o.OriginRequestHeaders) { + return true + } + + return false +} + +// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. +func (o *HttpBackendCreate) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = &v +} + +// GetOriginUrl returns the OriginUrl field value +func (o *HttpBackendCreate) GetOriginUrl() string { + if o == nil { + var ret string + return ret + } + + return o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value +// and a boolean to check if the value has been set. +func (o *HttpBackendCreate) GetOriginUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginUrl, true +} + +// SetOriginUrl sets field value +func (o *HttpBackendCreate) SetOriginUrl(v string) { + o.OriginUrl = v +} + +// GetType returns the Type field value +func (o *HttpBackendCreate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *HttpBackendCreate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HttpBackendCreate) SetType(v string) { + o.Type = v +} + +func (o HttpBackendCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpBackendCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Geofencing) { + toSerialize["geofencing"] = o.Geofencing + } + if !IsNil(o.OriginRequestHeaders) { + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + } + toSerialize["originUrl"] = o.OriginUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *HttpBackendCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "originUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHttpBackendCreate := _HttpBackendCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpBackendCreate) + + if err != nil { + return err + } + + *o = HttpBackendCreate(varHttpBackendCreate) + + return err +} + +type NullableHttpBackendCreate struct { + value *HttpBackendCreate + isSet bool +} + +func (v NullableHttpBackendCreate) Get() *HttpBackendCreate { + return v.value +} + +func (v *NullableHttpBackendCreate) Set(val *HttpBackendCreate) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackendCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackendCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackendCreate(val *HttpBackendCreate) *NullableHttpBackendCreate { + return &NullableHttpBackendCreate{value: val, isSet: true} +} + +func (v NullableHttpBackendCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackendCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_http_backend_patch.go b/services/cdn/v1beta2api/model_http_backend_patch.go new file mode 100644 index 000000000..649d40327 --- /dev/null +++ b/services/cdn/v1beta2api/model_http_backend_patch.go @@ -0,0 +1,267 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the HttpBackendPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpBackendPatch{} + +// HttpBackendPatch A partial HTTP Backend +type HttpBackendPatch struct { + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. + Geofencing *map[string][]string `json:"geofencing,omitempty"` + // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. + OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` + OriginUrl *string `json:"originUrl,omitempty"` + // This property is required to determine the used backend type. + Type string `json:"type"` +} + +type _HttpBackendPatch HttpBackendPatch + +// NewHttpBackendPatch instantiates a new HttpBackendPatch 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 NewHttpBackendPatch(types string) *HttpBackendPatch { + this := HttpBackendPatch{} + this.Type = types + return &this +} + +// NewHttpBackendPatchWithDefaults instantiates a new HttpBackendPatch 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 NewHttpBackendPatchWithDefaults() *HttpBackendPatch { + this := HttpBackendPatch{} + return &this +} + +// GetGeofencing returns the Geofencing field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetGeofencing() map[string][]string { + if o == nil || IsNil(o.Geofencing) { + var ret map[string][]string + return ret + } + return *o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil || IsNil(o.Geofencing) { + return nil, false + } + return o.Geofencing, true +} + +// HasGeofencing returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasGeofencing() bool { + if o != nil && !IsNil(o.Geofencing) { + return true + } + + return false +} + +// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. +func (o *HttpBackendPatch) SetGeofencing(v map[string][]string) { + o.Geofencing = &v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetOriginRequestHeaders() map[string]string { + if o == nil || IsNil(o.OriginRequestHeaders) { + var ret map[string]string + return ret + } + return *o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil || IsNil(o.OriginRequestHeaders) { + return nil, false + } + return o.OriginRequestHeaders, true +} + +// HasOriginRequestHeaders returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasOriginRequestHeaders() bool { + if o != nil && !IsNil(o.OriginRequestHeaders) { + return true + } + + return false +} + +// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. +func (o *HttpBackendPatch) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = &v +} + +// GetOriginUrl returns the OriginUrl field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetOriginUrl() string { + if o == nil || IsNil(o.OriginUrl) { + var ret string + return ret + } + return *o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetOriginUrlOk() (*string, bool) { + if o == nil || IsNil(o.OriginUrl) { + return nil, false + } + return o.OriginUrl, true +} + +// HasOriginUrl returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasOriginUrl() bool { + if o != nil && !IsNil(o.OriginUrl) { + return true + } + + return false +} + +// SetOriginUrl gets a reference to the given string and assigns it to the OriginUrl field. +func (o *HttpBackendPatch) SetOriginUrl(v string) { + o.OriginUrl = &v +} + +// GetType returns the Type field value +func (o *HttpBackendPatch) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HttpBackendPatch) SetType(v string) { + o.Type = v +} + +func (o HttpBackendPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Geofencing) { + toSerialize["geofencing"] = o.Geofencing + } + if !IsNil(o.OriginRequestHeaders) { + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + } + if !IsNil(o.OriginUrl) { + toSerialize["originUrl"] = o.OriginUrl + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *HttpBackendPatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHttpBackendPatch := _HttpBackendPatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpBackendPatch) + + if err != nil { + return err + } + + *o = HttpBackendPatch(varHttpBackendPatch) + + return err +} + +type NullableHttpBackendPatch struct { + value *HttpBackendPatch + isSet bool +} + +func (v NullableHttpBackendPatch) Get() *HttpBackendPatch { + return v.value +} + +func (v *NullableHttpBackendPatch) Set(val *HttpBackendPatch) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackendPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackendPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackendPatch(val *HttpBackendPatch) *NullableHttpBackendPatch { + return &NullableHttpBackendPatch{value: val, isSet: true} +} + +func (v NullableHttpBackendPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackendPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_list_distributions_response.go b/services/cdn/v1beta2api/model_list_distributions_response.go new file mode 100644 index 000000000..662a6a91d --- /dev/null +++ b/services/cdn/v1beta2api/model_list_distributions_response.go @@ -0,0 +1,192 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListDistributionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDistributionsResponse{} + +// ListDistributionsResponse struct for ListDistributionsResponse +type ListDistributionsResponse struct { + Distributions []Distribution `json:"distributions"` + NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` +} + +type _ListDistributionsResponse ListDistributionsResponse + +// NewListDistributionsResponse instantiates a new ListDistributionsResponse 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 NewListDistributionsResponse(distributions []Distribution) *ListDistributionsResponse { + this := ListDistributionsResponse{} + this.Distributions = distributions + return &this +} + +// NewListDistributionsResponseWithDefaults instantiates a new ListDistributionsResponse 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 NewListDistributionsResponseWithDefaults() *ListDistributionsResponse { + this := ListDistributionsResponse{} + return &this +} + +// GetDistributions returns the Distributions field value +func (o *ListDistributionsResponse) GetDistributions() []Distribution { + if o == nil { + var ret []Distribution + return ret + } + + return o.Distributions +} + +// GetDistributionsOk returns a tuple with the Distributions field value +// and a boolean to check if the value has been set. +func (o *ListDistributionsResponse) GetDistributionsOk() ([]Distribution, bool) { + if o == nil { + return nil, false + } + return o.Distributions, true +} + +// SetDistributions sets field value +func (o *ListDistributionsResponse) SetDistributions(v []Distribution) { + o.Distributions = v +} + +// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +func (o *ListDistributionsResponse) GetNextPageIdentifier() string { + if o == nil || IsNil(o.NextPageIdentifier) { + var ret string + return ret + } + return *o.NextPageIdentifier +} + +// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListDistributionsResponse) GetNextPageIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.NextPageIdentifier) { + return nil, false + } + return o.NextPageIdentifier, true +} + +// HasNextPageIdentifier returns a boolean if a field has been set. +func (o *ListDistributionsResponse) HasNextPageIdentifier() bool { + if o != nil && !IsNil(o.NextPageIdentifier) { + return true + } + + return false +} + +// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. +func (o *ListDistributionsResponse) SetNextPageIdentifier(v string) { + o.NextPageIdentifier = &v +} + +func (o ListDistributionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListDistributionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distributions"] = o.Distributions + if !IsNil(o.NextPageIdentifier) { + toSerialize["nextPageIdentifier"] = o.NextPageIdentifier + } + return toSerialize, nil +} + +func (o *ListDistributionsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distributions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListDistributionsResponse := _ListDistributionsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListDistributionsResponse) + + if err != nil { + return err + } + + *o = ListDistributionsResponse(varListDistributionsResponse) + + return err +} + +type NullableListDistributionsResponse struct { + value *ListDistributionsResponse + isSet bool +} + +func (v NullableListDistributionsResponse) Get() *ListDistributionsResponse { + return v.value +} + +func (v *NullableListDistributionsResponse) Set(val *ListDistributionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsResponse(val *ListDistributionsResponse) *NullableListDistributionsResponse { + return &NullableListDistributionsResponse{value: val, isSet: true} +} + +func (v NullableListDistributionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_list_waf_collections_response.go b/services/cdn/v1beta2api/model_list_waf_collections_response.go new file mode 100644 index 000000000..9e574e9eb --- /dev/null +++ b/services/cdn/v1beta2api/model_list_waf_collections_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListWafCollectionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListWafCollectionsResponse{} + +// ListWafCollectionsResponse struct for ListWafCollectionsResponse +type ListWafCollectionsResponse struct { + Collections []WafRuleCollection `json:"collections"` +} + +type _ListWafCollectionsResponse ListWafCollectionsResponse + +// NewListWafCollectionsResponse instantiates a new ListWafCollectionsResponse 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 NewListWafCollectionsResponse(collections []WafRuleCollection) *ListWafCollectionsResponse { + this := ListWafCollectionsResponse{} + this.Collections = collections + return &this +} + +// NewListWafCollectionsResponseWithDefaults instantiates a new ListWafCollectionsResponse 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 NewListWafCollectionsResponseWithDefaults() *ListWafCollectionsResponse { + this := ListWafCollectionsResponse{} + return &this +} + +// GetCollections returns the Collections field value +func (o *ListWafCollectionsResponse) GetCollections() []WafRuleCollection { + if o == nil { + var ret []WafRuleCollection + return ret + } + + return o.Collections +} + +// GetCollectionsOk returns a tuple with the Collections field value +// and a boolean to check if the value has been set. +func (o *ListWafCollectionsResponse) GetCollectionsOk() ([]WafRuleCollection, bool) { + if o == nil { + return nil, false + } + return o.Collections, true +} + +// SetCollections sets field value +func (o *ListWafCollectionsResponse) SetCollections(v []WafRuleCollection) { + o.Collections = v +} + +func (o ListWafCollectionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListWafCollectionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["collections"] = o.Collections + return toSerialize, nil +} + +func (o *ListWafCollectionsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "collections", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListWafCollectionsResponse := _ListWafCollectionsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListWafCollectionsResponse) + + if err != nil { + return err + } + + *o = ListWafCollectionsResponse(varListWafCollectionsResponse) + + return err +} + +type NullableListWafCollectionsResponse struct { + value *ListWafCollectionsResponse + isSet bool +} + +func (v NullableListWafCollectionsResponse) Get() *ListWafCollectionsResponse { + return v.value +} + +func (v *NullableListWafCollectionsResponse) Set(val *ListWafCollectionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListWafCollectionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListWafCollectionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListWafCollectionsResponse(val *ListWafCollectionsResponse) *NullableListWafCollectionsResponse { + return &NullableListWafCollectionsResponse{value: val, isSet: true} +} + +func (v NullableListWafCollectionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListWafCollectionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_loki_log_sink.go b/services/cdn/v1beta2api/model_loki_log_sink.go new file mode 100644 index 000000000..94c35f99a --- /dev/null +++ b/services/cdn/v1beta2api/model_loki_log_sink.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSink{} + +// LokiLogSink struct for LokiLogSink +type LokiLogSink struct { + PushUrl string `json:"pushUrl"` + Type string `json:"type"` +} + +type _LokiLogSink LokiLogSink + +// NewLokiLogSink instantiates a new LokiLogSink 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 NewLokiLogSink(pushUrl string, types string) *LokiLogSink { + this := LokiLogSink{} + this.PushUrl = pushUrl + this.Type = types + return &this +} + +// NewLokiLogSinkWithDefaults instantiates a new LokiLogSink 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 NewLokiLogSinkWithDefaults() *LokiLogSink { + this := LokiLogSink{} + return &this +} + +// GetPushUrl returns the PushUrl field value +func (o *LokiLogSink) GetPushUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value +// and a boolean to check if the value has been set. +func (o *LokiLogSink) GetPushUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PushUrl, true +} + +// SetPushUrl sets field value +func (o *LokiLogSink) SetPushUrl(v string) { + o.PushUrl = v +} + +// GetType returns the Type field value +func (o *LokiLogSink) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LokiLogSink) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *LokiLogSink) SetType(v string) { + o.Type = v +} + +func (o LokiLogSink) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pushUrl"] = o.PushUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *LokiLogSink) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pushUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSink := _LokiLogSink{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSink) + + if err != nil { + return err + } + + *o = LokiLogSink(varLokiLogSink) + + return err +} + +type NullableLokiLogSink struct { + value *LokiLogSink + isSet bool +} + +func (v NullableLokiLogSink) Get() *LokiLogSink { + return v.value +} + +func (v *NullableLokiLogSink) Set(val *LokiLogSink) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSink) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSink(val *LokiLogSink) *NullableLokiLogSink { + return &NullableLokiLogSink{value: val, isSet: true} +} + +func (v NullableLokiLogSink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_loki_log_sink_create.go b/services/cdn/v1beta2api/model_loki_log_sink_create.go new file mode 100644 index 000000000..b93caf5dc --- /dev/null +++ b/services/cdn/v1beta2api/model_loki_log_sink_create.go @@ -0,0 +1,212 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSinkCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSinkCreate{} + +// LokiLogSinkCreate struct for LokiLogSinkCreate +type LokiLogSinkCreate struct { + Credentials LokiLogSinkCredentials `json:"credentials"` + PushUrl string `json:"pushUrl"` + Type string `json:"type"` +} + +type _LokiLogSinkCreate LokiLogSinkCreate + +// NewLokiLogSinkCreate instantiates a new LokiLogSinkCreate 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 NewLokiLogSinkCreate(credentials LokiLogSinkCredentials, pushUrl string, types string) *LokiLogSinkCreate { + this := LokiLogSinkCreate{} + this.Credentials = credentials + this.PushUrl = pushUrl + this.Type = types + return &this +} + +// NewLokiLogSinkCreateWithDefaults instantiates a new LokiLogSinkCreate 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 NewLokiLogSinkCreateWithDefaults() *LokiLogSinkCreate { + this := LokiLogSinkCreate{} + return &this +} + +// GetCredentials returns the Credentials field value +func (o *LokiLogSinkCreate) GetCredentials() LokiLogSinkCredentials { + if o == nil { + var ret LokiLogSinkCredentials + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCreate) GetCredentialsOk() (*LokiLogSinkCredentials, bool) { + if o == nil { + return nil, false + } + return &o.Credentials, true +} + +// SetCredentials sets field value +func (o *LokiLogSinkCreate) SetCredentials(v LokiLogSinkCredentials) { + o.Credentials = v +} + +// GetPushUrl returns the PushUrl field value +func (o *LokiLogSinkCreate) GetPushUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCreate) GetPushUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PushUrl, true +} + +// SetPushUrl sets field value +func (o *LokiLogSinkCreate) SetPushUrl(v string) { + o.PushUrl = v +} + +// GetType returns the Type field value +func (o *LokiLogSinkCreate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCreate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *LokiLogSinkCreate) SetType(v string) { + o.Type = v +} + +func (o LokiLogSinkCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSinkCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["credentials"] = o.Credentials + toSerialize["pushUrl"] = o.PushUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *LokiLogSinkCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "credentials", + "pushUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSinkCreate := _LokiLogSinkCreate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSinkCreate) + + if err != nil { + return err + } + + *o = LokiLogSinkCreate(varLokiLogSinkCreate) + + return err +} + +type NullableLokiLogSinkCreate struct { + value *LokiLogSinkCreate + isSet bool +} + +func (v NullableLokiLogSinkCreate) Get() *LokiLogSinkCreate { + return v.value +} + +func (v *NullableLokiLogSinkCreate) Set(val *LokiLogSinkCreate) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkCreate(val *LokiLogSinkCreate) *NullableLokiLogSinkCreate { + return &NullableLokiLogSinkCreate{value: val, isSet: true} +} + +func (v NullableLokiLogSinkCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_loki_log_sink_credentials.go b/services/cdn/v1beta2api/model_loki_log_sink_credentials.go new file mode 100644 index 000000000..3494f7608 --- /dev/null +++ b/services/cdn/v1beta2api/model_loki_log_sink_credentials.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSinkCredentials type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSinkCredentials{} + +// LokiLogSinkCredentials struct for LokiLogSinkCredentials +type LokiLogSinkCredentials struct { + Password string `json:"password"` + Username string `json:"username"` +} + +type _LokiLogSinkCredentials LokiLogSinkCredentials + +// NewLokiLogSinkCredentials instantiates a new LokiLogSinkCredentials 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 NewLokiLogSinkCredentials(password string, username string) *LokiLogSinkCredentials { + this := LokiLogSinkCredentials{} + this.Password = password + this.Username = username + return &this +} + +// NewLokiLogSinkCredentialsWithDefaults instantiates a new LokiLogSinkCredentials 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 NewLokiLogSinkCredentialsWithDefaults() *LokiLogSinkCredentials { + this := LokiLogSinkCredentials{} + return &this +} + +// GetPassword returns the Password field value +func (o *LokiLogSinkCredentials) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCredentials) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *LokiLogSinkCredentials) SetPassword(v string) { + o.Password = v +} + +// GetUsername returns the Username field value +func (o *LokiLogSinkCredentials) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkCredentials) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *LokiLogSinkCredentials) SetUsername(v string) { + o.Username = v +} + +func (o LokiLogSinkCredentials) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSinkCredentials) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["password"] = o.Password + toSerialize["username"] = o.Username + return toSerialize, nil +} + +func (o *LokiLogSinkCredentials) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "password", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSinkCredentials := _LokiLogSinkCredentials{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSinkCredentials) + + if err != nil { + return err + } + + *o = LokiLogSinkCredentials(varLokiLogSinkCredentials) + + return err +} + +type NullableLokiLogSinkCredentials struct { + value *LokiLogSinkCredentials + isSet bool +} + +func (v NullableLokiLogSinkCredentials) Get() *LokiLogSinkCredentials { + return v.value +} + +func (v *NullableLokiLogSinkCredentials) Set(val *LokiLogSinkCredentials) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkCredentials) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkCredentials) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkCredentials(val *LokiLogSinkCredentials) *NullableLokiLogSinkCredentials { + return &NullableLokiLogSinkCredentials{value: val, isSet: true} +} + +func (v NullableLokiLogSinkCredentials) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkCredentials) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_loki_log_sink_patch.go b/services/cdn/v1beta2api/model_loki_log_sink_patch.go new file mode 100644 index 000000000..734260cea --- /dev/null +++ b/services/cdn/v1beta2api/model_loki_log_sink_patch.go @@ -0,0 +1,228 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSinkPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSinkPatch{} + +// LokiLogSinkPatch struct for LokiLogSinkPatch +type LokiLogSinkPatch struct { + Credentials *LokiLogSinkCredentials `json:"credentials,omitempty"` + PushUrl *string `json:"pushUrl,omitempty"` + Type string `json:"type"` +} + +type _LokiLogSinkPatch LokiLogSinkPatch + +// NewLokiLogSinkPatch instantiates a new LokiLogSinkPatch 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 NewLokiLogSinkPatch(types string) *LokiLogSinkPatch { + this := LokiLogSinkPatch{} + this.Type = types + return &this +} + +// NewLokiLogSinkPatchWithDefaults instantiates a new LokiLogSinkPatch 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 NewLokiLogSinkPatchWithDefaults() *LokiLogSinkPatch { + this := LokiLogSinkPatch{} + return &this +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *LokiLogSinkPatch) GetCredentials() LokiLogSinkCredentials { + if o == nil || IsNil(o.Credentials) { + var ret LokiLogSinkCredentials + return ret + } + return *o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LokiLogSinkPatch) GetCredentialsOk() (*LokiLogSinkCredentials, bool) { + if o == nil || IsNil(o.Credentials) { + return nil, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *LokiLogSinkPatch) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given LokiLogSinkCredentials and assigns it to the Credentials field. +func (o *LokiLogSinkPatch) SetCredentials(v LokiLogSinkCredentials) { + o.Credentials = &v +} + +// GetPushUrl returns the PushUrl field value if set, zero value otherwise. +func (o *LokiLogSinkPatch) GetPushUrl() string { + if o == nil || IsNil(o.PushUrl) { + var ret string + return ret + } + return *o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LokiLogSinkPatch) GetPushUrlOk() (*string, bool) { + if o == nil || IsNil(o.PushUrl) { + return nil, false + } + return o.PushUrl, true +} + +// HasPushUrl returns a boolean if a field has been set. +func (o *LokiLogSinkPatch) HasPushUrl() bool { + if o != nil && !IsNil(o.PushUrl) { + return true + } + + return false +} + +// SetPushUrl gets a reference to the given string and assigns it to the PushUrl field. +func (o *LokiLogSinkPatch) SetPushUrl(v string) { + o.PushUrl = &v +} + +// GetType returns the Type field value +func (o *LokiLogSinkPatch) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LokiLogSinkPatch) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *LokiLogSinkPatch) SetType(v string) { + o.Type = v +} + +func (o LokiLogSinkPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSinkPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + if !IsNil(o.PushUrl) { + toSerialize["pushUrl"] = o.PushUrl + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *LokiLogSinkPatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSinkPatch := _LokiLogSinkPatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSinkPatch) + + if err != nil { + return err + } + + *o = LokiLogSinkPatch(varLokiLogSinkPatch) + + return err +} + +type NullableLokiLogSinkPatch struct { + value *LokiLogSinkPatch + isSet bool +} + +func (v NullableLokiLogSinkPatch) Get() *LokiLogSinkPatch { + return v.value +} + +func (v *NullableLokiLogSinkPatch) Set(val *LokiLogSinkPatch) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSinkPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSinkPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSinkPatch(val *LokiLogSinkPatch) *NullableLokiLogSinkPatch { + return &NullableLokiLogSinkPatch{value: val, isSet: true} +} + +func (v NullableLokiLogSinkPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSinkPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_optimizer.go b/services/cdn/v1beta2api/model_optimizer.go new file mode 100644 index 000000000..575b7f72c --- /dev/null +++ b/services/cdn/v1beta2api/model_optimizer.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Optimizer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Optimizer{} + +// Optimizer Optimizer is paid feature, a real-time on the fly image manipulation and optimization service that automatically optimizes your images for faster image delivery. +type Optimizer struct { + // Determines if the optimizer should be enabled for this distribution and incurs a monthly fee + Enabled bool `json:"enabled"` +} + +type _Optimizer Optimizer + +// NewOptimizer instantiates a new Optimizer 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 NewOptimizer(enabled bool) *Optimizer { + this := Optimizer{} + this.Enabled = enabled + return &this +} + +// NewOptimizerWithDefaults instantiates a new Optimizer 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 NewOptimizerWithDefaults() *Optimizer { + this := Optimizer{} + return &this +} + +// GetEnabled returns the Enabled field value +func (o *Optimizer) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *Optimizer) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *Optimizer) SetEnabled(v bool) { + o.Enabled = v +} + +func (o Optimizer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Optimizer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["enabled"] = o.Enabled + return toSerialize, nil +} + +func (o *Optimizer) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOptimizer := _Optimizer{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOptimizer) + + if err != nil { + return err + } + + *o = Optimizer(varOptimizer) + + return err +} + +type NullableOptimizer struct { + value *Optimizer + isSet bool +} + +func (v NullableOptimizer) Get() *Optimizer { + return v.value +} + +func (v *NullableOptimizer) Set(val *Optimizer) { + v.value = val + v.isSet = true +} + +func (v NullableOptimizer) IsSet() bool { + return v.isSet +} + +func (v *NullableOptimizer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOptimizer(val *Optimizer) *NullableOptimizer { + return &NullableOptimizer{value: val, isSet: true} +} + +func (v NullableOptimizer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOptimizer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_optimizer_patch.go b/services/cdn/v1beta2api/model_optimizer_patch.go new file mode 100644 index 000000000..af07c73d3 --- /dev/null +++ b/services/cdn/v1beta2api/model_optimizer_patch.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" +) + +// checks if the OptimizerPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OptimizerPatch{} + +// OptimizerPatch struct for OptimizerPatch +type OptimizerPatch struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// NewOptimizerPatch instantiates a new OptimizerPatch 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 NewOptimizerPatch() *OptimizerPatch { + this := OptimizerPatch{} + return &this +} + +// NewOptimizerPatchWithDefaults instantiates a new OptimizerPatch 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 NewOptimizerPatchWithDefaults() *OptimizerPatch { + this := OptimizerPatch{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *OptimizerPatch) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OptimizerPatch) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *OptimizerPatch) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *OptimizerPatch) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o OptimizerPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OptimizerPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableOptimizerPatch struct { + value *OptimizerPatch + isSet bool +} + +func (v NullableOptimizerPatch) Get() *OptimizerPatch { + return v.value +} + +func (v *NullableOptimizerPatch) Set(val *OptimizerPatch) { + v.value = val + v.isSet = true +} + +func (v NullableOptimizerPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableOptimizerPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOptimizerPatch(val *OptimizerPatch) *NullableOptimizerPatch { + return &NullableOptimizerPatch{value: val, isSet: true} +} + +func (v NullableOptimizerPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOptimizerPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_patch_distribution_payload.go b/services/cdn/v1beta2api/model_patch_distribution_payload.go new file mode 100644 index 000000000..f548c9c62 --- /dev/null +++ b/services/cdn/v1beta2api/model_patch_distribution_payload.go @@ -0,0 +1,161 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" +) + +// checks if the PatchDistributionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchDistributionPayload{} + +// PatchDistributionPayload Defines a partial distribution. Set values +type PatchDistributionPayload struct { + Config *ConfigPatch `json:"config,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` +} + +// NewPatchDistributionPayload instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayload() *PatchDistributionPayload { + this := PatchDistributionPayload{} + return &this +} + +// NewPatchDistributionPayloadWithDefaults instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayloadWithDefaults() *PatchDistributionPayload { + this := PatchDistributionPayload{} + return &this +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *PatchDistributionPayload) GetConfig() ConfigPatch { + if o == nil || IsNil(o.Config) { + var ret ConfigPatch + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchDistributionPayload) GetConfigOk() (*ConfigPatch, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *PatchDistributionPayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ConfigPatch and assigns it to the Config field. +func (o *PatchDistributionPayload) SetConfig(v ConfigPatch) { + o.Config = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *PatchDistributionPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchDistributionPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *PatchDistributionPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *PatchDistributionPayload) SetIntentId(v string) { + o.IntentId = &v +} + +func (o PatchDistributionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchDistributionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + return toSerialize, nil +} + +type NullablePatchDistributionPayload struct { + value *PatchDistributionPayload + isSet bool +} + +func (v NullablePatchDistributionPayload) Get() *PatchDistributionPayload { + return v.value +} + +func (v *NullablePatchDistributionPayload) Set(val *PatchDistributionPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePatchDistributionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchDistributionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchDistributionPayload(val *PatchDistributionPayload) *NullablePatchDistributionPayload { + return &NullablePatchDistributionPayload{value: val, isSet: true} +} + +func (v NullablePatchDistributionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchDistributionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_patch_distribution_response.go b/services/cdn/v1beta2api/model_patch_distribution_response.go new file mode 100644 index 000000000..88a8ed956 --- /dev/null +++ b/services/cdn/v1beta2api/model_patch_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PatchDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchDistributionResponse{} + +// PatchDistributionResponse struct for PatchDistributionResponse +type PatchDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _PatchDistributionResponse PatchDistributionResponse + +// NewPatchDistributionResponse instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponse(distribution Distribution) *PatchDistributionResponse { + this := PatchDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewPatchDistributionResponseWithDefaults instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponseWithDefaults() *PatchDistributionResponse { + this := PatchDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *PatchDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *PatchDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *PatchDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o PatchDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *PatchDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPatchDistributionResponse := _PatchDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPatchDistributionResponse) + + if err != nil { + return err + } + + *o = PatchDistributionResponse(varPatchDistributionResponse) + + return err +} + +type NullablePatchDistributionResponse struct { + value *PatchDistributionResponse + isSet bool +} + +func (v NullablePatchDistributionResponse) Get() *PatchDistributionResponse { + return v.value +} + +func (v *NullablePatchDistributionResponse) Set(val *PatchDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePatchDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchDistributionResponse(val *PatchDistributionResponse) *NullablePatchDistributionResponse { + return &NullablePatchDistributionResponse{value: val, isSet: true} +} + +func (v NullablePatchDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_purge_cache_payload.go b/services/cdn/v1beta2api/model_purge_cache_payload.go new file mode 100644 index 000000000..00779d85c --- /dev/null +++ b/services/cdn/v1beta2api/model_purge_cache_payload.go @@ -0,0 +1,125 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" +) + +// checks if the PurgeCachePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PurgeCachePayload{} + +// PurgeCachePayload struct for PurgeCachePayload +type PurgeCachePayload struct { + // Defines an optional path. If this is set, a granular purge is done. If missing, the entire cache is invalidated. During a granular cache purge, only the provided path is purged. Please do not that for example `/some/path` and `/some/path.txt` are considered different paths. + Path *string `json:"path,omitempty"` +} + +// NewPurgeCachePayload instantiates a new PurgeCachePayload 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 NewPurgeCachePayload() *PurgeCachePayload { + this := PurgeCachePayload{} + return &this +} + +// NewPurgeCachePayloadWithDefaults instantiates a new PurgeCachePayload 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 NewPurgeCachePayloadWithDefaults() *PurgeCachePayload { + this := PurgeCachePayload{} + return &this +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *PurgeCachePayload) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PurgeCachePayload) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *PurgeCachePayload) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *PurgeCachePayload) SetPath(v string) { + o.Path = &v +} + +func (o PurgeCachePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PurgeCachePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + return toSerialize, nil +} + +type NullablePurgeCachePayload struct { + value *PurgeCachePayload + isSet bool +} + +func (v NullablePurgeCachePayload) Get() *PurgeCachePayload { + return v.value +} + +func (v *NullablePurgeCachePayload) Set(val *PurgeCachePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePurgeCachePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePurgeCachePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePurgeCachePayload(val *PurgeCachePayload) *NullablePurgeCachePayload { + return &NullablePurgeCachePayload{value: val, isSet: true} +} + +func (v NullablePurgeCachePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePurgeCachePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_custom_certificate.go b/services/cdn/v1beta2api/model_put_custom_domain_custom_certificate.go new file mode 100644 index 000000000..827e6b394 --- /dev/null +++ b/services/cdn/v1beta2api/model_put_custom_domain_custom_certificate.go @@ -0,0 +1,214 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainCustomCertificate{} + +// PutCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. +type PutCustomDomainCustomCertificate struct { + // base64-encoded PEM-encoded certificate + Certificate string `json:"certificate"` + // base64-encoded PEM encoded key + Key string `json:"key"` + Type string `json:"type"` +} + +type _PutCustomDomainCustomCertificate PutCustomDomainCustomCertificate + +// NewPutCustomDomainCustomCertificate instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificate(certificate string, key string, types string) *PutCustomDomainCustomCertificate { + this := PutCustomDomainCustomCertificate{} + this.Certificate = certificate + this.Key = key + this.Type = types + return &this +} + +// NewPutCustomDomainCustomCertificateWithDefaults instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificateWithDefaults() *PutCustomDomainCustomCertificate { + this := PutCustomDomainCustomCertificate{} + return &this +} + +// GetCertificate returns the Certificate field value +func (o *PutCustomDomainCustomCertificate) GetCertificate() string { + if o == nil { + var ret string + return ret + } + + return o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Certificate, true +} + +// SetCertificate sets field value +func (o *PutCustomDomainCustomCertificate) SetCertificate(v string) { + o.Certificate = v +} + +// GetKey returns the Key field value +func (o *PutCustomDomainCustomCertificate) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *PutCustomDomainCustomCertificate) SetKey(v string) { + o.Key = v +} + +// GetType returns the Type field value +func (o *PutCustomDomainCustomCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PutCustomDomainCustomCertificate) SetType(v string) { + o.Type = v +} + +func (o PutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["certificate"] = o.Certificate + toSerialize["key"] = o.Key + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *PutCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "certificate", + "key", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainCustomCertificate := _PutCustomDomainCustomCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainCustomCertificate) + + if err != nil { + return err + } + + *o = PutCustomDomainCustomCertificate(varPutCustomDomainCustomCertificate) + + return err +} + +type NullablePutCustomDomainCustomCertificate struct { + value *PutCustomDomainCustomCertificate + isSet bool +} + +func (v NullablePutCustomDomainCustomCertificate) Get() *PutCustomDomainCustomCertificate { + return v.value +} + +func (v *NullablePutCustomDomainCustomCertificate) Set(val *PutCustomDomainCustomCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainCustomCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainCustomCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainCustomCertificate(val *PutCustomDomainCustomCertificate) *NullablePutCustomDomainCustomCertificate { + return &NullablePutCustomDomainCustomCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_managed_certificate.go b/services/cdn/v1beta2api/model_put_custom_domain_managed_certificate.go new file mode 100644 index 000000000..42effb7c3 --- /dev/null +++ b/services/cdn/v1beta2api/model_put_custom_domain_managed_certificate.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainManagedCertificate{} + +// PutCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you +type PutCustomDomainManagedCertificate struct { + Type string `json:"type"` +} + +type _PutCustomDomainManagedCertificate PutCustomDomainManagedCertificate + +// NewPutCustomDomainManagedCertificate instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificate(types string) *PutCustomDomainManagedCertificate { + this := PutCustomDomainManagedCertificate{} + this.Type = types + return &this +} + +// NewPutCustomDomainManagedCertificateWithDefaults instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificateWithDefaults() *PutCustomDomainManagedCertificate { + this := PutCustomDomainManagedCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *PutCustomDomainManagedCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PutCustomDomainManagedCertificate) SetType(v string) { + o.Type = v +} + +func (o PutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *PutCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainManagedCertificate := _PutCustomDomainManagedCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainManagedCertificate) + + if err != nil { + return err + } + + *o = PutCustomDomainManagedCertificate(varPutCustomDomainManagedCertificate) + + return err +} + +type NullablePutCustomDomainManagedCertificate struct { + value *PutCustomDomainManagedCertificate + isSet bool +} + +func (v NullablePutCustomDomainManagedCertificate) Get() *PutCustomDomainManagedCertificate { + return v.value +} + +func (v *NullablePutCustomDomainManagedCertificate) Set(val *PutCustomDomainManagedCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainManagedCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainManagedCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainManagedCertificate(val *PutCustomDomainManagedCertificate) *NullablePutCustomDomainManagedCertificate { + return &NullablePutCustomDomainManagedCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_payload.go b/services/cdn/v1beta2api/model_put_custom_domain_payload.go new file mode 100644 index 000000000..ea06f7f41 --- /dev/null +++ b/services/cdn/v1beta2api/model_put_custom_domain_payload.go @@ -0,0 +1,161 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" +) + +// checks if the PutCustomDomainPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainPayload{} + +// PutCustomDomainPayload struct for PutCustomDomainPayload +type PutCustomDomainPayload struct { + Certificate *PutCustomDomainPayloadCertificate `json:"certificate,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` +} + +// NewPutCustomDomainPayload instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayload() *PutCustomDomainPayload { + this := PutCustomDomainPayload{} + return &this +} + +// NewPutCustomDomainPayloadWithDefaults instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayloadWithDefaults() *PutCustomDomainPayload { + this := PutCustomDomainPayload{} + return &this +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise. +func (o *PutCustomDomainPayload) GetCertificate() PutCustomDomainPayloadCertificate { + if o == nil || IsNil(o.Certificate) { + var ret PutCustomDomainPayloadCertificate + return ret + } + return *o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainPayload) GetCertificateOk() (*PutCustomDomainPayloadCertificate, bool) { + if o == nil || IsNil(o.Certificate) { + return nil, false + } + return o.Certificate, true +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PutCustomDomainPayload) HasCertificate() bool { + if o != nil && !IsNil(o.Certificate) { + return true + } + + return false +} + +// SetCertificate gets a reference to the given PutCustomDomainPayloadCertificate and assigns it to the Certificate field. +func (o *PutCustomDomainPayload) SetCertificate(v PutCustomDomainPayloadCertificate) { + o.Certificate = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *PutCustomDomainPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *PutCustomDomainPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *PutCustomDomainPayload) SetIntentId(v string) { + o.IntentId = &v +} + +func (o PutCustomDomainPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Certificate) { + toSerialize["certificate"] = o.Certificate + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + return toSerialize, nil +} + +type NullablePutCustomDomainPayload struct { + value *PutCustomDomainPayload + isSet bool +} + +func (v NullablePutCustomDomainPayload) Get() *PutCustomDomainPayload { + return v.value +} + +func (v *NullablePutCustomDomainPayload) Set(val *PutCustomDomainPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainPayload(val *PutCustomDomainPayload) *NullablePutCustomDomainPayload { + return &NullablePutCustomDomainPayload{value: val, isSet: true} +} + +func (v NullablePutCustomDomainPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_payload_certificate.go b/services/cdn/v1beta2api/model_put_custom_domain_payload_certificate.go new file mode 100644 index 000000000..0822649b2 --- /dev/null +++ b/services/cdn/v1beta2api/model_put_custom_domain_payload_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// PutCustomDomainPayloadCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted +type PutCustomDomainPayloadCertificate struct { + PutCustomDomainCustomCertificate *PutCustomDomainCustomCertificate + PutCustomDomainManagedCertificate *PutCustomDomainManagedCertificate +} + +// PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainCustomCertificate wrapped in PutCustomDomainPayloadCertificate +func PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainCustomCertificate) PutCustomDomainPayloadCertificate { + return PutCustomDomainPayloadCertificate{ + PutCustomDomainCustomCertificate: v, + } +} + +// PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainManagedCertificate wrapped in PutCustomDomainPayloadCertificate +func PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainManagedCertificate) PutCustomDomainPayloadCertificate { + return PutCustomDomainPayloadCertificate{ + PutCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PutCustomDomainPayloadCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into PutCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.PutCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.PutCustomDomainCustomCertificate, return on the first match + } else { + dst.PutCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into PutCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.PutCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.PutCustomDomainManagedCertificate, return on the first match + } else { + dst.PutCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { + if src.PutCustomDomainCustomCertificate != nil { + return json.Marshal(&src.PutCustomDomainCustomCertificate) + } + + if src.PutCustomDomainManagedCertificate != nil { + return json.Marshal(&src.PutCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *PutCustomDomainPayloadCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.PutCustomDomainCustomCertificate != nil { + return obj.PutCustomDomainCustomCertificate + } + + if obj.PutCustomDomainManagedCertificate != nil { + return obj.PutCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj PutCustomDomainPayloadCertificate) GetActualInstanceValue() interface{} { + if obj.PutCustomDomainCustomCertificate != nil { + return *obj.PutCustomDomainCustomCertificate + } + + if obj.PutCustomDomainManagedCertificate != nil { + return *obj.PutCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullablePutCustomDomainPayloadCertificate struct { + value *PutCustomDomainPayloadCertificate + isSet bool +} + +func (v NullablePutCustomDomainPayloadCertificate) Get() *PutCustomDomainPayloadCertificate { + return v.value +} + +func (v *NullablePutCustomDomainPayloadCertificate) Set(val *PutCustomDomainPayloadCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainPayloadCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainPayloadCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainPayloadCertificate(val *PutCustomDomainPayloadCertificate) *NullablePutCustomDomainPayloadCertificate { + return &NullablePutCustomDomainPayloadCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainPayloadCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_response.go b/services/cdn/v1beta2api/model_put_custom_domain_response.go new file mode 100644 index 000000000..2e4425c4b --- /dev/null +++ b/services/cdn/v1beta2api/model_put_custom_domain_response.go @@ -0,0 +1,192 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainResponse{} + +// PutCustomDomainResponse struct for PutCustomDomainResponse +type PutCustomDomainResponse struct { + Certificate *PutCustomDomainResponseCertificate `json:"certificate,omitempty"` + CustomDomain CustomDomain `json:"customDomain"` +} + +type _PutCustomDomainResponse PutCustomDomainResponse + +// NewPutCustomDomainResponse instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponse(customDomain CustomDomain) *PutCustomDomainResponse { + this := PutCustomDomainResponse{} + this.CustomDomain = customDomain + return &this +} + +// NewPutCustomDomainResponseWithDefaults instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponseWithDefaults() *PutCustomDomainResponse { + this := PutCustomDomainResponse{} + return &this +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise. +func (o *PutCustomDomainResponse) GetCertificate() PutCustomDomainResponseCertificate { + if o == nil || IsNil(o.Certificate) { + var ret PutCustomDomainResponseCertificate + return ret + } + return *o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainResponse) GetCertificateOk() (*PutCustomDomainResponseCertificate, bool) { + if o == nil || IsNil(o.Certificate) { + return nil, false + } + return o.Certificate, true +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PutCustomDomainResponse) HasCertificate() bool { + if o != nil && !IsNil(o.Certificate) { + return true + } + + return false +} + +// SetCertificate gets a reference to the given PutCustomDomainResponseCertificate and assigns it to the Certificate field. +func (o *PutCustomDomainResponse) SetCertificate(v PutCustomDomainResponseCertificate) { + o.Certificate = &v +} + +// GetCustomDomain returns the CustomDomain field value +func (o *PutCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil { + var ret CustomDomain + return ret + } + + return o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil { + return nil, false + } + return &o.CustomDomain, true +} + +// SetCustomDomain sets field value +func (o *PutCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = v +} + +func (o PutCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Certificate) { + toSerialize["certificate"] = o.Certificate + } + toSerialize["customDomain"] = o.CustomDomain + return toSerialize, nil +} + +func (o *PutCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "customDomain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainResponse := _PutCustomDomainResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainResponse) + + if err != nil { + return err + } + + *o = PutCustomDomainResponse(varPutCustomDomainResponse) + + return err +} + +type NullablePutCustomDomainResponse struct { + value *PutCustomDomainResponse + isSet bool +} + +func (v NullablePutCustomDomainResponse) Get() *PutCustomDomainResponse { + return v.value +} + +func (v *NullablePutCustomDomainResponse) Set(val *PutCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainResponse(val *PutCustomDomainResponse) *NullablePutCustomDomainResponse { + return &NullablePutCustomDomainResponse{value: val, isSet: true} +} + +func (v NullablePutCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_put_custom_domain_response_certificate.go b/services/cdn/v1beta2api/model_put_custom_domain_response_certificate.go new file mode 100644 index 000000000..bfa384d9c --- /dev/null +++ b/services/cdn/v1beta2api/model_put_custom_domain_response_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// PutCustomDomainResponseCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted +type PutCustomDomainResponseCertificate struct { + GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate + GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate +} + +// GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in PutCustomDomainResponseCertificate +func GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) PutCustomDomainResponseCertificate { + return PutCustomDomainResponseCertificate{ + GetCustomDomainCustomCertificate: v, + } +} + +// GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in PutCustomDomainResponseCertificate +func GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) PutCustomDomainResponseCertificate { + return PutCustomDomainResponseCertificate{ + GetCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PutCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into GetCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match + } else { + dst.GetCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into GetCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match + } else { + dst.GetCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + if src.GetCustomDomainCustomCertificate != nil { + return json.Marshal(&src.GetCustomDomainCustomCertificate) + } + + if src.GetCustomDomainManagedCertificate != nil { + return json.Marshal(&src.GetCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *PutCustomDomainResponseCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.GetCustomDomainCustomCertificate != nil { + return obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj PutCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { + if obj.GetCustomDomainCustomCertificate != nil { + return *obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return *obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullablePutCustomDomainResponseCertificate struct { + value *PutCustomDomainResponseCertificate + isSet bool +} + +func (v NullablePutCustomDomainResponseCertificate) Get() *PutCustomDomainResponseCertificate { + return v.value +} + +func (v *NullablePutCustomDomainResponseCertificate) Set(val *PutCustomDomainResponseCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainResponseCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainResponseCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainResponseCertificate(val *PutCustomDomainResponseCertificate) *NullablePutCustomDomainResponseCertificate { + return &NullablePutCustomDomainResponseCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_region.go b/services/cdn/v1beta2api/model_region.go new file mode 100644 index 000000000..b5eff1cd1 --- /dev/null +++ b/services/cdn/v1beta2api/model_region.go @@ -0,0 +1,116 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// Region The following regions exist: - `EU` - Europe - `US` - United States / North America - `AF` - Africa - `SA` - South America - `ASIA` - Asia and Oceania +type Region string + +// List of Region +const ( + REGION_EU Region = "EU" + REGION_US Region = "US" + REGION_AF Region = "AF" + REGION_SA Region = "SA" + REGION_ASIA Region = "ASIA" +) + +// All allowed values of Region enum +var AllowedRegionEnumValues = []Region{ + "EU", + "US", + "AF", + "SA", + "ASIA", +} + +func (v *Region) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Region(value) + for _, existing := range AllowedRegionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Region", value) +} + +// NewRegionFromValue returns a pointer to a valid Region +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRegionFromValue(v string) (*Region, error) { + ev := Region(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Region: valid values are %v", v, AllowedRegionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Region) IsValid() bool { + for _, existing := range AllowedRegionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Region value +func (v Region) Ptr() *Region { + return &v +} + +type NullableRegion struct { + value *Region + isSet bool +} + +func (v NullableRegion) Get() *Region { + return v.value +} + +func (v *NullableRegion) Set(val *Region) { + v.value = val + v.isSet = true +} + +func (v NullableRegion) IsSet() bool { + return v.isSet +} + +func (v *NullableRegion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegion(val *Region) *NullableRegion { + return &NullableRegion{value: val, isSet: true} +} + +func (v NullableRegion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_status_error.go b/services/cdn/v1beta2api/model_status_error.go new file mode 100644 index 000000000..ff59ca58b --- /dev/null +++ b/services/cdn/v1beta2api/model_status_error.go @@ -0,0 +1,223 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the StatusError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StatusError{} + +// StatusError struct for StatusError +type StatusError struct { + // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. + De *string `json:"de,omitempty"` + // An english translation string corresponding to the error key. An english translation key is always present. + En string `json:"en"` + // An enum value that describes a Status Error. + Key string `json:"key"` +} + +type _StatusError StatusError + +// NewStatusError instantiates a new StatusError 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 NewStatusError(en string, key string) *StatusError { + this := StatusError{} + this.En = en + this.Key = key + return &this +} + +// NewStatusErrorWithDefaults instantiates a new StatusError 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 NewStatusErrorWithDefaults() *StatusError { + this := StatusError{} + return &this +} + +// GetDe returns the De field value if set, zero value otherwise. +func (o *StatusError) GetDe() string { + if o == nil || IsNil(o.De) { + var ret string + return ret + } + return *o.De +} + +// GetDeOk returns a tuple with the De field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusError) GetDeOk() (*string, bool) { + if o == nil || IsNil(o.De) { + return nil, false + } + return o.De, true +} + +// HasDe returns a boolean if a field has been set. +func (o *StatusError) HasDe() bool { + if o != nil && !IsNil(o.De) { + return true + } + + return false +} + +// SetDe gets a reference to the given string and assigns it to the De field. +func (o *StatusError) SetDe(v string) { + o.De = &v +} + +// GetEn returns the En field value +func (o *StatusError) GetEn() string { + if o == nil { + var ret string + return ret + } + + return o.En +} + +// GetEnOk returns a tuple with the En field value +// and a boolean to check if the value has been set. +func (o *StatusError) GetEnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.En, true +} + +// SetEn sets field value +func (o *StatusError) SetEn(v string) { + o.En = v +} + +// GetKey returns the Key field value +func (o *StatusError) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *StatusError) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *StatusError) SetKey(v string) { + o.Key = v +} + +func (o StatusError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StatusError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.De) { + toSerialize["de"] = o.De + } + toSerialize["en"] = o.En + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *StatusError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "en", + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStatusError := _StatusError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varStatusError) + + if err != nil { + return err + } + + *o = StatusError(varStatusError) + + return err +} + +type NullableStatusError struct { + value *StatusError + isSet bool +} + +func (v NullableStatusError) Get() *StatusError { + return v.value +} + +func (v *NullableStatusError) Set(val *StatusError) { + v.value = val + v.isSet = true +} + +func (v NullableStatusError) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusError(val *StatusError) *NullableStatusError { + return &NullableStatusError{value: val, isSet: true} +} + +func (v NullableStatusError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_config.go b/services/cdn/v1beta2api/model_waf_config.go new file mode 100644 index 000000000..55356d546 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_config.go @@ -0,0 +1,655 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafConfig{} + +// WafConfig Configuration of the WAF of a distribution A WAF Config always contains a WAF Mode and Type. If a WAF was never enabled, most of the properties are not present. To **enable** the WAF for your Distribution, you must set the `mode` to `ENABLED` or `LOG_ONLY`. This causes the other properties to be populated. ## Rules There are 9 properties used to control which Rules are enabled, disabled or set to Log-Only. These properties can be grouped in 3 groups of 3. Each of these groups varies in specificity: Rules are more specific than Rule Groups, which in turn are more specific than Collections. More specific definitions override more generic definitions. ### Collections - `enabledRuleCollectionIds` - `disabledRuleCollectionIds` - `logOnlyRuleCollectionIds` These are the least specific selectors. As of 2025, only two collections exist: - `@builtin/crs/response`, containing all Rules regarding Responses - `@builtin/crs/request`, containing all Rules regarding Requests More collections may be added in the future ### Rule Groups - `enabledRuleGroupIds` - `disabledRuleGroupIds` - `logOnlyRuleGroupIds` These are more specific than Collections and will override their selector. You can find all available Rule Groups by calling the `ListWafCollections` Operation. ### Rules - `enabledRuleIds` - `disabledRuleIds` - `logOnlyRuleGds` Being the most specific selectors, these will override both Collection and Rule Group selectors. You can find all available Rule Groups by calling the `ListWafCollections` Operation. ### TIP: Review resolved config If you call `GetDistribution` with `?withWafStatus=true`, you get back a resolved WAF Rules Config which contains a `waf` property which you can inspect to see why a Rule is either enabled, disabled or logOnly. +type WafConfig struct { + // This whitelist restricts which HTTP methods the distribution accepts. Requests using non-whitelisted methods are blocked by the WAF before reaching the origin. Common methods: `GET`, `POST`, `PUT`, `DELETE`, `PATCH`, `HEAD`, `OPTIONS`, `CONNECT`, `TRACE` Validation ensures: 1. At least one method is allowed 2. No duplicate methods (e.g., `GET` appearing twice) 3. Each method is valid per HTTP standards + AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` + AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` + // This allow list restricts which Content-Type headers are accepted in request bodies. Format: Must be `type/subtype` with no spaces. Common content types: - `application/json` - `application/x-www-form-urlencoded` - `multipart/form-data` - `text/html` - `text/plain` - `application/xml` + AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` + // Ids of WAF Collections to mark as disabled + DisabledRuleCollectionIds []string `json:"disabledRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as disabled + DisabledRuleGroupIds []string `json:"disabledRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** disabled for this distribution. + DisabledRuleIds []string `json:"disabledRuleIds,omitempty"` + // Ids of WAF Collections to mark as enabled + EnabledRuleCollectionIds []string `json:"enabledRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as enabled + EnabledRuleGroupIds []string `json:"enabledRuleGroupIds,omitempty"` + // Ids of the WAF rules that are **explicitly** enabled for this distribution. If this rule is in a disabled / log Only RuleGroup or Collection, it will be enabled regardless as `enabledRuleIds` overrides those in specificity. Do note that rules can also be enabled because a Rulegroup or Collection is enabled. **DO NOT** use this property to find all active rules. Instead, pass `?withWafStatus=true` as a query parameter to `GetDistribution` or `ListDistributions`. This will expose the `waf` Property on distribution Level. From there you can `$.waf.enabledRules.map(e => e.id)` to get a list of all enabled rules. + EnabledRuleIds []string `json:"enabledRuleIds"` + // Ids of WAF Collections to mark as log Only. + LogOnlyRuleCollectionIds []string `json:"logOnlyRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as log Only. + LogOnlyRuleGroupIds []string `json:"logOnlyRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** marked as Log Only for this distribution. + LogOnlyRuleIds []string `json:"logOnlyRuleIds,omitempty"` + Mode WafMode `json:"mode"` + ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` + Type WafType `json:"type"` +} + +type _WafConfig WafConfig + +// NewWafConfig instantiates a new WafConfig 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 NewWafConfig(enabledRuleIds []string, mode WafMode, types WafType) *WafConfig { + this := WafConfig{} + this.EnabledRuleIds = enabledRuleIds + this.Mode = mode + this.Type = types + return &this +} + +// NewWafConfigWithDefaults instantiates a new WafConfig 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 NewWafConfigWithDefaults() *WafConfig { + this := WafConfig{} + return &this +} + +// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedHttpMethods() []string { + if o == nil || IsNil(o.AllowedHttpMethods) { + var ret []string + return ret + } + return o.AllowedHttpMethods +} + +// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedHttpMethodsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpMethods) { + return nil, false + } + return o.AllowedHttpMethods, true +} + +// HasAllowedHttpMethods returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedHttpMethods() bool { + if o != nil && !IsNil(o.AllowedHttpMethods) { + return true + } + + return false +} + +// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. +func (o *WafConfig) SetAllowedHttpMethods(v []string) { + o.AllowedHttpMethods = v +} + +// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedHttpVersions() []string { + if o == nil || IsNil(o.AllowedHttpVersions) { + var ret []string + return ret + } + return o.AllowedHttpVersions +} + +// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedHttpVersionsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpVersions) { + return nil, false + } + return o.AllowedHttpVersions, true +} + +// HasAllowedHttpVersions returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedHttpVersions() bool { + if o != nil && !IsNil(o.AllowedHttpVersions) { + return true + } + + return false +} + +// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. +func (o *WafConfig) SetAllowedHttpVersions(v []string) { + o.AllowedHttpVersions = v +} + +// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedRequestContentTypes() []string { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + var ret []string + return ret + } + return o.AllowedRequestContentTypes +} + +// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedRequestContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + return nil, false + } + return o.AllowedRequestContentTypes, true +} + +// HasAllowedRequestContentTypes returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedRequestContentTypes() bool { + if o != nil && !IsNil(o.AllowedRequestContentTypes) { + return true + } + + return false +} + +// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. +func (o *WafConfig) SetAllowedRequestContentTypes(v []string) { + o.AllowedRequestContentTypes = v +} + +// GetDisabledRuleCollectionIds returns the DisabledRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfig) GetDisabledRuleCollectionIds() []string { + if o == nil || IsNil(o.DisabledRuleCollectionIds) { + var ret []string + return ret + } + return o.DisabledRuleCollectionIds +} + +// GetDisabledRuleCollectionIdsOk returns a tuple with the DisabledRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetDisabledRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleCollectionIds) { + return nil, false + } + return o.DisabledRuleCollectionIds, true +} + +// HasDisabledRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfig) HasDisabledRuleCollectionIds() bool { + if o != nil && !IsNil(o.DisabledRuleCollectionIds) { + return true + } + + return false +} + +// SetDisabledRuleCollectionIds gets a reference to the given []string and assigns it to the DisabledRuleCollectionIds field. +func (o *WafConfig) SetDisabledRuleCollectionIds(v []string) { + o.DisabledRuleCollectionIds = v +} + +// GetDisabledRuleGroupIds returns the DisabledRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfig) GetDisabledRuleGroupIds() []string { + if o == nil || IsNil(o.DisabledRuleGroupIds) { + var ret []string + return ret + } + return o.DisabledRuleGroupIds +} + +// GetDisabledRuleGroupIdsOk returns a tuple with the DisabledRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetDisabledRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleGroupIds) { + return nil, false + } + return o.DisabledRuleGroupIds, true +} + +// HasDisabledRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfig) HasDisabledRuleGroupIds() bool { + if o != nil && !IsNil(o.DisabledRuleGroupIds) { + return true + } + + return false +} + +// SetDisabledRuleGroupIds gets a reference to the given []string and assigns it to the DisabledRuleGroupIds field. +func (o *WafConfig) SetDisabledRuleGroupIds(v []string) { + o.DisabledRuleGroupIds = v +} + +// GetDisabledRuleIds returns the DisabledRuleIds field value if set, zero value otherwise. +func (o *WafConfig) GetDisabledRuleIds() []string { + if o == nil || IsNil(o.DisabledRuleIds) { + var ret []string + return ret + } + return o.DisabledRuleIds +} + +// GetDisabledRuleIdsOk returns a tuple with the DisabledRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetDisabledRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleIds) { + return nil, false + } + return o.DisabledRuleIds, true +} + +// HasDisabledRuleIds returns a boolean if a field has been set. +func (o *WafConfig) HasDisabledRuleIds() bool { + if o != nil && !IsNil(o.DisabledRuleIds) { + return true + } + + return false +} + +// SetDisabledRuleIds gets a reference to the given []string and assigns it to the DisabledRuleIds field. +func (o *WafConfig) SetDisabledRuleIds(v []string) { + o.DisabledRuleIds = v +} + +// GetEnabledRuleCollectionIds returns the EnabledRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfig) GetEnabledRuleCollectionIds() []string { + if o == nil || IsNil(o.EnabledRuleCollectionIds) { + var ret []string + return ret + } + return o.EnabledRuleCollectionIds +} + +// GetEnabledRuleCollectionIdsOk returns a tuple with the EnabledRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetEnabledRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleCollectionIds) { + return nil, false + } + return o.EnabledRuleCollectionIds, true +} + +// HasEnabledRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfig) HasEnabledRuleCollectionIds() bool { + if o != nil && !IsNil(o.EnabledRuleCollectionIds) { + return true + } + + return false +} + +// SetEnabledRuleCollectionIds gets a reference to the given []string and assigns it to the EnabledRuleCollectionIds field. +func (o *WafConfig) SetEnabledRuleCollectionIds(v []string) { + o.EnabledRuleCollectionIds = v +} + +// GetEnabledRuleGroupIds returns the EnabledRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfig) GetEnabledRuleGroupIds() []string { + if o == nil || IsNil(o.EnabledRuleGroupIds) { + var ret []string + return ret + } + return o.EnabledRuleGroupIds +} + +// GetEnabledRuleGroupIdsOk returns a tuple with the EnabledRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetEnabledRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleGroupIds) { + return nil, false + } + return o.EnabledRuleGroupIds, true +} + +// HasEnabledRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfig) HasEnabledRuleGroupIds() bool { + if o != nil && !IsNil(o.EnabledRuleGroupIds) { + return true + } + + return false +} + +// SetEnabledRuleGroupIds gets a reference to the given []string and assigns it to the EnabledRuleGroupIds field. +func (o *WafConfig) SetEnabledRuleGroupIds(v []string) { + o.EnabledRuleGroupIds = v +} + +// GetEnabledRuleIds returns the EnabledRuleIds field value +func (o *WafConfig) GetEnabledRuleIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.EnabledRuleIds +} + +// GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetEnabledRuleIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.EnabledRuleIds, true +} + +// SetEnabledRuleIds sets field value +func (o *WafConfig) SetEnabledRuleIds(v []string) { + o.EnabledRuleIds = v +} + +// GetLogOnlyRuleCollectionIds returns the LogOnlyRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfig) GetLogOnlyRuleCollectionIds() []string { + if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { + var ret []string + return ret + } + return o.LogOnlyRuleCollectionIds +} + +// GetLogOnlyRuleCollectionIdsOk returns a tuple with the LogOnlyRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetLogOnlyRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { + return nil, false + } + return o.LogOnlyRuleCollectionIds, true +} + +// HasLogOnlyRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfig) HasLogOnlyRuleCollectionIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleCollectionIds) { + return true + } + + return false +} + +// SetLogOnlyRuleCollectionIds gets a reference to the given []string and assigns it to the LogOnlyRuleCollectionIds field. +func (o *WafConfig) SetLogOnlyRuleCollectionIds(v []string) { + o.LogOnlyRuleCollectionIds = v +} + +// GetLogOnlyRuleGroupIds returns the LogOnlyRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfig) GetLogOnlyRuleGroupIds() []string { + if o == nil || IsNil(o.LogOnlyRuleGroupIds) { + var ret []string + return ret + } + return o.LogOnlyRuleGroupIds +} + +// GetLogOnlyRuleGroupIdsOk returns a tuple with the LogOnlyRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetLogOnlyRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleGroupIds) { + return nil, false + } + return o.LogOnlyRuleGroupIds, true +} + +// HasLogOnlyRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfig) HasLogOnlyRuleGroupIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleGroupIds) { + return true + } + + return false +} + +// SetLogOnlyRuleGroupIds gets a reference to the given []string and assigns it to the LogOnlyRuleGroupIds field. +func (o *WafConfig) SetLogOnlyRuleGroupIds(v []string) { + o.LogOnlyRuleGroupIds = v +} + +// GetLogOnlyRuleIds returns the LogOnlyRuleIds field value if set, zero value otherwise. +func (o *WafConfig) GetLogOnlyRuleIds() []string { + if o == nil || IsNil(o.LogOnlyRuleIds) { + var ret []string + return ret + } + return o.LogOnlyRuleIds +} + +// GetLogOnlyRuleIdsOk returns a tuple with the LogOnlyRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetLogOnlyRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleIds) { + return nil, false + } + return o.LogOnlyRuleIds, true +} + +// HasLogOnlyRuleIds returns a boolean if a field has been set. +func (o *WafConfig) HasLogOnlyRuleIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleIds) { + return true + } + + return false +} + +// SetLogOnlyRuleIds gets a reference to the given []string and assigns it to the LogOnlyRuleIds field. +func (o *WafConfig) SetLogOnlyRuleIds(v []string) { + o.LogOnlyRuleIds = v +} + +// GetMode returns the Mode field value +func (o *WafConfig) GetMode() WafMode { + if o == nil { + var ret WafMode + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetModeOk() (*WafMode, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *WafConfig) SetMode(v WafMode) { + o.Mode = v +} + +// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. +func (o *WafConfig) GetParanoiaLevel() WafParanoiaLevel { + if o == nil || IsNil(o.ParanoiaLevel) { + var ret WafParanoiaLevel + return ret + } + return *o.ParanoiaLevel +} + +// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { + if o == nil || IsNil(o.ParanoiaLevel) { + return nil, false + } + return o.ParanoiaLevel, true +} + +// HasParanoiaLevel returns a boolean if a field has been set. +func (o *WafConfig) HasParanoiaLevel() bool { + if o != nil && !IsNil(o.ParanoiaLevel) { + return true + } + + return false +} + +// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. +func (o *WafConfig) SetParanoiaLevel(v WafParanoiaLevel) { + o.ParanoiaLevel = &v +} + +// GetType returns the Type field value +func (o *WafConfig) GetType() WafType { + if o == nil { + var ret WafType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetTypeOk() (*WafType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafConfig) SetType(v WafType) { + o.Type = v +} + +func (o WafConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedHttpMethods) { + toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods + } + if !IsNil(o.AllowedHttpVersions) { + toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions + } + if !IsNil(o.AllowedRequestContentTypes) { + toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes + } + if !IsNil(o.DisabledRuleCollectionIds) { + toSerialize["disabledRuleCollectionIds"] = o.DisabledRuleCollectionIds + } + if !IsNil(o.DisabledRuleGroupIds) { + toSerialize["disabledRuleGroupIds"] = o.DisabledRuleGroupIds + } + if !IsNil(o.DisabledRuleIds) { + toSerialize["disabledRuleIds"] = o.DisabledRuleIds + } + if !IsNil(o.EnabledRuleCollectionIds) { + toSerialize["enabledRuleCollectionIds"] = o.EnabledRuleCollectionIds + } + if !IsNil(o.EnabledRuleGroupIds) { + toSerialize["enabledRuleGroupIds"] = o.EnabledRuleGroupIds + } + toSerialize["enabledRuleIds"] = o.EnabledRuleIds + if !IsNil(o.LogOnlyRuleCollectionIds) { + toSerialize["logOnlyRuleCollectionIds"] = o.LogOnlyRuleCollectionIds + } + if !IsNil(o.LogOnlyRuleGroupIds) { + toSerialize["logOnlyRuleGroupIds"] = o.LogOnlyRuleGroupIds + } + if !IsNil(o.LogOnlyRuleIds) { + toSerialize["logOnlyRuleIds"] = o.LogOnlyRuleIds + } + toSerialize["mode"] = o.Mode + if !IsNil(o.ParanoiaLevel) { + toSerialize["paranoiaLevel"] = o.ParanoiaLevel + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabledRuleIds", + "mode", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafConfig := _WafConfig{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafConfig) + + if err != nil { + return err + } + + *o = WafConfig(varWafConfig) + + return err +} + +type NullableWafConfig struct { + value *WafConfig + isSet bool +} + +func (v NullableWafConfig) Get() *WafConfig { + return v.value +} + +func (v *NullableWafConfig) Set(val *WafConfig) { + v.value = val + v.isSet = true +} + +func (v NullableWafConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableWafConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafConfig(val *WafConfig) *NullableWafConfig { + return &NullableWafConfig{value: val, isSet: true} +} + +func (v NullableWafConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_config_patch.go b/services/cdn/v1beta2api/model_waf_config_patch.go new file mode 100644 index 000000000..4c79e755c --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_config_patch.go @@ -0,0 +1,637 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" +) + +// checks if the WafConfigPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafConfigPatch{} + +// WafConfigPatch Modify the WAF Configuration ## WAF Rules You can modify the set of enabled, disabled and log-only Rules by modifying these 9 properties: - enabledRuleIds - disabledRuleIds - logOnlyRuleIds - enabledRuleGroupIds - disabledRuleGroupIds - logOnlyRuleGroupIds - enabledRuleCollectionIds - disabledRuleCollectionIds - logOnlyRuleCollectionIds Please inquire the `WafConfig` Description on how the effective configuration is determined. For patching, if an ID is already used in one of the properties, it will be removed (and effectively moved) to the new property. If patching multiple properties with the same ID (e.g. writing `@builtin/crs/response` to `logOnlyRuleCollectionIds` and `enabledRuleCollectionIds`), the request will be rejected with a 400. +type WafConfigPatch struct { + AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` + AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` + AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` + // Ids of WAF Collections to mark as disabled + DisabledRuleCollectionIds []string `json:"disabledRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as disabled + DisabledRuleGroupIds []string `json:"disabledRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** disabled for this distribution. + DisabledRuleIds []string `json:"disabledRuleIds,omitempty"` + // Ids of WAF Collections to mark as enabled + EnabledRuleCollectionIds []string `json:"enabledRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as enabled + EnabledRuleGroupIds []string `json:"enabledRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** enabled for this distribution. + EnabledRuleIds []string `json:"enabledRuleIds,omitempty"` + // Ids of WAF Collections to mark as log Only. + LogOnlyRuleCollectionIds []string `json:"logOnlyRuleCollectionIds,omitempty"` + // Ids of WAF Rule Groups to mark as log Only. + LogOnlyRuleGroupIds []string `json:"logOnlyRuleGroupIds,omitempty"` + // Ids of WAF Rules that are **explicitly** marked as Log Only for this distribution. + LogOnlyRuleIds []string `json:"logOnlyRuleIds,omitempty"` + Mode *WafMode `json:"mode,omitempty"` + ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` + Type *WafType `json:"type,omitempty"` +} + +// NewWafConfigPatch instantiates a new WafConfigPatch 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 NewWafConfigPatch() *WafConfigPatch { + this := WafConfigPatch{} + return &this +} + +// NewWafConfigPatchWithDefaults instantiates a new WafConfigPatch 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 NewWafConfigPatchWithDefaults() *WafConfigPatch { + this := WafConfigPatch{} + return &this +} + +// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedHttpMethods() []string { + if o == nil || IsNil(o.AllowedHttpMethods) { + var ret []string + return ret + } + return o.AllowedHttpMethods +} + +// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedHttpMethodsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpMethods) { + return nil, false + } + return o.AllowedHttpMethods, true +} + +// HasAllowedHttpMethods returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedHttpMethods() bool { + if o != nil && !IsNil(o.AllowedHttpMethods) { + return true + } + + return false +} + +// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. +func (o *WafConfigPatch) SetAllowedHttpMethods(v []string) { + o.AllowedHttpMethods = v +} + +// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedHttpVersions() []string { + if o == nil || IsNil(o.AllowedHttpVersions) { + var ret []string + return ret + } + return o.AllowedHttpVersions +} + +// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedHttpVersionsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpVersions) { + return nil, false + } + return o.AllowedHttpVersions, true +} + +// HasAllowedHttpVersions returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedHttpVersions() bool { + if o != nil && !IsNil(o.AllowedHttpVersions) { + return true + } + + return false +} + +// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. +func (o *WafConfigPatch) SetAllowedHttpVersions(v []string) { + o.AllowedHttpVersions = v +} + +// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedRequestContentTypes() []string { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + var ret []string + return ret + } + return o.AllowedRequestContentTypes +} + +// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedRequestContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + return nil, false + } + return o.AllowedRequestContentTypes, true +} + +// HasAllowedRequestContentTypes returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedRequestContentTypes() bool { + if o != nil && !IsNil(o.AllowedRequestContentTypes) { + return true + } + + return false +} + +// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. +func (o *WafConfigPatch) SetAllowedRequestContentTypes(v []string) { + o.AllowedRequestContentTypes = v +} + +// GetDisabledRuleCollectionIds returns the DisabledRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetDisabledRuleCollectionIds() []string { + if o == nil || IsNil(o.DisabledRuleCollectionIds) { + var ret []string + return ret + } + return o.DisabledRuleCollectionIds +} + +// GetDisabledRuleCollectionIdsOk returns a tuple with the DisabledRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetDisabledRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleCollectionIds) { + return nil, false + } + return o.DisabledRuleCollectionIds, true +} + +// HasDisabledRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasDisabledRuleCollectionIds() bool { + if o != nil && !IsNil(o.DisabledRuleCollectionIds) { + return true + } + + return false +} + +// SetDisabledRuleCollectionIds gets a reference to the given []string and assigns it to the DisabledRuleCollectionIds field. +func (o *WafConfigPatch) SetDisabledRuleCollectionIds(v []string) { + o.DisabledRuleCollectionIds = v +} + +// GetDisabledRuleGroupIds returns the DisabledRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetDisabledRuleGroupIds() []string { + if o == nil || IsNil(o.DisabledRuleGroupIds) { + var ret []string + return ret + } + return o.DisabledRuleGroupIds +} + +// GetDisabledRuleGroupIdsOk returns a tuple with the DisabledRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetDisabledRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleGroupIds) { + return nil, false + } + return o.DisabledRuleGroupIds, true +} + +// HasDisabledRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasDisabledRuleGroupIds() bool { + if o != nil && !IsNil(o.DisabledRuleGroupIds) { + return true + } + + return false +} + +// SetDisabledRuleGroupIds gets a reference to the given []string and assigns it to the DisabledRuleGroupIds field. +func (o *WafConfigPatch) SetDisabledRuleGroupIds(v []string) { + o.DisabledRuleGroupIds = v +} + +// GetDisabledRuleIds returns the DisabledRuleIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetDisabledRuleIds() []string { + if o == nil || IsNil(o.DisabledRuleIds) { + var ret []string + return ret + } + return o.DisabledRuleIds +} + +// GetDisabledRuleIdsOk returns a tuple with the DisabledRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetDisabledRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DisabledRuleIds) { + return nil, false + } + return o.DisabledRuleIds, true +} + +// HasDisabledRuleIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasDisabledRuleIds() bool { + if o != nil && !IsNil(o.DisabledRuleIds) { + return true + } + + return false +} + +// SetDisabledRuleIds gets a reference to the given []string and assigns it to the DisabledRuleIds field. +func (o *WafConfigPatch) SetDisabledRuleIds(v []string) { + o.DisabledRuleIds = v +} + +// GetEnabledRuleCollectionIds returns the EnabledRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetEnabledRuleCollectionIds() []string { + if o == nil || IsNil(o.EnabledRuleCollectionIds) { + var ret []string + return ret + } + return o.EnabledRuleCollectionIds +} + +// GetEnabledRuleCollectionIdsOk returns a tuple with the EnabledRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetEnabledRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleCollectionIds) { + return nil, false + } + return o.EnabledRuleCollectionIds, true +} + +// HasEnabledRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasEnabledRuleCollectionIds() bool { + if o != nil && !IsNil(o.EnabledRuleCollectionIds) { + return true + } + + return false +} + +// SetEnabledRuleCollectionIds gets a reference to the given []string and assigns it to the EnabledRuleCollectionIds field. +func (o *WafConfigPatch) SetEnabledRuleCollectionIds(v []string) { + o.EnabledRuleCollectionIds = v +} + +// GetEnabledRuleGroupIds returns the EnabledRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetEnabledRuleGroupIds() []string { + if o == nil || IsNil(o.EnabledRuleGroupIds) { + var ret []string + return ret + } + return o.EnabledRuleGroupIds +} + +// GetEnabledRuleGroupIdsOk returns a tuple with the EnabledRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetEnabledRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleGroupIds) { + return nil, false + } + return o.EnabledRuleGroupIds, true +} + +// HasEnabledRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasEnabledRuleGroupIds() bool { + if o != nil && !IsNil(o.EnabledRuleGroupIds) { + return true + } + + return false +} + +// SetEnabledRuleGroupIds gets a reference to the given []string and assigns it to the EnabledRuleGroupIds field. +func (o *WafConfigPatch) SetEnabledRuleGroupIds(v []string) { + o.EnabledRuleGroupIds = v +} + +// GetEnabledRuleIds returns the EnabledRuleIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetEnabledRuleIds() []string { + if o == nil || IsNil(o.EnabledRuleIds) { + var ret []string + return ret + } + return o.EnabledRuleIds +} + +// GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetEnabledRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.EnabledRuleIds) { + return nil, false + } + return o.EnabledRuleIds, true +} + +// HasEnabledRuleIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasEnabledRuleIds() bool { + if o != nil && !IsNil(o.EnabledRuleIds) { + return true + } + + return false +} + +// SetEnabledRuleIds gets a reference to the given []string and assigns it to the EnabledRuleIds field. +func (o *WafConfigPatch) SetEnabledRuleIds(v []string) { + o.EnabledRuleIds = v +} + +// GetLogOnlyRuleCollectionIds returns the LogOnlyRuleCollectionIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetLogOnlyRuleCollectionIds() []string { + if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { + var ret []string + return ret + } + return o.LogOnlyRuleCollectionIds +} + +// GetLogOnlyRuleCollectionIdsOk returns a tuple with the LogOnlyRuleCollectionIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetLogOnlyRuleCollectionIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleCollectionIds) { + return nil, false + } + return o.LogOnlyRuleCollectionIds, true +} + +// HasLogOnlyRuleCollectionIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasLogOnlyRuleCollectionIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleCollectionIds) { + return true + } + + return false +} + +// SetLogOnlyRuleCollectionIds gets a reference to the given []string and assigns it to the LogOnlyRuleCollectionIds field. +func (o *WafConfigPatch) SetLogOnlyRuleCollectionIds(v []string) { + o.LogOnlyRuleCollectionIds = v +} + +// GetLogOnlyRuleGroupIds returns the LogOnlyRuleGroupIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetLogOnlyRuleGroupIds() []string { + if o == nil || IsNil(o.LogOnlyRuleGroupIds) { + var ret []string + return ret + } + return o.LogOnlyRuleGroupIds +} + +// GetLogOnlyRuleGroupIdsOk returns a tuple with the LogOnlyRuleGroupIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetLogOnlyRuleGroupIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleGroupIds) { + return nil, false + } + return o.LogOnlyRuleGroupIds, true +} + +// HasLogOnlyRuleGroupIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasLogOnlyRuleGroupIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleGroupIds) { + return true + } + + return false +} + +// SetLogOnlyRuleGroupIds gets a reference to the given []string and assigns it to the LogOnlyRuleGroupIds field. +func (o *WafConfigPatch) SetLogOnlyRuleGroupIds(v []string) { + o.LogOnlyRuleGroupIds = v +} + +// GetLogOnlyRuleIds returns the LogOnlyRuleIds field value if set, zero value otherwise. +func (o *WafConfigPatch) GetLogOnlyRuleIds() []string { + if o == nil || IsNil(o.LogOnlyRuleIds) { + var ret []string + return ret + } + return o.LogOnlyRuleIds +} + +// GetLogOnlyRuleIdsOk returns a tuple with the LogOnlyRuleIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetLogOnlyRuleIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LogOnlyRuleIds) { + return nil, false + } + return o.LogOnlyRuleIds, true +} + +// HasLogOnlyRuleIds returns a boolean if a field has been set. +func (o *WafConfigPatch) HasLogOnlyRuleIds() bool { + if o != nil && !IsNil(o.LogOnlyRuleIds) { + return true + } + + return false +} + +// SetLogOnlyRuleIds gets a reference to the given []string and assigns it to the LogOnlyRuleIds field. +func (o *WafConfigPatch) SetLogOnlyRuleIds(v []string) { + o.LogOnlyRuleIds = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *WafConfigPatch) GetMode() WafMode { + if o == nil || IsNil(o.Mode) { + var ret WafMode + 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 *WafConfigPatch) GetModeOk() (*WafMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *WafConfigPatch) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given WafMode and assigns it to the Mode field. +func (o *WafConfigPatch) SetMode(v WafMode) { + o.Mode = &v +} + +// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. +func (o *WafConfigPatch) GetParanoiaLevel() WafParanoiaLevel { + if o == nil || IsNil(o.ParanoiaLevel) { + var ret WafParanoiaLevel + return ret + } + return *o.ParanoiaLevel +} + +// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { + if o == nil || IsNil(o.ParanoiaLevel) { + return nil, false + } + return o.ParanoiaLevel, true +} + +// HasParanoiaLevel returns a boolean if a field has been set. +func (o *WafConfigPatch) HasParanoiaLevel() bool { + if o != nil && !IsNil(o.ParanoiaLevel) { + return true + } + + return false +} + +// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. +func (o *WafConfigPatch) SetParanoiaLevel(v WafParanoiaLevel) { + o.ParanoiaLevel = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WafConfigPatch) GetType() WafType { + if o == nil || IsNil(o.Type) { + var ret WafType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetTypeOk() (*WafType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WafConfigPatch) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given WafType and assigns it to the Type field. +func (o *WafConfigPatch) SetType(v WafType) { + o.Type = &v +} + +func (o WafConfigPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafConfigPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedHttpMethods) { + toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods + } + if !IsNil(o.AllowedHttpVersions) { + toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions + } + if !IsNil(o.AllowedRequestContentTypes) { + toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes + } + if !IsNil(o.DisabledRuleCollectionIds) { + toSerialize["disabledRuleCollectionIds"] = o.DisabledRuleCollectionIds + } + if !IsNil(o.DisabledRuleGroupIds) { + toSerialize["disabledRuleGroupIds"] = o.DisabledRuleGroupIds + } + if !IsNil(o.DisabledRuleIds) { + toSerialize["disabledRuleIds"] = o.DisabledRuleIds + } + if !IsNil(o.EnabledRuleCollectionIds) { + toSerialize["enabledRuleCollectionIds"] = o.EnabledRuleCollectionIds + } + if !IsNil(o.EnabledRuleGroupIds) { + toSerialize["enabledRuleGroupIds"] = o.EnabledRuleGroupIds + } + if !IsNil(o.EnabledRuleIds) { + toSerialize["enabledRuleIds"] = o.EnabledRuleIds + } + if !IsNil(o.LogOnlyRuleCollectionIds) { + toSerialize["logOnlyRuleCollectionIds"] = o.LogOnlyRuleCollectionIds + } + if !IsNil(o.LogOnlyRuleGroupIds) { + toSerialize["logOnlyRuleGroupIds"] = o.LogOnlyRuleGroupIds + } + if !IsNil(o.LogOnlyRuleIds) { + toSerialize["logOnlyRuleIds"] = o.LogOnlyRuleIds + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.ParanoiaLevel) { + toSerialize["paranoiaLevel"] = o.ParanoiaLevel + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableWafConfigPatch struct { + value *WafConfigPatch + isSet bool +} + +func (v NullableWafConfigPatch) Get() *WafConfigPatch { + return v.value +} + +func (v *NullableWafConfigPatch) Set(val *WafConfigPatch) { + v.value = val + v.isSet = true +} + +func (v NullableWafConfigPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableWafConfigPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafConfigPatch(val *WafConfigPatch) *NullableWafConfigPatch { + return &NullableWafConfigPatch{value: val, isSet: true} +} + +func (v NullableWafConfigPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafConfigPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_mode.go b/services/cdn/v1beta2api/model_waf_mode.go new file mode 100644 index 000000000..47bad30e9 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_mode.go @@ -0,0 +1,112 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// WafMode - `ENABLED`: The WAF actively inspects and blocks malicious requests. - `DISABLED`: The WAF is completely off. No inspection occurs. - `LOG_ONLY`: The WAF inspects requests and logs matches but never blocks. +type WafMode string + +// List of WafMode +const ( + WAFMODE_DISABLED WafMode = "DISABLED" + WAFMODE_ENABLED WafMode = "ENABLED" + WAFMODE_LOG_ONLY WafMode = "LOG_ONLY" +) + +// All allowed values of WafMode enum +var AllowedWafModeEnumValues = []WafMode{ + "DISABLED", + "ENABLED", + "LOG_ONLY", +} + +func (v *WafMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafMode(value) + for _, existing := range AllowedWafModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafMode", value) +} + +// NewWafModeFromValue returns a pointer to a valid WafMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafModeFromValue(v string) (*WafMode, error) { + ev := WafMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafMode: valid values are %v", v, AllowedWafModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafMode) IsValid() bool { + for _, existing := range AllowedWafModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafMode value +func (v WafMode) Ptr() *WafMode { + return &v +} + +type NullableWafMode struct { + value *WafMode + isSet bool +} + +func (v NullableWafMode) Get() *WafMode { + return v.value +} + +func (v *NullableWafMode) Set(val *WafMode) { + v.value = val + v.isSet = true +} + +func (v NullableWafMode) IsSet() bool { + return v.isSet +} + +func (v *NullableWafMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafMode(val *WafMode) *NullableWafMode { + return &NullableWafMode{value: val, isSet: true} +} + +func (v NullableWafMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_paranoia_level.go b/services/cdn/v1beta2api/model_waf_paranoia_level.go new file mode 100644 index 000000000..cf45b9e6b --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_paranoia_level.go @@ -0,0 +1,114 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// WafParanoiaLevel The paranoia level defines how aggressively the WAF should action on requests. It ranges from `L1` (least strict, lowest chance of false positives) to `L4` (most strict, highest chance of false positives). A higher paranoia level is more effective at catching attacks but can also block legitimate traffic. +type WafParanoiaLevel string + +// List of WafParanoiaLevel +const ( + WAFPARANOIALEVEL_L1 WafParanoiaLevel = "L1" + WAFPARANOIALEVEL_L2 WafParanoiaLevel = "L2" + WAFPARANOIALEVEL_L3 WafParanoiaLevel = "L3" + WAFPARANOIALEVEL_L4 WafParanoiaLevel = "L4" +) + +// All allowed values of WafParanoiaLevel enum +var AllowedWafParanoiaLevelEnumValues = []WafParanoiaLevel{ + "L1", + "L2", + "L3", + "L4", +} + +func (v *WafParanoiaLevel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafParanoiaLevel(value) + for _, existing := range AllowedWafParanoiaLevelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafParanoiaLevel", value) +} + +// NewWafParanoiaLevelFromValue returns a pointer to a valid WafParanoiaLevel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafParanoiaLevelFromValue(v string) (*WafParanoiaLevel, error) { + ev := WafParanoiaLevel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafParanoiaLevel: valid values are %v", v, AllowedWafParanoiaLevelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafParanoiaLevel) IsValid() bool { + for _, existing := range AllowedWafParanoiaLevelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafParanoiaLevel value +func (v WafParanoiaLevel) Ptr() *WafParanoiaLevel { + return &v +} + +type NullableWafParanoiaLevel struct { + value *WafParanoiaLevel + isSet bool +} + +func (v NullableWafParanoiaLevel) Get() *WafParanoiaLevel { + return v.value +} + +func (v *NullableWafParanoiaLevel) Set(val *WafParanoiaLevel) { + v.value = val + v.isSet = true +} + +func (v NullableWafParanoiaLevel) IsSet() bool { + return v.isSet +} + +func (v *NullableWafParanoiaLevel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafParanoiaLevel(val *WafParanoiaLevel) *NullableWafParanoiaLevel { + return &NullableWafParanoiaLevel{value: val, isSet: true} +} + +func (v NullableWafParanoiaLevel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafParanoiaLevel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_rule.go b/services/cdn/v1beta2api/model_waf_rule.go new file mode 100644 index 000000000..cf4e48aed --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_rule.go @@ -0,0 +1,222 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafRule{} + +// WafRule struct for WafRule +type WafRule struct { + // Optional CoreRuleSet rule Id in case this is a CRS rule + Code *string `json:"code,omitempty"` + // LocalizedString is a map from language to string value + Description map[string]string `json:"description"` + Id string `json:"id"` +} + +type _WafRule WafRule + +// NewWafRule instantiates a new WafRule 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 NewWafRule(description map[string]string, id string) *WafRule { + this := WafRule{} + this.Description = description + this.Id = id + return &this +} + +// NewWafRuleWithDefaults instantiates a new WafRule 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 NewWafRuleWithDefaults() *WafRule { + this := WafRule{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *WafRule) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafRule) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *WafRule) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *WafRule) SetCode(v string) { + o.Code = &v +} + +// GetDescription returns the Description field value +func (o *WafRule) GetDescription() map[string]string { + if o == nil { + var ret map[string]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 *WafRule) GetDescriptionOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *WafRule) SetDescription(v map[string]string) { + o.Description = v +} + +// GetId returns the Id field value +func (o *WafRule) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WafRule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WafRule) SetId(v string) { + o.Id = v +} + +func (o WafRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + toSerialize["description"] = o.Description + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *WafRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafRule := _WafRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafRule) + + if err != nil { + return err + } + + *o = WafRule(varWafRule) + + return err +} + +type NullableWafRule struct { + value *WafRule + isSet bool +} + +func (v NullableWafRule) Get() *WafRule { + return v.value +} + +func (v *NullableWafRule) Set(val *WafRule) { + v.value = val + v.isSet = true +} + +func (v NullableWafRule) IsSet() bool { + return v.isSet +} + +func (v *NullableWafRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafRule(val *WafRule) *NullableWafRule { + return &NullableWafRule{value: val, isSet: true} +} + +func (v NullableWafRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_rule_action.go b/services/cdn/v1beta2api/model_waf_rule_action.go new file mode 100644 index 000000000..213d61ec2 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_rule_action.go @@ -0,0 +1,112 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// WAFRuleAction The action a WAF rule can take based on a request +type WAFRuleAction string + +// List of WAFRuleAction +const ( + WAFRULEACTION_BLOCKED WAFRuleAction = "BLOCKED" + WAFRULEACTION_LOGGED WAFRuleAction = "LOGGED" + WAFRULEACTION_ALLOWED WAFRuleAction = "ALLOWED" +) + +// All allowed values of WAFRuleAction enum +var AllowedWAFRuleActionEnumValues = []WAFRuleAction{ + "BLOCKED", + "LOGGED", + "ALLOWED", +} + +func (v *WAFRuleAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WAFRuleAction(value) + for _, existing := range AllowedWAFRuleActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WAFRuleAction", value) +} + +// NewWAFRuleActionFromValue returns a pointer to a valid WAFRuleAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWAFRuleActionFromValue(v string) (*WAFRuleAction, error) { + ev := WAFRuleAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WAFRuleAction: valid values are %v", v, AllowedWAFRuleActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WAFRuleAction) IsValid() bool { + for _, existing := range AllowedWAFRuleActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WAFRuleAction value +func (v WAFRuleAction) Ptr() *WAFRuleAction { + return &v +} + +type NullableWAFRuleAction struct { + value *WAFRuleAction + isSet bool +} + +func (v NullableWAFRuleAction) Get() *WAFRuleAction { + return v.value +} + +func (v *NullableWAFRuleAction) Set(val *WAFRuleAction) { + v.value = val + v.isSet = true +} + +func (v NullableWAFRuleAction) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFRuleAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFRuleAction(val *WAFRuleAction) *NullableWAFRuleAction { + return &NullableWAFRuleAction{value: val, isSet: true} +} + +func (v NullableWAFRuleAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFRuleAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_rule_collection.go b/services/cdn/v1beta2api/model_waf_rule_collection.go new file mode 100644 index 000000000..9dddec7ac --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_rule_collection.go @@ -0,0 +1,213 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafRuleCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafRuleCollection{} + +// WafRuleCollection struct for WafRuleCollection +type WafRuleCollection struct { + Groups []WafRuleGroup `json:"groups"` + Id string `json:"id"` + // LocalizedString is a map from language to string value + Name map[string]string `json:"name"` +} + +type _WafRuleCollection WafRuleCollection + +// NewWafRuleCollection instantiates a new WafRuleCollection 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 NewWafRuleCollection(groups []WafRuleGroup, id string, name map[string]string) *WafRuleCollection { + this := WafRuleCollection{} + this.Groups = groups + this.Id = id + this.Name = name + return &this +} + +// NewWafRuleCollectionWithDefaults instantiates a new WafRuleCollection 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 NewWafRuleCollectionWithDefaults() *WafRuleCollection { + this := WafRuleCollection{} + return &this +} + +// GetGroups returns the Groups field value +func (o *WafRuleCollection) GetGroups() []WafRuleGroup { + if o == nil { + var ret []WafRuleGroup + return ret + } + + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *WafRuleCollection) GetGroupsOk() ([]WafRuleGroup, bool) { + if o == nil { + return nil, false + } + return o.Groups, true +} + +// SetGroups sets field value +func (o *WafRuleCollection) SetGroups(v []WafRuleGroup) { + o.Groups = v +} + +// GetId returns the Id field value +func (o *WafRuleCollection) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WafRuleCollection) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WafRuleCollection) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *WafRuleCollection) GetName() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WafRuleCollection) GetNameOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WafRuleCollection) SetName(v map[string]string) { + o.Name = v +} + +func (o WafRuleCollection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafRuleCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["groups"] = o.Groups + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *WafRuleCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "groups", + "id", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafRuleCollection := _WafRuleCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafRuleCollection) + + if err != nil { + return err + } + + *o = WafRuleCollection(varWafRuleCollection) + + return err +} + +type NullableWafRuleCollection struct { + value *WafRuleCollection + isSet bool +} + +func (v NullableWafRuleCollection) Get() *WafRuleCollection { + return v.value +} + +func (v *NullableWafRuleCollection) Set(val *WafRuleCollection) { + v.value = val + v.isSet = true +} + +func (v NullableWafRuleCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableWafRuleCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafRuleCollection(val *WafRuleCollection) *NullableWafRuleCollection { + return &NullableWafRuleCollection{value: val, isSet: true} +} + +func (v NullableWafRuleCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafRuleCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_rule_group.go b/services/cdn/v1beta2api/model_waf_rule_group.go new file mode 100644 index 000000000..d11fb6b1b --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_rule_group.go @@ -0,0 +1,214 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafRuleGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafRuleGroup{} + +// WafRuleGroup struct for WafRuleGroup +type WafRuleGroup struct { + // LocalizedString is a map from language to string value + Description map[string]string `json:"description"` + // LocalizedString is a map from language to string value + Name map[string]string `json:"name"` + Rules []WafRule `json:"rules"` +} + +type _WafRuleGroup WafRuleGroup + +// NewWafRuleGroup instantiates a new WafRuleGroup 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 NewWafRuleGroup(description map[string]string, name map[string]string, rules []WafRule) *WafRuleGroup { + this := WafRuleGroup{} + this.Description = description + this.Name = name + this.Rules = rules + return &this +} + +// NewWafRuleGroupWithDefaults instantiates a new WafRuleGroup 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 NewWafRuleGroupWithDefaults() *WafRuleGroup { + this := WafRuleGroup{} + return &this +} + +// GetDescription returns the Description field value +func (o *WafRuleGroup) GetDescription() map[string]string { + if o == nil { + var ret map[string]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 *WafRuleGroup) GetDescriptionOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *WafRuleGroup) SetDescription(v map[string]string) { + o.Description = v +} + +// GetName returns the Name field value +func (o *WafRuleGroup) GetName() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WafRuleGroup) GetNameOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WafRuleGroup) SetName(v map[string]string) { + o.Name = v +} + +// GetRules returns the Rules field value +func (o *WafRuleGroup) GetRules() []WafRule { + if o == nil { + var ret []WafRule + return ret + } + + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value +// and a boolean to check if the value has been set. +func (o *WafRuleGroup) GetRulesOk() ([]WafRule, bool) { + if o == nil { + return nil, false + } + return o.Rules, true +} + +// SetRules sets field value +func (o *WafRuleGroup) SetRules(v []WafRule) { + o.Rules = v +} + +func (o WafRuleGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafRuleGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["name"] = o.Name + toSerialize["rules"] = o.Rules + return toSerialize, nil +} + +func (o *WafRuleGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "name", + "rules", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafRuleGroup := _WafRuleGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafRuleGroup) + + if err != nil { + return err + } + + *o = WafRuleGroup(varWafRuleGroup) + + return err +} + +type NullableWafRuleGroup struct { + value *WafRuleGroup + isSet bool +} + +func (v NullableWafRuleGroup) Get() *WafRuleGroup { + return v.value +} + +func (v *NullableWafRuleGroup) Set(val *WafRuleGroup) { + v.value = val + v.isSet = true +} + +func (v NullableWafRuleGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableWafRuleGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafRuleGroup(val *WafRuleGroup) *NullableWafRuleGroup { + return &NullableWafRuleGroup{value: val, isSet: true} +} + +func (v NullableWafRuleGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafRuleGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block.go b/services/cdn/v1beta2api/model_waf_status_rule_block.go new file mode 100644 index 000000000..d442f7ab3 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_status_rule_block.go @@ -0,0 +1,185 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlock type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlock{} + +// WafStatusRuleBlock struct for WafStatusRuleBlock +type WafStatusRuleBlock struct { + // Specifies the Id of the Rule. + Id string `json:"id"` + Reason WafStatusRuleBlockReason `json:"reason"` +} + +type _WafStatusRuleBlock WafStatusRuleBlock + +// NewWafStatusRuleBlock instantiates a new WafStatusRuleBlock 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 NewWafStatusRuleBlock(id string, reason WafStatusRuleBlockReason) *WafStatusRuleBlock { + this := WafStatusRuleBlock{} + this.Id = id + this.Reason = reason + return &this +} + +// NewWafStatusRuleBlockWithDefaults instantiates a new WafStatusRuleBlock 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 NewWafStatusRuleBlockWithDefaults() *WafStatusRuleBlock { + this := WafStatusRuleBlock{} + return &this +} + +// GetId returns the Id field value +func (o *WafStatusRuleBlock) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlock) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WafStatusRuleBlock) SetId(v string) { + o.Id = v +} + +// GetReason returns the Reason field value +func (o *WafStatusRuleBlock) GetReason() WafStatusRuleBlockReason { + if o == nil { + var ret WafStatusRuleBlockReason + return ret + } + + return o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlock) GetReasonOk() (*WafStatusRuleBlockReason, bool) { + if o == nil { + return nil, false + } + return &o.Reason, true +} + +// SetReason sets field value +func (o *WafStatusRuleBlock) SetReason(v WafStatusRuleBlockReason) { + o.Reason = v +} + +func (o WafStatusRuleBlock) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlock) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["reason"] = o.Reason + return toSerialize, nil +} + +func (o *WafStatusRuleBlock) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "reason", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlock := _WafStatusRuleBlock{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlock) + + if err != nil { + return err + } + + *o = WafStatusRuleBlock(varWafStatusRuleBlock) + + return err +} + +type NullableWafStatusRuleBlock struct { + value *WafStatusRuleBlock + isSet bool +} + +func (v NullableWafStatusRuleBlock) Get() *WafStatusRuleBlock { + return v.value +} + +func (v *NullableWafStatusRuleBlock) Set(val *WafStatusRuleBlock) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlock) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlock) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlock(val *WafStatusRuleBlock) *NullableWafStatusRuleBlock { + return &NullableWafStatusRuleBlock{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlock) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlock) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason.go new file mode 100644 index 000000000..d5f94d4bd --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_status_rule_block_reason.go @@ -0,0 +1,249 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// WafStatusRuleBlockReason - Defines the Reason why a Rule is in the specified state (set to be enabled, disabled or logOnly). +type WafStatusRuleBlockReason struct { + WafStatusRuleBlockReasonDirectlyDefined *WafStatusRuleBlockReasonDirectlyDefined + WafStatusRuleBlockReasonInheritedFromCollection *WafStatusRuleBlockReasonInheritedFromCollection + WafStatusRuleBlockReasonInheritedFromGroup *WafStatusRuleBlockReasonInheritedFromGroup + WafStatusRuleBlockReasonInvalidWafType *WafStatusRuleBlockReasonInvalidWafType + WafStatusRuleBlockReasonNeverDefined *WafStatusRuleBlockReasonNeverDefined +} + +// WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonDirectlyDefined wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonDirectlyDefinedAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonDirectlyDefined) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonDirectlyDefined: v, + } +} + +// WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInheritedFromCollection wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonInheritedFromCollectionAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInheritedFromCollection) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonInheritedFromCollection: v, + } +} + +// WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInheritedFromGroup wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonInheritedFromGroupAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInheritedFromGroup) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonInheritedFromGroup: v, + } +} + +// WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonInvalidWafType wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonInvalidWafTypeAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonInvalidWafType) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonInvalidWafType: v, + } +} + +// WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason is a convenience function that returns WafStatusRuleBlockReasonNeverDefined wrapped in WafStatusRuleBlockReason +func WafStatusRuleBlockReasonNeverDefinedAsWafStatusRuleBlockReason(v *WafStatusRuleBlockReasonNeverDefined) WafStatusRuleBlockReason { + return WafStatusRuleBlockReason{ + WafStatusRuleBlockReasonNeverDefined: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *WafStatusRuleBlockReason) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'directlyDefined' + if jsonDict["type"] == "directlyDefined" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonDirectlyDefined + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonDirectlyDefined) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonDirectlyDefined, return on the first match + } else { + dst.WafStatusRuleBlockReasonDirectlyDefined = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonDirectlyDefined: %s", err.Error()) + } + } + + // check if the discriminator value is 'inheritedFromCollection' + if jsonDict["type"] == "inheritedFromCollection" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonInheritedFromCollection + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInheritedFromCollection) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonInheritedFromCollection, return on the first match + } else { + dst.WafStatusRuleBlockReasonInheritedFromCollection = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInheritedFromCollection: %s", err.Error()) + } + } + + // check if the discriminator value is 'inheritedFromGroup' + if jsonDict["type"] == "inheritedFromGroup" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonInheritedFromGroup + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInheritedFromGroup) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonInheritedFromGroup, return on the first match + } else { + dst.WafStatusRuleBlockReasonInheritedFromGroup = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInheritedFromGroup: %s", err.Error()) + } + } + + // check if the discriminator value is 'invalidWafType' + if jsonDict["type"] == "invalidWafType" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonInvalidWafType + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonInvalidWafType) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonInvalidWafType, return on the first match + } else { + dst.WafStatusRuleBlockReasonInvalidWafType = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonInvalidWafType: %s", err.Error()) + } + } + + // check if the discriminator value is 'neverDefined' + if jsonDict["type"] == "neverDefined" { + // try to unmarshal JSON data into WafStatusRuleBlockReasonNeverDefined + err = json.Unmarshal(data, &dst.WafStatusRuleBlockReasonNeverDefined) + if err == nil { + return nil // data stored in dst.WafStatusRuleBlockReasonNeverDefined, return on the first match + } else { + dst.WafStatusRuleBlockReasonNeverDefined = nil + return fmt.Errorf("failed to unmarshal WafStatusRuleBlockReason as WafStatusRuleBlockReasonNeverDefined: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src WafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { + if src.WafStatusRuleBlockReasonDirectlyDefined != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonDirectlyDefined) + } + + if src.WafStatusRuleBlockReasonInheritedFromCollection != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonInheritedFromCollection) + } + + if src.WafStatusRuleBlockReasonInheritedFromGroup != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonInheritedFromGroup) + } + + if src.WafStatusRuleBlockReasonInvalidWafType != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonInvalidWafType) + } + + if src.WafStatusRuleBlockReasonNeverDefined != nil { + return json.Marshal(&src.WafStatusRuleBlockReasonNeverDefined) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *WafStatusRuleBlockReason) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.WafStatusRuleBlockReasonDirectlyDefined != nil { + return obj.WafStatusRuleBlockReasonDirectlyDefined + } + + if obj.WafStatusRuleBlockReasonInheritedFromCollection != nil { + return obj.WafStatusRuleBlockReasonInheritedFromCollection + } + + if obj.WafStatusRuleBlockReasonInheritedFromGroup != nil { + return obj.WafStatusRuleBlockReasonInheritedFromGroup + } + + if obj.WafStatusRuleBlockReasonInvalidWafType != nil { + return obj.WafStatusRuleBlockReasonInvalidWafType + } + + if obj.WafStatusRuleBlockReasonNeverDefined != nil { + return obj.WafStatusRuleBlockReasonNeverDefined + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj WafStatusRuleBlockReason) GetActualInstanceValue() interface{} { + if obj.WafStatusRuleBlockReasonDirectlyDefined != nil { + return *obj.WafStatusRuleBlockReasonDirectlyDefined + } + + if obj.WafStatusRuleBlockReasonInheritedFromCollection != nil { + return *obj.WafStatusRuleBlockReasonInheritedFromCollection + } + + if obj.WafStatusRuleBlockReasonInheritedFromGroup != nil { + return *obj.WafStatusRuleBlockReasonInheritedFromGroup + } + + if obj.WafStatusRuleBlockReasonInvalidWafType != nil { + return *obj.WafStatusRuleBlockReasonInvalidWafType + } + + if obj.WafStatusRuleBlockReasonNeverDefined != nil { + return *obj.WafStatusRuleBlockReasonNeverDefined + } + + // all schemas are nil + return nil +} + +type NullableWafStatusRuleBlockReason struct { + value *WafStatusRuleBlockReason + isSet bool +} + +func (v NullableWafStatusRuleBlockReason) Get() *WafStatusRuleBlockReason { + return v.value +} + +func (v *NullableWafStatusRuleBlockReason) Set(val *WafStatusRuleBlockReason) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReason) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReason) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReason(val *WafStatusRuleBlockReason) *NullableWafStatusRuleBlockReason { + return &NullableWafStatusRuleBlockReason{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReason) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReason) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_directly_defined.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_directly_defined.go new file mode 100644 index 000000000..f39fd178a --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_directly_defined.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonDirectlyDefined type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonDirectlyDefined{} + +// WafStatusRuleBlockReasonDirectlyDefined struct for WafStatusRuleBlockReasonDirectlyDefined +type WafStatusRuleBlockReasonDirectlyDefined struct { + // This is always `directlyDefined` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonDirectlyDefined WafStatusRuleBlockReasonDirectlyDefined + +// NewWafStatusRuleBlockReasonDirectlyDefined instantiates a new WafStatusRuleBlockReasonDirectlyDefined 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 NewWafStatusRuleBlockReasonDirectlyDefined(types string) *WafStatusRuleBlockReasonDirectlyDefined { + this := WafStatusRuleBlockReasonDirectlyDefined{} + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonDirectlyDefinedWithDefaults instantiates a new WafStatusRuleBlockReasonDirectlyDefined 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 NewWafStatusRuleBlockReasonDirectlyDefinedWithDefaults() *WafStatusRuleBlockReasonDirectlyDefined { + this := WafStatusRuleBlockReasonDirectlyDefined{} + return &this +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonDirectlyDefined) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonDirectlyDefined) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonDirectlyDefined) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonDirectlyDefined) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonDirectlyDefined) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonDirectlyDefined) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonDirectlyDefined := _WafStatusRuleBlockReasonDirectlyDefined{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonDirectlyDefined) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonDirectlyDefined(varWafStatusRuleBlockReasonDirectlyDefined) + + return err +} + +type NullableWafStatusRuleBlockReasonDirectlyDefined struct { + value *WafStatusRuleBlockReasonDirectlyDefined + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonDirectlyDefined) Get() *WafStatusRuleBlockReasonDirectlyDefined { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) Set(val *WafStatusRuleBlockReasonDirectlyDefined) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonDirectlyDefined) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonDirectlyDefined(val *WafStatusRuleBlockReasonDirectlyDefined) *NullableWafStatusRuleBlockReasonDirectlyDefined { + return &NullableWafStatusRuleBlockReasonDirectlyDefined{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonDirectlyDefined) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonDirectlyDefined) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_collection.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_collection.go new file mode 100644 index 000000000..584662454 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_collection.go @@ -0,0 +1,186 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonInheritedFromCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonInheritedFromCollection{} + +// WafStatusRuleBlockReasonInheritedFromCollection struct for WafStatusRuleBlockReasonInheritedFromCollection +type WafStatusRuleBlockReasonInheritedFromCollection struct { + // The Collection that caused this rule to be in its current state. + CollectionId string `json:"collectionId"` + // This is always `inheritedFromCollection` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonInheritedFromCollection WafStatusRuleBlockReasonInheritedFromCollection + +// NewWafStatusRuleBlockReasonInheritedFromCollection instantiates a new WafStatusRuleBlockReasonInheritedFromCollection 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 NewWafStatusRuleBlockReasonInheritedFromCollection(collectionId string, types string) *WafStatusRuleBlockReasonInheritedFromCollection { + this := WafStatusRuleBlockReasonInheritedFromCollection{} + this.CollectionId = collectionId + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonInheritedFromCollectionWithDefaults instantiates a new WafStatusRuleBlockReasonInheritedFromCollection 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 NewWafStatusRuleBlockReasonInheritedFromCollectionWithDefaults() *WafStatusRuleBlockReasonInheritedFromCollection { + this := WafStatusRuleBlockReasonInheritedFromCollection{} + return &this +} + +// GetCollectionId returns the CollectionId field value +func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionId() string { + if o == nil { + var ret string + return ret + } + + return o.CollectionId +} + +// GetCollectionIdOk returns a tuple with the CollectionId field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetCollectionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CollectionId, true +} + +// SetCollectionId sets field value +func (o *WafStatusRuleBlockReasonInheritedFromCollection) SetCollectionId(v string) { + o.CollectionId = v +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInheritedFromCollection) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonInheritedFromCollection) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonInheritedFromCollection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonInheritedFromCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["collectionId"] = o.CollectionId + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonInheritedFromCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "collectionId", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonInheritedFromCollection := _WafStatusRuleBlockReasonInheritedFromCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonInheritedFromCollection) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonInheritedFromCollection(varWafStatusRuleBlockReasonInheritedFromCollection) + + return err +} + +type NullableWafStatusRuleBlockReasonInheritedFromCollection struct { + value *WafStatusRuleBlockReasonInheritedFromCollection + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) Get() *WafStatusRuleBlockReasonInheritedFromCollection { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) Set(val *WafStatusRuleBlockReasonInheritedFromCollection) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonInheritedFromCollection(val *WafStatusRuleBlockReasonInheritedFromCollection) *NullableWafStatusRuleBlockReasonInheritedFromCollection { + return &NullableWafStatusRuleBlockReasonInheritedFromCollection{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_group.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_group.go new file mode 100644 index 000000000..220f69666 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_inherited_from_group.go @@ -0,0 +1,186 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonInheritedFromGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonInheritedFromGroup{} + +// WafStatusRuleBlockReasonInheritedFromGroup struct for WafStatusRuleBlockReasonInheritedFromGroup +type WafStatusRuleBlockReasonInheritedFromGroup struct { + // The Group that caused this rule to be in its current state. + GroupId string `json:"groupId"` + // This is always `inheritedFromGroup` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonInheritedFromGroup WafStatusRuleBlockReasonInheritedFromGroup + +// NewWafStatusRuleBlockReasonInheritedFromGroup instantiates a new WafStatusRuleBlockReasonInheritedFromGroup 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 NewWafStatusRuleBlockReasonInheritedFromGroup(groupId string, types string) *WafStatusRuleBlockReasonInheritedFromGroup { + this := WafStatusRuleBlockReasonInheritedFromGroup{} + this.GroupId = groupId + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonInheritedFromGroupWithDefaults instantiates a new WafStatusRuleBlockReasonInheritedFromGroup 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 NewWafStatusRuleBlockReasonInheritedFromGroupWithDefaults() *WafStatusRuleBlockReasonInheritedFromGroup { + this := WafStatusRuleBlockReasonInheritedFromGroup{} + return &this +} + +// GetGroupId returns the GroupId field value +func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupId() string { + if o == nil { + var ret string + return ret + } + + return o.GroupId +} + +// GetGroupIdOk returns a tuple with the GroupId field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetGroupIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GroupId, true +} + +// SetGroupId sets field value +func (o *WafStatusRuleBlockReasonInheritedFromGroup) SetGroupId(v string) { + o.GroupId = v +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInheritedFromGroup) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonInheritedFromGroup) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonInheritedFromGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonInheritedFromGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["groupId"] = o.GroupId + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonInheritedFromGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "groupId", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonInheritedFromGroup := _WafStatusRuleBlockReasonInheritedFromGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonInheritedFromGroup) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonInheritedFromGroup(varWafStatusRuleBlockReasonInheritedFromGroup) + + return err +} + +type NullableWafStatusRuleBlockReasonInheritedFromGroup struct { + value *WafStatusRuleBlockReasonInheritedFromGroup + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) Get() *WafStatusRuleBlockReasonInheritedFromGroup { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) Set(val *WafStatusRuleBlockReasonInheritedFromGroup) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonInheritedFromGroup(val *WafStatusRuleBlockReasonInheritedFromGroup) *NullableWafStatusRuleBlockReasonInheritedFromGroup { + return &NullableWafStatusRuleBlockReasonInheritedFromGroup{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonInheritedFromGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonInheritedFromGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_invalid_waf_type.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_invalid_waf_type.go new file mode 100644 index 000000000..7d651a411 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_invalid_waf_type.go @@ -0,0 +1,186 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonInvalidWafType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonInvalidWafType{} + +// WafStatusRuleBlockReasonInvalidWafType struct for WafStatusRuleBlockReasonInvalidWafType +type WafStatusRuleBlockReasonInvalidWafType struct { + // A list containing all WAF Types which can use this Rule. You must patch you WAF to one of these WAF Types to make use of this rule. Rules show up with this state if they would have been enabled or logOnly otherwise. + AllowedWafTypes []WafType `json:"allowedWafTypes"` + // This is always `invalidWafType` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonInvalidWafType WafStatusRuleBlockReasonInvalidWafType + +// NewWafStatusRuleBlockReasonInvalidWafType instantiates a new WafStatusRuleBlockReasonInvalidWafType 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 NewWafStatusRuleBlockReasonInvalidWafType(allowedWafTypes []WafType, types string) *WafStatusRuleBlockReasonInvalidWafType { + this := WafStatusRuleBlockReasonInvalidWafType{} + this.AllowedWafTypes = allowedWafTypes + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonInvalidWafTypeWithDefaults instantiates a new WafStatusRuleBlockReasonInvalidWafType 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 NewWafStatusRuleBlockReasonInvalidWafTypeWithDefaults() *WafStatusRuleBlockReasonInvalidWafType { + this := WafStatusRuleBlockReasonInvalidWafType{} + return &this +} + +// GetAllowedWafTypes returns the AllowedWafTypes field value +func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypes() []WafType { + if o == nil { + var ret []WafType + return ret + } + + return o.AllowedWafTypes +} + +// GetAllowedWafTypesOk returns a tuple with the AllowedWafTypes field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInvalidWafType) GetAllowedWafTypesOk() ([]WafType, bool) { + if o == nil { + return nil, false + } + return o.AllowedWafTypes, true +} + +// SetAllowedWafTypes sets field value +func (o *WafStatusRuleBlockReasonInvalidWafType) SetAllowedWafTypes(v []WafType) { + o.AllowedWafTypes = v +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonInvalidWafType) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonInvalidWafType) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonInvalidWafType) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonInvalidWafType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonInvalidWafType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["allowedWafTypes"] = o.AllowedWafTypes + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonInvalidWafType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "allowedWafTypes", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonInvalidWafType := _WafStatusRuleBlockReasonInvalidWafType{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonInvalidWafType) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonInvalidWafType(varWafStatusRuleBlockReasonInvalidWafType) + + return err +} + +type NullableWafStatusRuleBlockReasonInvalidWafType struct { + value *WafStatusRuleBlockReasonInvalidWafType + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonInvalidWafType) Get() *WafStatusRuleBlockReasonInvalidWafType { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonInvalidWafType) Set(val *WafStatusRuleBlockReasonInvalidWafType) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonInvalidWafType) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonInvalidWafType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonInvalidWafType(val *WafStatusRuleBlockReasonInvalidWafType) *NullableWafStatusRuleBlockReasonInvalidWafType { + return &NullableWafStatusRuleBlockReasonInvalidWafType{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonInvalidWafType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonInvalidWafType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_status_rule_block_reason_never_defined.go b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_never_defined.go new file mode 100644 index 000000000..805d7c5a0 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_status_rule_block_reason_never_defined.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafStatusRuleBlockReasonNeverDefined type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafStatusRuleBlockReasonNeverDefined{} + +// WafStatusRuleBlockReasonNeverDefined This object only ever shows up in the disabled rules section. If rules are never defined (e.g. no collection, rule group, or the rule itself is ever mentioned), they are implicitly disabled +type WafStatusRuleBlockReasonNeverDefined struct { + // This is always `neverDefined` + Type string `json:"type"` +} + +type _WafStatusRuleBlockReasonNeverDefined WafStatusRuleBlockReasonNeverDefined + +// NewWafStatusRuleBlockReasonNeverDefined instantiates a new WafStatusRuleBlockReasonNeverDefined 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 NewWafStatusRuleBlockReasonNeverDefined(types string) *WafStatusRuleBlockReasonNeverDefined { + this := WafStatusRuleBlockReasonNeverDefined{} + this.Type = types + return &this +} + +// NewWafStatusRuleBlockReasonNeverDefinedWithDefaults instantiates a new WafStatusRuleBlockReasonNeverDefined 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 NewWafStatusRuleBlockReasonNeverDefinedWithDefaults() *WafStatusRuleBlockReasonNeverDefined { + this := WafStatusRuleBlockReasonNeverDefined{} + return &this +} + +// GetType returns the Type field value +func (o *WafStatusRuleBlockReasonNeverDefined) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafStatusRuleBlockReasonNeverDefined) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafStatusRuleBlockReasonNeverDefined) SetType(v string) { + o.Type = v +} + +func (o WafStatusRuleBlockReasonNeverDefined) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafStatusRuleBlockReasonNeverDefined) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafStatusRuleBlockReasonNeverDefined) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafStatusRuleBlockReasonNeverDefined := _WafStatusRuleBlockReasonNeverDefined{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafStatusRuleBlockReasonNeverDefined) + + if err != nil { + return err + } + + *o = WafStatusRuleBlockReasonNeverDefined(varWafStatusRuleBlockReasonNeverDefined) + + return err +} + +type NullableWafStatusRuleBlockReasonNeverDefined struct { + value *WafStatusRuleBlockReasonNeverDefined + isSet bool +} + +func (v NullableWafStatusRuleBlockReasonNeverDefined) Get() *WafStatusRuleBlockReasonNeverDefined { + return v.value +} + +func (v *NullableWafStatusRuleBlockReasonNeverDefined) Set(val *WafStatusRuleBlockReasonNeverDefined) { + v.value = val + v.isSet = true +} + +func (v NullableWafStatusRuleBlockReasonNeverDefined) IsSet() bool { + return v.isSet +} + +func (v *NullableWafStatusRuleBlockReasonNeverDefined) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafStatusRuleBlockReasonNeverDefined(val *WafStatusRuleBlockReasonNeverDefined) *NullableWafStatusRuleBlockReasonNeverDefined { + return &NullableWafStatusRuleBlockReasonNeverDefined{value: val, isSet: true} +} + +func (v NullableWafStatusRuleBlockReasonNeverDefined) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafStatusRuleBlockReasonNeverDefined) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_type.go b/services/cdn/v1beta2api/model_waf_type.go new file mode 100644 index 000000000..8e614292c --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_type.go @@ -0,0 +1,110 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "encoding/json" + "fmt" +) + +// WafType Enable or disable the Premium WAF. Do note that enabling the Premium WAF will cause additional fees. Some features are gated behind the Premium WAF, like additional, **premium-only rules** and the ability to create **custom rules** (not yet implemented) +type WafType string + +// List of WafType +const ( + WAFTYPE_FREE WafType = "FREE" + WAFTYPE_PREMIUM WafType = "PREMIUM" +) + +// All allowed values of WafType enum +var AllowedWafTypeEnumValues = []WafType{ + "FREE", + "PREMIUM", +} + +func (v *WafType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafType(value) + for _, existing := range AllowedWafTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafType", value) +} + +// NewWafTypeFromValue returns a pointer to a valid WafType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafTypeFromValue(v string) (*WafType, error) { + ev := WafType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafType: valid values are %v", v, AllowedWafTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafType) IsValid() bool { + for _, existing := range AllowedWafTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafType value +func (v WafType) Ptr() *WafType { + return &v +} + +type NullableWafType struct { + value *WafType + isSet bool +} + +func (v NullableWafType) Get() *WafType { + return v.value +} + +func (v *NullableWafType) Set(val *WafType) { + v.value = val + v.isSet = true +} + +func (v NullableWafType) IsSet() bool { + return v.isSet +} + +func (v *NullableWafType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafType(val *WafType) *NullableWafType { + return &NullableWafType{value: val, isSet: true} +} + +func (v NullableWafType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/model_waf_violation.go b/services/cdn/v1beta2api/model_waf_violation.go new file mode 100644 index 000000000..4b944e8b9 --- /dev/null +++ b/services/cdn/v1beta2api/model_waf_violation.go @@ -0,0 +1,300 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WAFViolation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFViolation{} + +// WAFViolation Information about a violated WAF rule in case the WAF is enabled and a rule was triggered (either in BLOCK or LOG_ONLY mode) +type WAFViolation struct { + Action WAFRuleAction `json:"action"` + // ASN for the request + Asn string `json:"asn"` + // Rule specific message explaining the violation + Message string `json:"message"` + // HTTP Method of the request that triggered the violation + Method string `json:"method"` + RequestHeaders map[string]string `json:"requestHeaders"` + // ID of the WAF rule that was triggered + RuleId string `json:"ruleId"` +} + +type _WAFViolation WAFViolation + +// NewWAFViolation instantiates a new WAFViolation 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 NewWAFViolation(action WAFRuleAction, asn string, message string, method string, requestHeaders map[string]string, ruleId string) *WAFViolation { + this := WAFViolation{} + this.Action = action + this.Asn = asn + this.Message = message + this.Method = method + this.RequestHeaders = requestHeaders + this.RuleId = ruleId + return &this +} + +// NewWAFViolationWithDefaults instantiates a new WAFViolation 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 NewWAFViolationWithDefaults() *WAFViolation { + this := WAFViolation{} + return &this +} + +// GetAction returns the Action field value +func (o *WAFViolation) GetAction() WAFRuleAction { + if o == nil { + var ret WAFRuleAction + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetActionOk() (*WAFRuleAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *WAFViolation) SetAction(v WAFRuleAction) { + o.Action = v +} + +// GetAsn returns the Asn field value +func (o *WAFViolation) GetAsn() string { + if o == nil { + var ret string + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetAsnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *WAFViolation) SetAsn(v string) { + o.Asn = v +} + +// GetMessage returns the Message field value +func (o *WAFViolation) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *WAFViolation) SetMessage(v string) { + o.Message = v +} + +// GetMethod returns the Method field value +func (o *WAFViolation) GetMethod() string { + if o == nil { + var ret string + return ret + } + + return o.Method +} + +// GetMethodOk returns a tuple with the Method field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Method, true +} + +// SetMethod sets field value +func (o *WAFViolation) SetMethod(v string) { + o.Method = v +} + +// GetRequestHeaders returns the RequestHeaders field value +func (o *WAFViolation) GetRequestHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.RequestHeaders +} + +// GetRequestHeadersOk returns a tuple with the RequestHeaders field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetRequestHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.RequestHeaders, true +} + +// SetRequestHeaders sets field value +func (o *WAFViolation) SetRequestHeaders(v map[string]string) { + o.RequestHeaders = v +} + +// GetRuleId returns the RuleId field value +func (o *WAFViolation) GetRuleId() string { + if o == nil { + var ret string + return ret + } + + return o.RuleId +} + +// GetRuleIdOk returns a tuple with the RuleId field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetRuleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RuleId, true +} + +// SetRuleId sets field value +func (o *WAFViolation) SetRuleId(v string) { + o.RuleId = v +} + +func (o WAFViolation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFViolation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["action"] = o.Action + toSerialize["asn"] = o.Asn + toSerialize["message"] = o.Message + toSerialize["method"] = o.Method + toSerialize["requestHeaders"] = o.RequestHeaders + toSerialize["ruleId"] = o.RuleId + return toSerialize, nil +} + +func (o *WAFViolation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "action", + "asn", + "message", + "method", + "requestHeaders", + "ruleId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWAFViolation := _WAFViolation{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWAFViolation) + + if err != nil { + return err + } + + *o = WAFViolation(varWAFViolation) + + return err +} + +type NullableWAFViolation struct { + value *WAFViolation + isSet bool +} + +func (v NullableWAFViolation) Get() *WAFViolation { + return v.value +} + +func (v *NullableWAFViolation) Set(val *WAFViolation) { + v.value = val + v.isSet = true +} + +func (v NullableWAFViolation) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFViolation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFViolation(val *WAFViolation) *NullableWAFViolation { + return &NullableWAFViolation{value: val, isSet: true} +} + +func (v NullableWAFViolation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFViolation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1beta2api/response.go b/services/cdn/v1beta2api/response.go new file mode 100644 index 000000000..97856b209 --- /dev/null +++ b/services/cdn/v1beta2api/response.go @@ -0,0 +1,47 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/cdn/v1beta2api/utils.go b/services/cdn/v1beta2api/utils.go new file mode 100644 index 000000000..4f9a78b1e --- /dev/null +++ b/services/cdn/v1beta2api/utils.go @@ -0,0 +1,361 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta2.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1beta2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/cdn/v1betaapi/api_default.go b/services/cdn/v1betaapi/api_default.go new file mode 100644 index 000000000..2e683a683 --- /dev/null +++ b/services/cdn/v1betaapi/api_default.go @@ -0,0 +1,3151 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateDistribution Create new distribution + + CreateDistribution will create a new CDN distribution + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @return ApiCreateDistributionRequest + */ + CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest + + // CreateDistributionExecute executes the request + // @return CreateDistributionResponse + CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) + + /* + DeleteCustomDomain Delete a custom domain + + Removes a custom domain + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @param domain + @return ApiDeleteCustomDomainRequest + */ + DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest + + // DeleteCustomDomainExecute executes the request + // @return DeleteCustomDomainResponse + DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) + + /* + DeleteDistribution Delete distribution + + DeleteDistribution accepts a project- and distribution-ID and will delete a distribution. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiDeleteDistributionRequest + */ + DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest + + // DeleteDistributionExecute executes the request + // @return DeleteDistributionResponse + DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) + + /* + FindCachePaths Return Paths that were purged + + This returns paths that are present in the cache purging history. + Only substrings of the provided input are returned. + The response is sorted in descending order by the most recent purge. + + So, assuming you have have the following purged for a distribution + - `/test/1` at `2025-01-01` + - `/test/2` at `2025-01-02` + - `/someOtherPath/1` at `2025-01-03` + - `/test/1` at `2025-01-04` + - `/test/3` at `2025-01-05`, + this would return the following paths, in the following order, assuming `/te` was the search parameter: + - `/test/3` + - `/test/1` + - `/test/2` + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiFindCachePathsRequest + */ + FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest + + // FindCachePathsExecute executes the request + // @return FindCachePathsResponse + FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) + + /* + GetCacheInfo Get Infos about the Caching State + + Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. + + If (and only if) you provide the path query parameter, the history will also contain granular cache purges. + The request will not fail if no data about a path is found. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiGetCacheInfoRequest + */ + GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest + + // GetCacheInfoExecute executes the request + // @return GetCacheInfoResponse + GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) + + /* + GetCustomDomain Retrieve a specific custom domain + + Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @param domain + @return ApiGetCustomDomainRequest + */ + GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest + + // GetCustomDomainExecute executes the request + // @return GetCustomDomainResponse + GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) + + /* + GetDistribution Get distribution by ID + + This returns a specific distribution by its ID. If no distribution with the given ID exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiGetDistributionRequest + */ + GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest + + // GetDistributionExecute executes the request + // @return GetDistributionResponse + GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) + + /* + GetLogs Retrieve distribution logs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId Your CDN distribution ID + @return ApiGetLogsRequest + */ + GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest + + // GetLogsExecute executes the request + // @return GetLogsResponse + GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) + + /* + GetLogsSearchFilters Get relevant search filters for this distribution based on user input + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId Your CDN distribution ID + @return ApiGetLogsSearchFiltersRequest + */ + GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest + + // GetLogsSearchFiltersExecute executes the request + // @return GetLogsSearchFiltersResponse + GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) + + /* + GetStatistics Retrieve the statistics of a distribution + + Returns the statistics of the distribution in the given + time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. + In case no statistics for a time interval exist, no record is returned. + The time range for which statistics should be returned can be configured using query parameters. + + Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. + + **Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. + + The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. + Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiGetStatisticsRequest + */ + GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest + + // GetStatisticsExecute executes the request + // @return GetStatisticsResponse + GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) + + /* + ListDistributions List all distributions belonging to a specific project + + ListDistributions returns a list of all CDN distributions associated with + a given project, ordered by their distribution ID. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @return ApiListDistributionsRequest + */ + ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest + + // ListDistributionsExecute executes the request + // @return ListDistributionsResponse + ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) + + /* + ListWAFCollections List all WAF rule collections of the project + + Returns all WAF rule collections available to the project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @return ApiListWAFCollectionsRequest + */ + ListWAFCollections(ctx context.Context, projectId string) ApiListWAFCollectionsRequest + + // ListWAFCollectionsExecute executes the request + // @return ListWAFCollectionsResponse + ListWAFCollectionsExecute(r ApiListWAFCollectionsRequest) (*ListWAFCollectionsResponse, error) + + /* + PatchDistribution Update existing distribution + + Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiPatchDistributionRequest + */ + PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest + + // PatchDistributionExecute executes the request + // @return PatchDistributionResponse + PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) + + /* + PurgeCache Clear distribution cache + + Clear the cache for this distribution. + All content, regardless of its staleness, will get refetched from the host. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiPurgeCacheRequest + */ + PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest + + // PurgeCacheExecute executes the request + // @return map[string]interface{} + PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) + + /* + PutCustomDomain Create or update a custom domain + + Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @param domain + @return ApiPutCustomDomainRequest + */ + PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest + + // PutCustomDomainExecute executes the request + // @return PutCustomDomainResponse + PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createDistributionPayload *CreateDistributionPayload +} + +func (r ApiCreateDistributionRequest) CreateDistributionPayload(createDistributionPayload CreateDistributionPayload) ApiCreateDistributionRequest { + r.createDistributionPayload = &createDistributionPayload + return r +} + +func (r ApiCreateDistributionRequest) Execute() (*CreateDistributionResponse, error) { + return r.ApiService.CreateDistributionExecute(r) +} + +/* +CreateDistribution Create new distribution + +CreateDistribution will create a new CDN distribution + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @return ApiCreateDistributionRequest +*/ +func (a *DefaultAPIService) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { + return ApiCreateDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return CreateDistributionResponse +func (a *DefaultAPIService) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDistributionPayload == nil { + return localVarReturnValue, reportError("createDistributionPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createDistributionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string + intentId *string +} + +func (r ApiDeleteCustomDomainRequest) IntentId(intentId string) ApiDeleteCustomDomainRequest { + r.intentId = &intentId + return r +} + +func (r ApiDeleteCustomDomainRequest) Execute() (*DeleteCustomDomainResponse, error) { + return r.ApiService.DeleteCustomDomainExecute(r) +} + +/* +DeleteCustomDomain Delete a custom domain + +# Removes a custom domain + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @param domain + @return ApiDeleteCustomDomainRequest +*/ +func (a *DefaultAPIService) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { + return ApiDeleteCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return DeleteCustomDomainResponse +func (a *DefaultAPIService) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + if r.intentId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + intentId *string +} + +// While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple DELETE-Requests with the same `intentId` are received, all but the first request are dropped. +func (r ApiDeleteDistributionRequest) IntentId(intentId string) ApiDeleteDistributionRequest { + r.intentId = &intentId + return r +} + +func (r ApiDeleteDistributionRequest) Execute() (*DeleteDistributionResponse, error) { + return r.ApiService.DeleteDistributionExecute(r) +} + +/* +DeleteDistribution Delete distribution + +DeleteDistribution accepts a project- and distribution-ID and will delete a distribution. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiDeleteDistributionRequest +*/ +func (a *DefaultAPIService) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { + return ApiDeleteDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return DeleteDistributionResponse +func (a *DefaultAPIService) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeleteDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.intentId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "intentId", r.intentId, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiFindCachePathsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + path *string +} + +// A substring of the search query. +func (r ApiFindCachePathsRequest) Path(path string) ApiFindCachePathsRequest { + r.path = &path + return r +} + +func (r ApiFindCachePathsRequest) Execute() (*FindCachePathsResponse, error) { + return r.ApiService.FindCachePathsExecute(r) +} + +/* +FindCachePaths Return Paths that were purged + +This returns paths that are present in the cache purging history. +Only substrings of the provided input are returned. +The response is sorted in descending order by the most recent purge. + +So, assuming you have have the following purged for a distribution +- `/test/1` at `2025-01-01` +- `/test/2` at `2025-01-02` +- `/someOtherPath/1` at `2025-01-03` +- `/test/1` at `2025-01-04` +- `/test/3` at `2025-01-05`, +this would return the following paths, in the following order, assuming `/te` was the search parameter: +- `/test/3` +- `/test/1` +- `/test/2` + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiFindCachePathsRequest +*/ +func (a *DefaultAPIService) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { + return ApiFindCachePathsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return FindCachePathsResponse +func (a *DefaultAPIService) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FindCachePathsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.FindCachePaths") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/cache/paths" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.path == nil { + return localVarReturnValue, reportError("path is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "path", r.path, "form", "") + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCacheInfoRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + purgePath *string +} + +func (r ApiGetCacheInfoRequest) PurgePath(purgePath string) ApiGetCacheInfoRequest { + r.purgePath = &purgePath + return r +} + +func (r ApiGetCacheInfoRequest) Execute() (*GetCacheInfoResponse, error) { + return r.ApiService.GetCacheInfoExecute(r) +} + +/* +GetCacheInfo Get Infos about the Caching State + +Return caching info metadata, which contains the last cache purging time and a history of the most recent *full* purges. + +If (and only if) you provide the path query parameter, the history will also contain granular cache purges. +The request will not fail if no data about a path is found. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiGetCacheInfoRequest +*/ +func (a *DefaultAPIService) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { + return ApiGetCacheInfoRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetCacheInfoResponse +func (a *DefaultAPIService) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCacheInfoResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCacheInfo") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/cache" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.purgePath != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "purgePath", r.purgePath, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string +} + +func (r ApiGetCustomDomainRequest) Execute() (*GetCustomDomainResponse, error) { + return r.ApiService.GetCustomDomainExecute(r) +} + +/* +GetCustomDomain Retrieve a specific custom domain + +# Returns a 200 and the custom domain if this custom domain was associated to this distribution, else 404 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @param domain + @return ApiGetCustomDomainRequest +*/ +func (a *DefaultAPIService) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { + return ApiGetCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return GetCustomDomainResponse +func (a *DefaultAPIService) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + withWafStatus *bool +} + +// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. +func (r ApiGetDistributionRequest) WithWafStatus(withWafStatus bool) ApiGetDistributionRequest { + r.withWafStatus = &withWafStatus + return r +} + +func (r ApiGetDistributionRequest) Execute() (*GetDistributionResponse, error) { + return r.ApiService.GetDistributionExecute(r) +} + +/* +GetDistribution Get distribution by ID + +This returns a specific distribution by its ID. If no distribution with the given ID exists the endpoint returns 404. Trying to get a deleted distributions also return 404. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiGetDistributionRequest +*/ +func (a *DefaultAPIService) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { + return ApiGetDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetDistributionResponse +func (a *DefaultAPIService) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.withWafStatus != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") + r.withWafStatus = &defaultValue + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetLogsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + from *time.Time + to *time.Time + wafAction *WAFRuleAction + pageSize *int32 + pageIdentifier *string + sortBy *string + sortOrder *string + dataCenterRegion *string + requestCountryCode *string + statusCode *int32 + cacheHit *bool +} + +// the start of the time range for which logs should be returned +func (r ApiGetLogsRequest) From(from time.Time) ApiGetLogsRequest { + r.from = &from + return r +} + +// the end of the time range for which logs should be returned. If not specified, \"now\" is used. +func (r ApiGetLogsRequest) To(to time.Time) ApiGetLogsRequest { + r.to = &to + return r +} + +// If this is set then only log entries with the chosen WAF rule action/outcome are returned. Specifically, if `ALLOWED` then all requests with no violation are returned. If `BLOCKED` then those where a WAF rule blocked a request and if `LOGGED` then only those requests where the WAF violation was only logged but the request not blocked +func (r ApiGetLogsRequest) WafAction(wafAction WAFRuleAction) ApiGetLogsRequest { + r.wafAction = &wafAction + return r +} + +// Quantifies how many log entries should be returned on this page. Must be a natural number between 1 and 1000 (inclusive) +func (r ApiGetLogsRequest) PageSize(pageSize int32) ApiGetLogsRequest { + r.pageSize = &pageSize + return r +} + +// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. +func (r ApiGetLogsRequest) PageIdentifier(pageIdentifier string) ApiGetLogsRequest { + r.pageIdentifier = &pageIdentifier + return r +} + +// Sorts the log messages by a specific field. Defaults to `timestamp`. Supported sort options: - `timestamp` - `dataCenterRegion` - `requestCountryCode` - `statusCode` - `cacheHit` - `size` - `path` - `host` +func (r ApiGetLogsRequest) SortBy(sortBy string) ApiGetLogsRequest { + r.sortBy = &sortBy + return r +} + +func (r ApiGetLogsRequest) SortOrder(sortOrder string) ApiGetLogsRequest { + r.sortOrder = &sortOrder + return r +} + +// Filters by the CDN data center region that served the request. Can be combined with other filters +func (r ApiGetLogsRequest) DataCenterRegion(dataCenterRegion string) ApiGetLogsRequest { + r.dataCenterRegion = &dataCenterRegion + return r +} + +// Filters by the originating country of the user request. Can be combined with other filters +func (r ApiGetLogsRequest) RequestCountryCode(requestCountryCode string) ApiGetLogsRequest { + r.requestCountryCode = &requestCountryCode + return r +} + +// Filters by the HTTP status code returned to the client. Can be combined with other filters +func (r ApiGetLogsRequest) StatusCode(statusCode int32) ApiGetLogsRequest { + r.statusCode = &statusCode + return r +} + +// Filters based on whether the request was served from the CDN cache. Can be combined with other filters +func (r ApiGetLogsRequest) CacheHit(cacheHit bool) ApiGetLogsRequest { + r.cacheHit = &cacheHit + return r +} + +func (r ApiGetLogsRequest) Execute() (*GetLogsResponse, error) { + return r.ApiService.GetLogsExecute(r) +} + +/* +GetLogs Retrieve distribution logs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId Your CDN distribution ID + @return ApiGetLogsRequest +*/ +func (a *DefaultAPIService) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { + return ApiGetLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetLogsResponse +func (a *DefaultAPIService) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetLogsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/logs" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.from != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + } + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.wafAction != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "wafAction", r.wafAction, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } else { + var defaultValue int32 = 20 + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") + r.pageSize = &defaultValue + } + if r.pageIdentifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } else { + var defaultValue string = "timestamp" + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") + r.sortBy = &defaultValue + } + if r.sortOrder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") + } + if r.dataCenterRegion != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "dataCenterRegion", r.dataCenterRegion, "form", "") + } + if r.requestCountryCode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "requestCountryCode", r.requestCountryCode, "form", "") + } + if r.statusCode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "statusCode", r.statusCode, "form", "") + } + if r.cacheHit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cacheHit", r.cacheHit, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetLogsSearchFiltersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + filter *string +} + +// Required filter for search suggestions (e.g., status=4, requestCountry, cacheHit=tru, dataCenterRegion). The filter query cannot be empty. +func (r ApiGetLogsSearchFiltersRequest) Filter(filter string) ApiGetLogsSearchFiltersRequest { + r.filter = &filter + return r +} + +func (r ApiGetLogsSearchFiltersRequest) Execute() (*GetLogsSearchFiltersResponse, error) { + return r.ApiService.GetLogsSearchFiltersExecute(r) +} + +/* +GetLogsSearchFilters Get relevant search filters for this distribution based on user input + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId Your CDN distribution ID + @return ApiGetLogsSearchFiltersRequest +*/ +func (a *DefaultAPIService) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { + return ApiGetLogsSearchFiltersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetLogsSearchFiltersResponse +func (a *DefaultAPIService) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetLogsSearchFiltersResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetLogsSearchFilters") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/logs/searchFilters" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.filter == nil { + return localVarReturnValue, reportError("filter is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetStatisticsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + from *time.Time + to *time.Time + interval *string +} + +// the start of the time range for which statistics should be returned +func (r ApiGetStatisticsRequest) From(from time.Time) ApiGetStatisticsRequest { + r.from = &from + return r +} + +// the end of the time range for which statistics should be returned. If not specified, the end of the current time interval is used, e.g. next day for daily, next month for monthly, and so on. +func (r ApiGetStatisticsRequest) To(to time.Time) ApiGetStatisticsRequest { + r.to = &to + return r +} + +// Over which interval should statistics be aggregated? defaults to hourly resolution **NOTE**: Intervals are grouped in buckets that start and end based on a day in UTC+0 time. So for the `daily` interval, the group starts (inclusive) and ends (exclusive) at `00:00Z` +func (r ApiGetStatisticsRequest) Interval(interval string) ApiGetStatisticsRequest { + r.interval = &interval + return r +} + +func (r ApiGetStatisticsRequest) Execute() (*GetStatisticsResponse, error) { + return r.ApiService.GetStatisticsExecute(r) +} + +/* +GetStatistics Retrieve the statistics of a distribution + +Returns the statistics of the distribution in the given +time range. The response is a list of statistics records. Each record aggregates the statistics for its time interval. +In case no statistics for a time interval exist, no record is returned. +The time range for which statistics should be returned can be configured using query parameters. + +Timestamps are assumed to be UTC. This is especially important for the "buckets" when you, for example, return daily information. A day always starts and ends at 00:00Z. + +**Important Note:** Lower bounds are inclusive, upper bounds are exclusive. If you, for example, want a daily grouped which starts on the 1st Jan and also contains the full 10th Jan day, you would define `2025-01-01T00:00:00Z` as the lower and `2025-01-11T00:00:00Z` as the upper bound. + +The upper bound is optional. If you omit it, the API will use the start of the next interval as the upper bound. +Example: if `interval` is `hourly`, `from` would default to the start of the next hour, if it's `daily`, `from` would default to the start of the next day, etc. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiGetStatisticsRequest +*/ +func (a *DefaultAPIService) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { + return ApiGetStatisticsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return GetStatisticsResponse +func (a *DefaultAPIService) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetStatisticsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetStatistics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/statistics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.from == nil { + return localVarReturnValue, reportError("from is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.interval != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "interval", r.interval, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListDistributionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + pageSize *int32 + withWafStatus *bool + pageIdentifier *string + sortBy *string + sortOrder *string +} + +// Quantifies how many distributions should be returned on this page. Must be a natural number between 1 and 100 (inclusive) +func (r ApiListDistributionsRequest) PageSize(pageSize int32) ApiListDistributionsRequest { + r.pageSize = &pageSize + return r +} + +// If set, the top level of a distribution contains a `waf` property, which defines the status of the waf. This includes a list of all resolved rules. +func (r ApiListDistributionsRequest) WithWafStatus(withWafStatus bool) ApiListDistributionsRequest { + r.withWafStatus = &withWafStatus + return r +} + +// Identifier is returned by the previous response and is used to request the next page. As the `pageIdentifier` encodes an element, inserts during pagination will *not* shift the result. So a scenario like: - Start listing first page - Insert new element - Start listing second page will *never* result in an element from the first page to get \"pushed\" to the second page, like it could occur with basic limit + offset pagination. The identifier should be treated as an opaque string and never modified. Only pass values returned by the API. +func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiListDistributionsRequest { + r.pageIdentifier = &pageIdentifier + return r +} + +// The following sort options exist. We default to `createdAt` - `id` - Sort by distribution ID using String comparison - `updatedAt` - Sort by when the distribution configuration was last modified, for example by changing the regions or response headers - `createdAt` - Sort by when the distribution was initially created. - `originUrl` - Sort by originURL using String comparison - `status` - Sort by distribution status, using String comparison - `originUrlRelated` - The origin URL is segmented and reversed before sorting. E.g. `www.example.com` is converted to `com.example.www` for sorting. This way, distributions pointing to the same domain trees are grouped next to each other. +func (r ApiListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { + r.sortBy = &sortBy + return r +} + +func (r ApiListDistributionsRequest) SortOrder(sortOrder string) ApiListDistributionsRequest { + r.sortOrder = &sortOrder + return r +} + +func (r ApiListDistributionsRequest) Execute() (*ListDistributionsResponse, error) { + return r.ApiService.ListDistributionsExecute(r) +} + +/* +ListDistributions List all distributions belonging to a specific project + +ListDistributions returns a list of all CDN distributions associated with +a given project, ordered by their distribution ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @return ApiListDistributionsRequest +*/ +func (a *DefaultAPIService) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { + return ApiListDistributionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListDistributionsResponse +func (a *DefaultAPIService) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListDistributionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListDistributions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "form", "") + } else { + var defaultValue int32 = 20 + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", defaultValue, "form", "") + r.pageSize = &defaultValue + } + if r.withWafStatus != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", r.withWafStatus, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "withWafStatus", defaultValue, "form", "") + r.withWafStatus = &defaultValue + } + if r.pageIdentifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "form", "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "form", "") + } else { + var defaultValue string = "createdAt" + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", defaultValue, "form", "") + r.sortBy = &defaultValue + } + if r.sortOrder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "form", "") + } + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListWAFCollectionsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListWAFCollectionsRequest) Execute() (*ListWAFCollectionsResponse, error) { + return r.ApiService.ListWAFCollectionsExecute(r) +} + +/* +ListWAFCollections List all WAF rule collections of the project + +Returns all WAF rule collections available to the project + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @return ApiListWAFCollectionsRequest +*/ +func (a *DefaultAPIService) ListWAFCollections(ctx context.Context, projectId string) ApiListWAFCollectionsRequest { + return ApiListWAFCollectionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListWAFCollectionsResponse +func (a *DefaultAPIService) ListWAFCollectionsExecute(r ApiListWAFCollectionsRequest) (*ListWAFCollectionsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListWAFCollectionsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListWAFCollections") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/waf/collections" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPatchDistributionRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + patchDistributionPayload *PatchDistributionPayload +} + +func (r ApiPatchDistributionRequest) PatchDistributionPayload(patchDistributionPayload PatchDistributionPayload) ApiPatchDistributionRequest { + r.patchDistributionPayload = &patchDistributionPayload + return r +} + +func (r ApiPatchDistributionRequest) Execute() (*PatchDistributionResponse, error) { + return r.ApiService.PatchDistributionExecute(r) +} + +/* +PatchDistribution Update existing distribution + +Modify a CDN distribution with a partial update. Only the fields specified in the request will be modified. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiPatchDistributionRequest +*/ +func (a *DefaultAPIService) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { + return ApiPatchDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return PatchDistributionResponse +func (a *DefaultAPIService) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PatchDistributionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchDistribution") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchDistributionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPurgeCacheRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + purgeCachePayload *PurgeCachePayload +} + +func (r ApiPurgeCacheRequest) PurgeCachePayload(purgeCachePayload PurgeCachePayload) ApiPurgeCacheRequest { + r.purgeCachePayload = &purgeCachePayload + return r +} + +func (r ApiPurgeCacheRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.PurgeCacheExecute(r) +} + +/* +PurgeCache Clear distribution cache + +Clear the cache for this distribution. +All content, regardless of its staleness, will get refetched from the host. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @return ApiPurgeCacheRequest +*/ +func (a *DefaultAPIService) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { + return ApiPurgeCacheRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *DefaultAPIService) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PurgeCache") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/cache/purge" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.purgeCachePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPutCustomDomainRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + distributionId string + domain string + putCustomDomainPayload *PutCustomDomainPayload +} + +func (r ApiPutCustomDomainRequest) PutCustomDomainPayload(putCustomDomainPayload PutCustomDomainPayload) ApiPutCustomDomainRequest { + r.putCustomDomainPayload = &putCustomDomainPayload + return r +} + +func (r ApiPutCustomDomainRequest) Execute() (*PutCustomDomainResponse, error) { + return r.ApiService.PutCustomDomainExecute(r) +} + +/* +PutCustomDomain Create or update a custom domain + +Creates a new custom domain. If it already exists, this will overwrite the previous custom domain's properties. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Your STACKIT Project ID + @param distributionId + @param domain + @return ApiPutCustomDomainRequest +*/ +func (a *DefaultAPIService) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { + return ApiPutCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// Execute executes the request +// +// @return PutCustomDomainResponse +func (a *DefaultAPIService) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PutCustomDomainResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PutCustomDomain") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"distributionId"+"}", url.PathEscape(parameterValueToString(r.distributionId, "distributionId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"domain"+"}", url.PathEscape(parameterValueToString(r.domain, "domain")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.domain) > 72 { + return localVarReturnValue, reportError("domain must have less than 72 elements") + } + + // 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", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.putCustomDomainPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + var v GenericJSONResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/cdn/v1betaapi/api_default_mock.go b/services/cdn/v1betaapi/api_default_mock.go new file mode 100644 index 000000000..1ff6d249e --- /dev/null +++ b/services/cdn/v1betaapi/api_default_mock.go @@ -0,0 +1,338 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateDistributionExecuteMock can be populated to implement the behavior of the CreateDistributionExecute function of this mock + CreateDistributionExecuteMock *func(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) + // DeleteCustomDomainExecuteMock can be populated to implement the behavior of the DeleteCustomDomainExecute function of this mock + DeleteCustomDomainExecuteMock *func(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) + // DeleteDistributionExecuteMock can be populated to implement the behavior of the DeleteDistributionExecute function of this mock + DeleteDistributionExecuteMock *func(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) + // FindCachePathsExecuteMock can be populated to implement the behavior of the FindCachePathsExecute function of this mock + FindCachePathsExecuteMock *func(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) + // GetCacheInfoExecuteMock can be populated to implement the behavior of the GetCacheInfoExecute function of this mock + GetCacheInfoExecuteMock *func(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) + // GetCustomDomainExecuteMock can be populated to implement the behavior of the GetCustomDomainExecute function of this mock + GetCustomDomainExecuteMock *func(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) + // GetDistributionExecuteMock can be populated to implement the behavior of the GetDistributionExecute function of this mock + GetDistributionExecuteMock *func(r ApiGetDistributionRequest) (*GetDistributionResponse, error) + // GetLogsExecuteMock can be populated to implement the behavior of the GetLogsExecute function of this mock + GetLogsExecuteMock *func(r ApiGetLogsRequest) (*GetLogsResponse, error) + // GetLogsSearchFiltersExecuteMock can be populated to implement the behavior of the GetLogsSearchFiltersExecute function of this mock + GetLogsSearchFiltersExecuteMock *func(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) + // GetStatisticsExecuteMock can be populated to implement the behavior of the GetStatisticsExecute function of this mock + GetStatisticsExecuteMock *func(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) + // ListDistributionsExecuteMock can be populated to implement the behavior of the ListDistributionsExecute function of this mock + ListDistributionsExecuteMock *func(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) + // ListWAFCollectionsExecuteMock can be populated to implement the behavior of the ListWAFCollectionsExecute function of this mock + ListWAFCollectionsExecuteMock *func(r ApiListWAFCollectionsRequest) (*ListWAFCollectionsResponse, error) + // PatchDistributionExecuteMock can be populated to implement the behavior of the PatchDistributionExecute function of this mock + PatchDistributionExecuteMock *func(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) + // PurgeCacheExecuteMock can be populated to implement the behavior of the PurgeCacheExecute function of this mock + PurgeCacheExecuteMock *func(r ApiPurgeCacheRequest) (map[string]interface{}, error) + // PutCustomDomainExecuteMock can be populated to implement the behavior of the PutCustomDomainExecute function of this mock + PutCustomDomainExecuteMock *func(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) +} + +func (a DefaultAPIServiceMock) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { + return ApiCreateDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// CreateDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateDistributionExecute(r ApiCreateDistributionRequest) (*CreateDistributionResponse, error) { + if a.CreateDistributionExecuteMock == nil { + var localVarReturnValue *CreateDistributionResponse + return localVarReturnValue, nil + } + + return (*a.CreateDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiDeleteCustomDomainRequest { + return ApiDeleteCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// DeleteCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteCustomDomainExecute(r ApiDeleteCustomDomainRequest) (*DeleteCustomDomainResponse, error) { + if a.DeleteCustomDomainExecuteMock == nil { + var localVarReturnValue *DeleteCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.DeleteCustomDomainExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteDistribution(ctx context.Context, projectId string, distributionId string) ApiDeleteDistributionRequest { + return ApiDeleteDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// DeleteDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteDistributionExecute(r ApiDeleteDistributionRequest) (*DeleteDistributionResponse, error) { + if a.DeleteDistributionExecuteMock == nil { + var localVarReturnValue *DeleteDistributionResponse + return localVarReturnValue, nil + } + + return (*a.DeleteDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) FindCachePaths(ctx context.Context, projectId string, distributionId string) ApiFindCachePathsRequest { + return ApiFindCachePathsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// FindCachePathsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the FindCachePathsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) FindCachePathsExecute(r ApiFindCachePathsRequest) (*FindCachePathsResponse, error) { + if a.FindCachePathsExecuteMock == nil { + var localVarReturnValue *FindCachePathsResponse + return localVarReturnValue, nil + } + + return (*a.FindCachePathsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCacheInfo(ctx context.Context, projectId string, distributionId string) ApiGetCacheInfoRequest { + return ApiGetCacheInfoRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetCacheInfoExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCacheInfoExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCacheInfoExecute(r ApiGetCacheInfoRequest) (*GetCacheInfoResponse, error) { + if a.GetCacheInfoExecuteMock == nil { + var localVarReturnValue *GetCacheInfoResponse + return localVarReturnValue, nil + } + + return (*a.GetCacheInfoExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiGetCustomDomainRequest { + return ApiGetCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// GetCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetCustomDomainExecute(r ApiGetCustomDomainRequest) (*GetCustomDomainResponse, error) { + if a.GetCustomDomainExecuteMock == nil { + var localVarReturnValue *GetCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.GetCustomDomainExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetDistribution(ctx context.Context, projectId string, distributionId string) ApiGetDistributionRequest { + return ApiGetDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetDistributionExecute(r ApiGetDistributionRequest) (*GetDistributionResponse, error) { + if a.GetDistributionExecuteMock == nil { + var localVarReturnValue *GetDistributionResponse + return localVarReturnValue, nil + } + + return (*a.GetDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { + return ApiGetLogsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetLogsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetLogsExecute(r ApiGetLogsRequest) (*GetLogsResponse, error) { + if a.GetLogsExecuteMock == nil { + var localVarReturnValue *GetLogsResponse + return localVarReturnValue, nil + } + + return (*a.GetLogsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetLogsSearchFilters(ctx context.Context, projectId string, distributionId string) ApiGetLogsSearchFiltersRequest { + return ApiGetLogsSearchFiltersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetLogsSearchFiltersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetLogsSearchFiltersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetLogsSearchFiltersExecute(r ApiGetLogsSearchFiltersRequest) (*GetLogsSearchFiltersResponse, error) { + if a.GetLogsSearchFiltersExecuteMock == nil { + var localVarReturnValue *GetLogsSearchFiltersResponse + return localVarReturnValue, nil + } + + return (*a.GetLogsSearchFiltersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetStatistics(ctx context.Context, projectId string, distributionId string) ApiGetStatisticsRequest { + return ApiGetStatisticsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// GetStatisticsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetStatisticsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetStatisticsExecute(r ApiGetStatisticsRequest) (*GetStatisticsResponse, error) { + if a.GetStatisticsExecuteMock == nil { + var localVarReturnValue *GetStatisticsResponse + return localVarReturnValue, nil + } + + return (*a.GetStatisticsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { + return ApiListDistributionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListDistributionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListDistributionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListDistributionsExecute(r ApiListDistributionsRequest) (*ListDistributionsResponse, error) { + if a.ListDistributionsExecuteMock == nil { + var localVarReturnValue *ListDistributionsResponse + return localVarReturnValue, nil + } + + return (*a.ListDistributionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListWAFCollections(ctx context.Context, projectId string) ApiListWAFCollectionsRequest { + return ApiListWAFCollectionsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListWAFCollectionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListWAFCollectionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListWAFCollectionsExecute(r ApiListWAFCollectionsRequest) (*ListWAFCollectionsResponse, error) { + if a.ListWAFCollectionsExecuteMock == nil { + var localVarReturnValue *ListWAFCollectionsResponse + return localVarReturnValue, nil + } + + return (*a.ListWAFCollectionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PatchDistribution(ctx context.Context, projectId string, distributionId string) ApiPatchDistributionRequest { + return ApiPatchDistributionRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// PatchDistributionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchDistributionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PatchDistributionExecute(r ApiPatchDistributionRequest) (*PatchDistributionResponse, error) { + if a.PatchDistributionExecuteMock == nil { + var localVarReturnValue *PatchDistributionResponse + return localVarReturnValue, nil + } + + return (*a.PatchDistributionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PurgeCache(ctx context.Context, projectId string, distributionId string) ApiPurgeCacheRequest { + return ApiPurgeCacheRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +// PurgeCacheExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PurgeCacheExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PurgeCacheExecute(r ApiPurgeCacheRequest) (map[string]interface{}, error) { + if a.PurgeCacheExecuteMock == nil { + var localVarReturnValue map[string]interface{} + return localVarReturnValue, nil + } + + return (*a.PurgeCacheExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PutCustomDomain(ctx context.Context, projectId string, distributionId string, domain string) ApiPutCustomDomainRequest { + return ApiPutCustomDomainRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + domain: domain, + } +} + +// PutCustomDomainExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PutCustomDomainExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PutCustomDomainExecute(r ApiPutCustomDomainRequest) (*PutCustomDomainResponse, error) { + if a.PutCustomDomainExecuteMock == nil { + var localVarReturnValue *PutCustomDomainResponse + return localVarReturnValue, nil + } + + return (*a.PutCustomDomainExecuteMock)(r) +} diff --git a/services/cdn/v1betaapi/client.go b/services/cdn/v1betaapi/client.go new file mode 100644 index 000000000..24697b385 --- /dev/null +++ b/services/cdn/v1betaapi/client.go @@ -0,0 +1,658 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the CDN API API v1beta.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/cdn/v1betaapi/configuration.go b/services/cdn/v1betaapi/configuration.go new file mode 100644 index 000000000..ff47d31ec --- /dev/null +++ b/services/cdn/v1betaapi/configuration.go @@ -0,0 +1,37 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/cdn", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://cdn.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/cdn/v1betaapi/model_config.go b/services/cdn/v1betaapi/model_config.go new file mode 100644 index 000000000..fbcff5844 --- /dev/null +++ b/services/cdn/v1betaapi/model_config.go @@ -0,0 +1,438 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Config type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Config{} + +// Config struct for Config +type Config struct { + Backend HttpBackend `json:"backend"` + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIPs []string `json:"blockedIPs"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` + LogSink *LokiLogSink `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *Optimizer `json:"optimizer,omitempty"` + Regions []Region `json:"regions"` + Waf WafConfig `json:"waf"` +} + +type _Config Config + +// NewConfig instantiates a new Config 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 NewConfig(backend HttpBackend, blockedCountries []string, blockedIPs []string, regions []Region, waf WafConfig) *Config { + this := Config{} + this.Backend = backend + this.BlockedCountries = blockedCountries + this.BlockedIPs = blockedIPs + this.Regions = regions + this.Waf = waf + return &this +} + +// NewConfigWithDefaults instantiates a new Config 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 NewConfigWithDefaults() *Config { + this := Config{} + return &this +} + +// GetBackend returns the Backend field value +func (o *Config) GetBackend() HttpBackend { + if o == nil { + var ret HttpBackend + return ret + } + + return o.Backend +} + +// GetBackendOk returns a tuple with the Backend field value +// and a boolean to check if the value has been set. +func (o *Config) GetBackendOk() (*HttpBackend, bool) { + if o == nil { + return nil, false + } + return &o.Backend, true +} + +// SetBackend sets field value +func (o *Config) SetBackend(v HttpBackend) { + o.Backend = v +} + +// GetBlockedCountries returns the BlockedCountries field value +func (o *Config) GetBlockedCountries() []string { + if o == nil { + var ret []string + return ret + } + + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value +// and a boolean to check if the value has been set. +func (o *Config) GetBlockedCountriesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BlockedCountries, true +} + +// SetBlockedCountries sets field value +func (o *Config) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIPs returns the BlockedIPs field value +func (o *Config) GetBlockedIPs() []string { + if o == nil { + var ret []string + return ret + } + + return o.BlockedIPs +} + +// GetBlockedIPsOk returns a tuple with the BlockedIPs field value +// and a boolean to check if the value has been set. +func (o *Config) GetBlockedIPsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.BlockedIPs, true +} + +// SetBlockedIPs sets field value +func (o *Config) SetBlockedIPs(v []string) { + o.BlockedIPs = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Config) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration.Get()) { + var ret string + return ret + } + return *o.DefaultCacheDuration.Get() +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *Config) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *Config) HasDefaultCacheDuration() bool { + if o != nil && o.DefaultCacheDuration.IsSet() { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. +func (o *Config) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration.Set(&v) +} + +// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +func (o *Config) SetDefaultCacheDurationNil() { + o.DefaultCacheDuration.Set(nil) +} + +// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +func (o *Config) UnsetDefaultCacheDuration() { + o.DefaultCacheDuration.Unset() +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise. +func (o *Config) GetLogSink() LokiLogSink { + if o == nil || IsNil(o.LogSink) { + var ret LokiLogSink + return ret + } + return *o.LogSink +} + +// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Config) GetLogSinkOk() (*LokiLogSink, bool) { + if o == nil || IsNil(o.LogSink) { + return nil, false + } + return o.LogSink, true +} + +// HasLogSink returns a boolean if a field has been set. +func (o *Config) HasLogSink() bool { + if o != nil && !IsNil(o.LogSink) { + return true + } + + return false +} + +// SetLogSink gets a reference to the given LokiLogSink and assigns it to the LogSink field. +func (o *Config) SetLogSink(v LokiLogSink) { + o.LogSink = &v +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Config) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes.Get() +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *Config) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *Config) HasMonthlyLimitBytes() bool { + if o != nil && o.MonthlyLimitBytes.IsSet() { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. +func (o *Config) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes.Set(&v) +} + +// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +func (o *Config) SetMonthlyLimitBytesNil() { + o.MonthlyLimitBytes.Set(nil) +} + +// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +func (o *Config) UnsetMonthlyLimitBytes() { + o.MonthlyLimitBytes.Unset() +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *Config) GetOptimizer() Optimizer { + if o == nil || IsNil(o.Optimizer) { + var ret Optimizer + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Config) GetOptimizerOk() (*Optimizer, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *Config) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. +func (o *Config) SetOptimizer(v Optimizer) { + o.Optimizer = &v +} + +// GetRegions returns the Regions field value +func (o *Config) GetRegions() []Region { + if o == nil { + var ret []Region + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *Config) GetRegionsOk() ([]Region, bool) { + if o == nil { + return nil, false + } + return o.Regions, true +} + +// SetRegions sets field value +func (o *Config) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value +func (o *Config) GetWaf() WafConfig { + if o == nil { + var ret WafConfig + return ret + } + + return o.Waf +} + +// GetWafOk returns a tuple with the Waf field value +// and a boolean to check if the value has been set. +func (o *Config) GetWafOk() (*WafConfig, bool) { + if o == nil { + return nil, false + } + return &o.Waf, true +} + +// SetWaf sets field value +func (o *Config) SetWaf(v WafConfig) { + o.Waf = v +} + +func (o Config) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Config) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backend"] = o.Backend + toSerialize["blockedCountries"] = o.BlockedCountries + toSerialize["blockedIPs"] = o.BlockedIPs + if o.DefaultCacheDuration.IsSet() { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() + } + if !IsNil(o.LogSink) { + toSerialize["logSink"] = o.LogSink + } + if o.MonthlyLimitBytes.IsSet() { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + toSerialize["regions"] = o.Regions + toSerialize["waf"] = o.Waf + return toSerialize, nil +} + +func (o *Config) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backend", + "blockedCountries", + "blockedIPs", + "regions", + "waf", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConfig := _Config{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varConfig) + + if err != nil { + return err + } + + *o = Config(varConfig) + + return err +} + +type NullableConfig struct { + value *Config + isSet bool +} + +func (v NullableConfig) Get() *Config { + return v.value +} + +func (v *NullableConfig) Set(val *Config) { + v.value = val + v.isSet = true +} + +func (v NullableConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfig(val *Config) *NullableConfig { + return &NullableConfig{value: val, isSet: true} +} + +func (v NullableConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_config_patch.go b/services/cdn/v1betaapi/model_config_patch.go new file mode 100644 index 000000000..b353e089c --- /dev/null +++ b/services/cdn/v1betaapi/model_config_patch.go @@ -0,0 +1,449 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ConfigPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigPatch{} + +// ConfigPatch struct for ConfigPatch +type ConfigPatch struct { + Backend *HttpBackendPatch `json:"backend,omitempty"` + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries,omitempty"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIPs []string `json:"blockedIPs,omitempty"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration NullableString `json:"defaultCacheDuration,omitempty"` + LogSink NullablePatchLokiLogSink `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes NullableInt64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *OptimizerPatch `json:"optimizer,omitempty"` + Regions []Region `json:"regions,omitempty"` + Waf *WafConfigPatch `json:"waf,omitempty"` +} + +// NewConfigPatch instantiates a new ConfigPatch 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 NewConfigPatch() *ConfigPatch { + this := ConfigPatch{} + return &this +} + +// NewConfigPatchWithDefaults instantiates a new ConfigPatch 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 NewConfigPatchWithDefaults() *ConfigPatch { + this := ConfigPatch{} + return &this +} + +// GetBackend returns the Backend field value if set, zero value otherwise. +func (o *ConfigPatch) GetBackend() HttpBackendPatch { + if o == nil || IsNil(o.Backend) { + var ret HttpBackendPatch + return ret + } + return *o.Backend +} + +// GetBackendOk returns a tuple with the Backend field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBackendOk() (*HttpBackendPatch, bool) { + if o == nil || IsNil(o.Backend) { + return nil, false + } + return o.Backend, true +} + +// HasBackend returns a boolean if a field has been set. +func (o *ConfigPatch) HasBackend() bool { + if o != nil && !IsNil(o.Backend) { + return true + } + + return false +} + +// SetBackend gets a reference to the given HttpBackendPatch and assigns it to the Backend field. +func (o *ConfigPatch) SetBackend(v HttpBackendPatch) { + o.Backend = &v +} + +// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +func (o *ConfigPatch) GetBlockedCountries() []string { + if o == nil || IsNil(o.BlockedCountries) { + var ret []string + return ret + } + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBlockedCountriesOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedCountries) { + return nil, false + } + return o.BlockedCountries, true +} + +// HasBlockedCountries returns a boolean if a field has been set. +func (o *ConfigPatch) HasBlockedCountries() bool { + if o != nil && !IsNil(o.BlockedCountries) { + return true + } + + return false +} + +// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. +func (o *ConfigPatch) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIPs returns the BlockedIPs field value if set, zero value otherwise. +func (o *ConfigPatch) GetBlockedIPs() []string { + if o == nil || IsNil(o.BlockedIPs) { + var ret []string + return ret + } + return o.BlockedIPs +} + +// GetBlockedIPsOk returns a tuple with the BlockedIPs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetBlockedIPsOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedIPs) { + return nil, false + } + return o.BlockedIPs, true +} + +// HasBlockedIPs returns a boolean if a field has been set. +func (o *ConfigPatch) HasBlockedIPs() bool { + if o != nil && !IsNil(o.BlockedIPs) { + return true + } + + return false +} + +// SetBlockedIPs gets a reference to the given []string and assigns it to the BlockedIPs field. +func (o *ConfigPatch) SetBlockedIPs(v []string) { + o.BlockedIPs = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration.Get()) { + var ret string + return ret + } + return *o.DefaultCacheDuration.Get() +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration 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 *ConfigPatch) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultCacheDuration.Get(), o.DefaultCacheDuration.IsSet() +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *ConfigPatch) HasDefaultCacheDuration() bool { + if o != nil && o.DefaultCacheDuration.IsSet() { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given NullableString and assigns it to the DefaultCacheDuration field. +func (o *ConfigPatch) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration.Set(&v) +} + +// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil +func (o *ConfigPatch) SetDefaultCacheDurationNil() { + o.DefaultCacheDuration.Set(nil) +} + +// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil +func (o *ConfigPatch) UnsetDefaultCacheDuration() { + o.DefaultCacheDuration.Unset() +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetLogSink() PatchLokiLogSink { + if o == nil || IsNil(o.LogSink.Get()) { + var ret PatchLokiLogSink + return ret + } + return *o.LogSink.Get() +} + +// GetLogSinkOk returns a tuple with the LogSink 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 *ConfigPatch) GetLogSinkOk() (*PatchLokiLogSink, bool) { + if o == nil { + return nil, false + } + return o.LogSink.Get(), o.LogSink.IsSet() +} + +// HasLogSink returns a boolean if a field has been set. +func (o *ConfigPatch) HasLogSink() bool { + if o != nil && o.LogSink.IsSet() { + return true + } + + return false +} + +// SetLogSink gets a reference to the given NullablePatchLokiLogSink and assigns it to the LogSink field. +func (o *ConfigPatch) SetLogSink(v PatchLokiLogSink) { + o.LogSink.Set(&v) +} + +// SetLogSinkNil sets the value for LogSink to be an explicit nil +func (o *ConfigPatch) SetLogSinkNil() { + o.LogSink.Set(nil) +} + +// UnsetLogSink ensures that no value is present for LogSink, not even an explicit nil +func (o *ConfigPatch) UnsetLogSink() { + o.LogSink.Unset() +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes.Get()) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes.Get() +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes 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 *ConfigPatch) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.MonthlyLimitBytes.Get(), o.MonthlyLimitBytes.IsSet() +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *ConfigPatch) HasMonthlyLimitBytes() bool { + if o != nil && o.MonthlyLimitBytes.IsSet() { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given NullableInt64 and assigns it to the MonthlyLimitBytes field. +func (o *ConfigPatch) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes.Set(&v) +} + +// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +func (o *ConfigPatch) SetMonthlyLimitBytesNil() { + o.MonthlyLimitBytes.Set(nil) +} + +// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +func (o *ConfigPatch) UnsetMonthlyLimitBytes() { + o.MonthlyLimitBytes.Unset() +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *ConfigPatch) GetOptimizer() OptimizerPatch { + if o == nil || IsNil(o.Optimizer) { + var ret OptimizerPatch + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetOptimizerOk() (*OptimizerPatch, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *ConfigPatch) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given OptimizerPatch and assigns it to the Optimizer field. +func (o *ConfigPatch) SetOptimizer(v OptimizerPatch) { + o.Optimizer = &v +} + +// GetRegions returns the Regions field value if set, zero value otherwise. +func (o *ConfigPatch) GetRegions() []Region { + if o == nil || IsNil(o.Regions) { + var ret []Region + return ret + } + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetRegionsOk() ([]Region, bool) { + if o == nil || IsNil(o.Regions) { + return nil, false + } + return o.Regions, true +} + +// HasRegions returns a boolean if a field has been set. +func (o *ConfigPatch) HasRegions() bool { + if o != nil && !IsNil(o.Regions) { + return true + } + + return false +} + +// SetRegions gets a reference to the given []Region and assigns it to the Regions field. +func (o *ConfigPatch) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *ConfigPatch) GetWaf() WafConfigPatch { + if o == nil || IsNil(o.Waf) { + var ret WafConfigPatch + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConfigPatch) GetWafOk() (*WafConfigPatch, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *ConfigPatch) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given WafConfigPatch and assigns it to the Waf field. +func (o *ConfigPatch) SetWaf(v WafConfigPatch) { + o.Waf = &v +} + +func (o ConfigPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Backend) { + toSerialize["backend"] = o.Backend + } + if !IsNil(o.BlockedCountries) { + toSerialize["blockedCountries"] = o.BlockedCountries + } + if !IsNil(o.BlockedIPs) { + toSerialize["blockedIPs"] = o.BlockedIPs + } + if o.DefaultCacheDuration.IsSet() { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration.Get() + } + if o.LogSink.IsSet() { + toSerialize["logSink"] = o.LogSink.Get() + } + if o.MonthlyLimitBytes.IsSet() { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes.Get() + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + if !IsNil(o.Regions) { + toSerialize["regions"] = o.Regions + } + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +type NullableConfigPatch struct { + value *ConfigPatch + isSet bool +} + +func (v NullableConfigPatch) Get() *ConfigPatch { + return v.value +} + +func (v *NullableConfigPatch) Set(val *ConfigPatch) { + v.value = val + v.isSet = true +} + +func (v NullableConfigPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableConfigPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfigPatch(val *ConfigPatch) *NullableConfigPatch { + return &NullableConfigPatch{value: val, isSet: true} +} + +func (v NullableConfigPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfigPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_create_distribution_payload.go b/services/cdn/v1betaapi/model_create_distribution_payload.go new file mode 100644 index 000000000..28942e041 --- /dev/null +++ b/services/cdn/v1betaapi/model_create_distribution_payload.go @@ -0,0 +1,553 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateDistributionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDistributionPayload{} + +// CreateDistributionPayload struct for CreateDistributionPayload +type CreateDistributionPayload struct { + // Restricts access to your content based on country. We use the ISO 3166-1 alpha-2 standard for country codes (e.g., DE, ES, GB). This setting blocks users from the specified countries. + BlockedCountries []string `json:"blockedCountries,omitempty"` + // Restricts access to your content by specifying a list of blocked IPv4 addresses. This feature enhances security and privacy by preventing these addresses from accessing your distribution. + BlockedIPs []string `json:"blockedIPs,omitempty"` + // Sets the default cache duration for the distribution. The default cache duration is applied when a 'Cache-Control' header is not presented in the origin's response. We use ISO8601 duration format for cache duration (e.g. P1DT2H30M) + DefaultCacheDuration *string `json:"defaultCacheDuration,omitempty"` + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You can not have a country be assigned to multiple alternative origins. + Geofencing *map[string][]string `json:"geofencing,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple POST-Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` + LogSink *PatchLokiLogSink `json:"logSink,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes *int64 `json:"monthlyLimitBytes,omitempty"` + Optimizer *Optimizer `json:"optimizer,omitempty"` + // Headers that will be sent with every request to the configured origin. WARNING: Do not store sensitive values in the headers. The data is stores as plain text. + OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` + // The origin of the content that should be made available through the CDN. Note that the path and query parameters are ignored. Ports are allowed. If no protocol is provided, `https` is assumed. So `www.example.com:1234/somePath?q=123` is normalized to `https://www.example.com:1234` + OriginUrl string `json:"originUrl"` + // Define in which regions you would like your content to be cached. + Regions []Region `json:"regions"` + Waf *WafConfig `json:"waf,omitempty"` +} + +type _CreateDistributionPayload CreateDistributionPayload + +// NewCreateDistributionPayload instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayload(originUrl string, regions []Region) *CreateDistributionPayload { + this := CreateDistributionPayload{} + this.OriginUrl = originUrl + this.Regions = regions + return &this +} + +// NewCreateDistributionPayloadWithDefaults instantiates a new CreateDistributionPayload 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 NewCreateDistributionPayloadWithDefaults() *CreateDistributionPayload { + this := CreateDistributionPayload{} + return &this +} + +// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetBlockedCountries() []string { + if o == nil || IsNil(o.BlockedCountries) { + var ret []string + return ret + } + return o.BlockedCountries +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetBlockedCountriesOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedCountries) { + return nil, false + } + return o.BlockedCountries, true +} + +// HasBlockedCountries returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasBlockedCountries() bool { + if o != nil && !IsNil(o.BlockedCountries) { + return true + } + + return false +} + +// SetBlockedCountries gets a reference to the given []string and assigns it to the BlockedCountries field. +func (o *CreateDistributionPayload) SetBlockedCountries(v []string) { + o.BlockedCountries = v +} + +// GetBlockedIPs returns the BlockedIPs field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetBlockedIPs() []string { + if o == nil || IsNil(o.BlockedIPs) { + var ret []string + return ret + } + return o.BlockedIPs +} + +// GetBlockedIPsOk returns a tuple with the BlockedIPs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetBlockedIPsOk() ([]string, bool) { + if o == nil || IsNil(o.BlockedIPs) { + return nil, false + } + return o.BlockedIPs, true +} + +// HasBlockedIPs returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasBlockedIPs() bool { + if o != nil && !IsNil(o.BlockedIPs) { + return true + } + + return false +} + +// SetBlockedIPs gets a reference to the given []string and assigns it to the BlockedIPs field. +func (o *CreateDistributionPayload) SetBlockedIPs(v []string) { + o.BlockedIPs = v +} + +// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetDefaultCacheDuration() string { + if o == nil || IsNil(o.DefaultCacheDuration) { + var ret string + return ret + } + return *o.DefaultCacheDuration +} + +// GetDefaultCacheDurationOk returns a tuple with the DefaultCacheDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetDefaultCacheDurationOk() (*string, bool) { + if o == nil || IsNil(o.DefaultCacheDuration) { + return nil, false + } + return o.DefaultCacheDuration, true +} + +// HasDefaultCacheDuration returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasDefaultCacheDuration() bool { + if o != nil && !IsNil(o.DefaultCacheDuration) { + return true + } + + return false +} + +// SetDefaultCacheDuration gets a reference to the given string and assigns it to the DefaultCacheDuration field. +func (o *CreateDistributionPayload) SetDefaultCacheDuration(v string) { + o.DefaultCacheDuration = &v +} + +// GetGeofencing returns the Geofencing field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetGeofencing() map[string][]string { + if o == nil || IsNil(o.Geofencing) { + var ret map[string][]string + return ret + } + return *o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil || IsNil(o.Geofencing) { + return nil, false + } + return o.Geofencing, true +} + +// HasGeofencing returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasGeofencing() bool { + if o != nil && !IsNil(o.Geofencing) { + return true + } + + return false +} + +// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. +func (o *CreateDistributionPayload) SetGeofencing(v map[string][]string) { + o.Geofencing = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *CreateDistributionPayload) SetIntentId(v string) { + o.IntentId = &v +} + +// GetLogSink returns the LogSink field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetLogSink() PatchLokiLogSink { + if o == nil || IsNil(o.LogSink) { + var ret PatchLokiLogSink + return ret + } + return *o.LogSink +} + +// GetLogSinkOk returns a tuple with the LogSink field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetLogSinkOk() (*PatchLokiLogSink, bool) { + if o == nil || IsNil(o.LogSink) { + return nil, false + } + return o.LogSink, true +} + +// HasLogSink returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasLogSink() bool { + if o != nil && !IsNil(o.LogSink) { + return true + } + + return false +} + +// SetLogSink gets a reference to the given PatchLokiLogSink and assigns it to the LogSink field. +func (o *CreateDistributionPayload) SetLogSink(v PatchLokiLogSink) { + o.LogSink = &v +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetMonthlyLimitBytes() int64 { + if o == nil || IsNil(o.MonthlyLimitBytes) { + var ret int64 + return ret + } + return *o.MonthlyLimitBytes +} + +// GetMonthlyLimitBytesOk returns a tuple with the MonthlyLimitBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetMonthlyLimitBytesOk() (*int64, bool) { + if o == nil || IsNil(o.MonthlyLimitBytes) { + return nil, false + } + return o.MonthlyLimitBytes, true +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasMonthlyLimitBytes() bool { + if o != nil && !IsNil(o.MonthlyLimitBytes) { + return true + } + + return false +} + +// SetMonthlyLimitBytes gets a reference to the given int64 and assigns it to the MonthlyLimitBytes field. +func (o *CreateDistributionPayload) SetMonthlyLimitBytes(v int64) { + o.MonthlyLimitBytes = &v +} + +// GetOptimizer returns the Optimizer field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetOptimizer() Optimizer { + if o == nil || IsNil(o.Optimizer) { + var ret Optimizer + return ret + } + return *o.Optimizer +} + +// GetOptimizerOk returns a tuple with the Optimizer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetOptimizerOk() (*Optimizer, bool) { + if o == nil || IsNil(o.Optimizer) { + return nil, false + } + return o.Optimizer, true +} + +// HasOptimizer returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasOptimizer() bool { + if o != nil && !IsNil(o.Optimizer) { + return true + } + + return false +} + +// SetOptimizer gets a reference to the given Optimizer and assigns it to the Optimizer field. +func (o *CreateDistributionPayload) SetOptimizer(v Optimizer) { + o.Optimizer = &v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetOriginRequestHeaders() map[string]string { + if o == nil || IsNil(o.OriginRequestHeaders) { + var ret map[string]string + return ret + } + return *o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil || IsNil(o.OriginRequestHeaders) { + return nil, false + } + return o.OriginRequestHeaders, true +} + +// HasOriginRequestHeaders returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasOriginRequestHeaders() bool { + if o != nil && !IsNil(o.OriginRequestHeaders) { + return true + } + + return false +} + +// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. +func (o *CreateDistributionPayload) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = &v +} + +// GetOriginUrl returns the OriginUrl field value +func (o *CreateDistributionPayload) GetOriginUrl() string { + if o == nil { + var ret string + return ret + } + + return o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetOriginUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginUrl, true +} + +// SetOriginUrl sets field value +func (o *CreateDistributionPayload) SetOriginUrl(v string) { + o.OriginUrl = v +} + +// GetRegions returns the Regions field value +func (o *CreateDistributionPayload) GetRegions() []Region { + if o == nil { + var ret []Region + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetRegionsOk() ([]Region, bool) { + if o == nil { + return nil, false + } + return o.Regions, true +} + +// SetRegions sets field value +func (o *CreateDistributionPayload) SetRegions(v []Region) { + o.Regions = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetWaf() WafConfig { + if o == nil || IsNil(o.Waf) { + var ret WafConfig + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateDistributionPayload) GetWafOk() (*WafConfig, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *CreateDistributionPayload) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given WafConfig and assigns it to the Waf field. +func (o *CreateDistributionPayload) SetWaf(v WafConfig) { + o.Waf = &v +} + +func (o CreateDistributionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BlockedCountries) { + toSerialize["blockedCountries"] = o.BlockedCountries + } + if !IsNil(o.BlockedIPs) { + toSerialize["blockedIPs"] = o.BlockedIPs + } + if !IsNil(o.DefaultCacheDuration) { + toSerialize["defaultCacheDuration"] = o.DefaultCacheDuration + } + if !IsNil(o.Geofencing) { + toSerialize["geofencing"] = o.Geofencing + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + if !IsNil(o.LogSink) { + toSerialize["logSink"] = o.LogSink + } + if !IsNil(o.MonthlyLimitBytes) { + toSerialize["monthlyLimitBytes"] = o.MonthlyLimitBytes + } + if !IsNil(o.Optimizer) { + toSerialize["optimizer"] = o.Optimizer + } + if !IsNil(o.OriginRequestHeaders) { + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + } + toSerialize["originUrl"] = o.OriginUrl + toSerialize["regions"] = o.Regions + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +func (o *CreateDistributionPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "originUrl", + "regions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDistributionPayload := _CreateDistributionPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDistributionPayload) + + if err != nil { + return err + } + + *o = CreateDistributionPayload(varCreateDistributionPayload) + + return err +} + +type NullableCreateDistributionPayload struct { + value *CreateDistributionPayload + isSet bool +} + +func (v NullableCreateDistributionPayload) Get() *CreateDistributionPayload { + return v.value +} + +func (v *NullableCreateDistributionPayload) Set(val *CreateDistributionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDistributionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDistributionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDistributionPayload(val *CreateDistributionPayload) *NullableCreateDistributionPayload { + return &NullableCreateDistributionPayload{value: val, isSet: true} +} + +func (v NullableCreateDistributionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDistributionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_create_distribution_response.go b/services/cdn/v1betaapi/model_create_distribution_response.go new file mode 100644 index 000000000..7aa3b7f02 --- /dev/null +++ b/services/cdn/v1betaapi/model_create_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDistributionResponse{} + +// CreateDistributionResponse struct for CreateDistributionResponse +type CreateDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _CreateDistributionResponse CreateDistributionResponse + +// NewCreateDistributionResponse instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponse(distribution Distribution) *CreateDistributionResponse { + this := CreateDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewCreateDistributionResponseWithDefaults instantiates a new CreateDistributionResponse 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 NewCreateDistributionResponseWithDefaults() *CreateDistributionResponse { + this := CreateDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *CreateDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *CreateDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *CreateDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o CreateDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *CreateDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDistributionResponse := _CreateDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDistributionResponse) + + if err != nil { + return err + } + + *o = CreateDistributionResponse(varCreateDistributionResponse) + + return err +} + +type NullableCreateDistributionResponse struct { + value *CreateDistributionResponse + isSet bool +} + +func (v NullableCreateDistributionResponse) Get() *CreateDistributionResponse { + return v.value +} + +func (v *NullableCreateDistributionResponse) Set(val *CreateDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDistributionResponse(val *CreateDistributionResponse) *NullableCreateDistributionResponse { + return &NullableCreateDistributionResponse{value: val, isSet: true} +} + +func (v NullableCreateDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_custom_domain.go b/services/cdn/v1betaapi/model_custom_domain.go new file mode 100644 index 000000000..829caeaba --- /dev/null +++ b/services/cdn/v1betaapi/model_custom_domain.go @@ -0,0 +1,222 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CustomDomain type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CustomDomain{} + +// CustomDomain Definition of a custom domain +type CustomDomain struct { + // This object is present if the custom domain has errors. + Errors []StatusError `json:"errors,omitempty"` + // The domain. Can be used as input for the GetCustomDomain endpoint + Name string `json:"name"` + Status DomainStatus `json:"status"` +} + +type _CustomDomain CustomDomain + +// NewCustomDomain instantiates a new CustomDomain 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 NewCustomDomain(name string, status DomainStatus) *CustomDomain { + this := CustomDomain{} + this.Name = name + this.Status = status + return &this +} + +// NewCustomDomainWithDefaults instantiates a new CustomDomain 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 NewCustomDomainWithDefaults() *CustomDomain { + this := CustomDomain{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *CustomDomain) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *CustomDomain) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *CustomDomain) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetName returns the Name field value +func (o *CustomDomain) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CustomDomain) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *CustomDomain) GetStatus() DomainStatus { + if o == nil { + var ret DomainStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *CustomDomain) GetStatusOk() (*DomainStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *CustomDomain) SetStatus(v DomainStatus) { + o.Status = v +} + +func (o CustomDomain) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CustomDomain) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *CustomDomain) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCustomDomain := _CustomDomain{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCustomDomain) + + if err != nil { + return err + } + + *o = CustomDomain(varCustomDomain) + + return err +} + +type NullableCustomDomain struct { + value *CustomDomain + isSet bool +} + +func (v NullableCustomDomain) Get() *CustomDomain { + return v.value +} + +func (v *NullableCustomDomain) Set(val *CustomDomain) { + v.value = val + v.isSet = true +} + +func (v NullableCustomDomain) IsSet() bool { + return v.isSet +} + +func (v *NullableCustomDomain) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCustomDomain(val *CustomDomain) *NullableCustomDomain { + return &NullableCustomDomain{value: val, isSet: true} +} + +func (v NullableCustomDomain) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCustomDomain) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_delete_custom_domain_response.go b/services/cdn/v1betaapi/model_delete_custom_domain_response.go new file mode 100644 index 000000000..038b88ae5 --- /dev/null +++ b/services/cdn/v1betaapi/model_delete_custom_domain_response.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the DeleteCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteCustomDomainResponse{} + +// DeleteCustomDomainResponse Returns the custom domain that was deleted while the deletion has not completed yet. After the deletion was successful the response will be empty. +type DeleteCustomDomainResponse struct { + CustomDomain *CustomDomain `json:"customDomain,omitempty"` +} + +// NewDeleteCustomDomainResponse instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponse() *DeleteCustomDomainResponse { + this := DeleteCustomDomainResponse{} + return &this +} + +// NewDeleteCustomDomainResponseWithDefaults instantiates a new DeleteCustomDomainResponse 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 NewDeleteCustomDomainResponseWithDefaults() *DeleteCustomDomainResponse { + this := DeleteCustomDomainResponse{} + return &this +} + +// GetCustomDomain returns the CustomDomain field value if set, zero value otherwise. +func (o *DeleteCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil || IsNil(o.CustomDomain) { + var ret CustomDomain + return ret + } + return *o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil || IsNil(o.CustomDomain) { + return nil, false + } + return o.CustomDomain, true +} + +// HasCustomDomain returns a boolean if a field has been set. +func (o *DeleteCustomDomainResponse) HasCustomDomain() bool { + if o != nil && !IsNil(o.CustomDomain) { + return true + } + + return false +} + +// SetCustomDomain gets a reference to the given CustomDomain and assigns it to the CustomDomain field. +func (o *DeleteCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = &v +} + +func (o DeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CustomDomain) { + toSerialize["customDomain"] = o.CustomDomain + } + return toSerialize, nil +} + +type NullableDeleteCustomDomainResponse struct { + value *DeleteCustomDomainResponse + isSet bool +} + +func (v NullableDeleteCustomDomainResponse) Get() *DeleteCustomDomainResponse { + return v.value +} + +func (v *NullableDeleteCustomDomainResponse) Set(val *DeleteCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteCustomDomainResponse(val *DeleteCustomDomainResponse) *NullableDeleteCustomDomainResponse { + return &NullableDeleteCustomDomainResponse{value: val, isSet: true} +} + +func (v NullableDeleteCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_delete_distribution_response.go b/services/cdn/v1betaapi/model_delete_distribution_response.go new file mode 100644 index 000000000..511d1b264 --- /dev/null +++ b/services/cdn/v1betaapi/model_delete_distribution_response.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the DeleteDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeleteDistributionResponse{} + +// DeleteDistributionResponse struct for DeleteDistributionResponse +type DeleteDistributionResponse struct { + Distribution *Distribution `json:"distribution,omitempty"` +} + +// NewDeleteDistributionResponse instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponse() *DeleteDistributionResponse { + this := DeleteDistributionResponse{} + return &this +} + +// NewDeleteDistributionResponseWithDefaults instantiates a new DeleteDistributionResponse 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 NewDeleteDistributionResponseWithDefaults() *DeleteDistributionResponse { + this := DeleteDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value if set, zero value otherwise. +func (o *DeleteDistributionResponse) GetDistribution() Distribution { + if o == nil || IsNil(o.Distribution) { + var ret Distribution + return ret + } + return *o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeleteDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil || IsNil(o.Distribution) { + return nil, false + } + return o.Distribution, true +} + +// HasDistribution returns a boolean if a field has been set. +func (o *DeleteDistributionResponse) HasDistribution() bool { + if o != nil && !IsNil(o.Distribution) { + return true + } + + return false +} + +// SetDistribution gets a reference to the given Distribution and assigns it to the Distribution field. +func (o *DeleteDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = &v +} + +func (o DeleteDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeleteDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Distribution) { + toSerialize["distribution"] = o.Distribution + } + return toSerialize, nil +} + +type NullableDeleteDistributionResponse struct { + value *DeleteDistributionResponse + isSet bool +} + +func (v NullableDeleteDistributionResponse) Get() *DeleteDistributionResponse { + return v.value +} + +func (v *NullableDeleteDistributionResponse) Set(val *DeleteDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDeleteDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDeleteDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeleteDistributionResponse(val *DeleteDistributionResponse) *NullableDeleteDistributionResponse { + return &NullableDeleteDistributionResponse{value: val, isSet: true} +} + +func (v NullableDeleteDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeleteDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_distribution.go b/services/cdn/v1betaapi/model_distribution.go new file mode 100644 index 000000000..5d0b1c5a2 --- /dev/null +++ b/services/cdn/v1betaapi/model_distribution.go @@ -0,0 +1,401 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Distribution type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Distribution{} + +// Distribution struct for Distribution +type Distribution struct { + Config Config `json:"config"` + // RFC3339 string defining when the distribution was created + CreatedAt time.Time `json:"createdAt"` + Domains []Domain `json:"domains"` + // This object may be present if, and only if the distribution has encountered an error state. + Errors []StatusError `json:"errors,omitempty"` + Id string `json:"id"` + ProjectId string `json:"projectId"` + // - `CREATING`: The distribution was just created. All the relevant resources are created in the background. Once fully reconciled, this switches to `ACTIVE`. If there are any issues, the status changes to `ERROR`. You can look at the `errors` array to get more infos. - `ACTIVE`: The usual state. The desired configuration is synced, there are no errors - `UPDATING`: The state when there is a discrepancy between the desired and actual configuration state. This occurs right after an update. Will switch to `ACTIVE` or `ERROR`, depending on if synchronizing succeeds or not. - `DELETING`: The state right after a delete request was received. The distribution will stay in this status until all resources have been successfully removed, or until we encounter an `ERROR` state. **NOTE:** You can keep fetching the distribution while it is deleting. After successful deletion, trying to get a distribution will return a 404 Not Found response - `ERROR`: The error state. Look at the `errors` array for more info. + Status string `json:"status"` + // RFC3339 string which returns the last time the distribution configuration was modified. + UpdatedAt time.Time `json:"updatedAt"` + Waf *DistributionWaf `json:"waf,omitempty"` +} + +type _Distribution Distribution + +// NewDistribution instantiates a new Distribution 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 NewDistribution(config Config, createdAt time.Time, domains []Domain, id string, projectId string, status string, updatedAt time.Time) *Distribution { + this := Distribution{} + this.Config = config + this.CreatedAt = createdAt + this.Domains = domains + this.Id = id + this.ProjectId = projectId + this.Status = status + this.UpdatedAt = updatedAt + return &this +} + +// NewDistributionWithDefaults instantiates a new Distribution 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 NewDistributionWithDefaults() *Distribution { + this := Distribution{} + return &this +} + +// GetConfig returns the Config field value +func (o *Distribution) GetConfig() Config { + if o == nil { + var ret Config + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetConfigOk() (*Config, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *Distribution) SetConfig(v Config) { + o.Config = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Distribution) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Distribution) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetDomains returns the Domains field value +func (o *Distribution) GetDomains() []Domain { + if o == nil { + var ret []Domain + return ret + } + + return o.Domains +} + +// GetDomainsOk returns a tuple with the Domains field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetDomainsOk() ([]Domain, bool) { + if o == nil { + return nil, false + } + return o.Domains, true +} + +// SetDomains sets field value +func (o *Distribution) SetDomains(v []Domain) { + o.Domains = v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Distribution) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Distribution) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Distribution) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *Distribution) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetId returns the Id field value +func (o *Distribution) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Distribution) SetId(v string) { + o.Id = v +} + +// GetProjectId returns the ProjectId field value +func (o *Distribution) GetProjectId() string { + if o == nil { + var ret string + return ret + } + + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value +func (o *Distribution) SetProjectId(v string) { + o.ProjectId = v +} + +// GetStatus returns the Status field value +func (o *Distribution) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Distribution) SetStatus(v string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value +func (o *Distribution) GetUpdatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value +// and a boolean to check if the value has been set. +func (o *Distribution) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedAt, true +} + +// SetUpdatedAt sets field value +func (o *Distribution) SetUpdatedAt(v time.Time) { + o.UpdatedAt = v +} + +// GetWaf returns the Waf field value if set, zero value otherwise. +func (o *Distribution) GetWaf() DistributionWaf { + if o == nil || IsNil(o.Waf) { + var ret DistributionWaf + return ret + } + return *o.Waf +} + +// GetWafOk returns a tuple with the Waf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Distribution) GetWafOk() (*DistributionWaf, bool) { + if o == nil || IsNil(o.Waf) { + return nil, false + } + return o.Waf, true +} + +// HasWaf returns a boolean if a field has been set. +func (o *Distribution) HasWaf() bool { + if o != nil && !IsNil(o.Waf) { + return true + } + + return false +} + +// SetWaf gets a reference to the given DistributionWaf and assigns it to the Waf field. +func (o *Distribution) SetWaf(v DistributionWaf) { + o.Waf = &v +} + +func (o Distribution) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Distribution) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["config"] = o.Config + toSerialize["createdAt"] = o.CreatedAt + toSerialize["domains"] = o.Domains + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["id"] = o.Id + toSerialize["projectId"] = o.ProjectId + toSerialize["status"] = o.Status + toSerialize["updatedAt"] = o.UpdatedAt + if !IsNil(o.Waf) { + toSerialize["waf"] = o.Waf + } + return toSerialize, nil +} + +func (o *Distribution) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "config", + "createdAt", + "domains", + "id", + "projectId", + "status", + "updatedAt", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistribution := _Distribution{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistribution) + + if err != nil { + return err + } + + *o = Distribution(varDistribution) + + return err +} + +type NullableDistribution struct { + value *Distribution + isSet bool +} + +func (v NullableDistribution) Get() *Distribution { + return v.value +} + +func (v *NullableDistribution) Set(val *Distribution) { + v.value = val + v.isSet = true +} + +func (v NullableDistribution) IsSet() bool { + return v.isSet +} + +func (v *NullableDistribution) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistribution(val *Distribution) *NullableDistribution { + return &NullableDistribution{value: val, isSet: true} +} + +func (v NullableDistribution) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistribution) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_distribution_logs_record.go b/services/cdn/v1betaapi/model_distribution_logs_record.go new file mode 100644 index 000000000..c3b9466c0 --- /dev/null +++ b/services/cdn/v1betaapi/model_distribution_logs_record.go @@ -0,0 +1,418 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the DistributionLogsRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionLogsRecord{} + +// DistributionLogsRecord struct for DistributionLogsRecord +type DistributionLogsRecord struct { + CacheHit bool `json:"cacheHit"` + DataCenterRegion string `json:"dataCenterRegion"` + DistributionID string `json:"distributionID"` + Host string `json:"host"` + Path string `json:"path"` + // ISO 3166-1 A2 compliant country code + RequestCountryCode string `json:"requestCountryCode"` + Size int64 `json:"size"` + StatusCode int32 `json:"statusCode"` + Timestamp time.Time `json:"timestamp"` + WafViolation *WAFViolation `json:"wafViolation,omitempty"` +} + +type _DistributionLogsRecord DistributionLogsRecord + +// NewDistributionLogsRecord instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecord(cacheHit bool, dataCenterRegion string, distributionID string, host string, path string, requestCountryCode string, size int64, statusCode int32, timestamp time.Time) *DistributionLogsRecord { + this := DistributionLogsRecord{} + this.CacheHit = cacheHit + this.DataCenterRegion = dataCenterRegion + this.DistributionID = distributionID + this.Host = host + this.Path = path + this.RequestCountryCode = requestCountryCode + this.Size = size + this.StatusCode = statusCode + this.Timestamp = timestamp + return &this +} + +// NewDistributionLogsRecordWithDefaults instantiates a new DistributionLogsRecord 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 NewDistributionLogsRecordWithDefaults() *DistributionLogsRecord { + this := DistributionLogsRecord{} + return &this +} + +// GetCacheHit returns the CacheHit field value +func (o *DistributionLogsRecord) GetCacheHit() bool { + if o == nil { + var ret bool + return ret + } + + return o.CacheHit +} + +// GetCacheHitOk returns a tuple with the CacheHit field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetCacheHitOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CacheHit, true +} + +// SetCacheHit sets field value +func (o *DistributionLogsRecord) SetCacheHit(v bool) { + o.CacheHit = v +} + +// GetDataCenterRegion returns the DataCenterRegion field value +func (o *DistributionLogsRecord) GetDataCenterRegion() string { + if o == nil { + var ret string + return ret + } + + return o.DataCenterRegion +} + +// GetDataCenterRegionOk returns a tuple with the DataCenterRegion field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetDataCenterRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DataCenterRegion, true +} + +// SetDataCenterRegion sets field value +func (o *DistributionLogsRecord) SetDataCenterRegion(v string) { + o.DataCenterRegion = v +} + +// GetDistributionID returns the DistributionID field value +func (o *DistributionLogsRecord) GetDistributionID() string { + if o == nil { + var ret string + return ret + } + + return o.DistributionID +} + +// GetDistributionIDOk returns a tuple with the DistributionID field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetDistributionIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DistributionID, true +} + +// SetDistributionID sets field value +func (o *DistributionLogsRecord) SetDistributionID(v string) { + o.DistributionID = v +} + +// GetHost returns the Host field value +func (o *DistributionLogsRecord) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *DistributionLogsRecord) SetHost(v string) { + o.Host = v +} + +// GetPath returns the Path field value +func (o *DistributionLogsRecord) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *DistributionLogsRecord) SetPath(v string) { + o.Path = v +} + +// GetRequestCountryCode returns the RequestCountryCode field value +func (o *DistributionLogsRecord) GetRequestCountryCode() string { + if o == nil { + var ret string + return ret + } + + return o.RequestCountryCode +} + +// GetRequestCountryCodeOk returns a tuple with the RequestCountryCode field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetRequestCountryCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestCountryCode, true +} + +// SetRequestCountryCode sets field value +func (o *DistributionLogsRecord) SetRequestCountryCode(v string) { + o.RequestCountryCode = v +} + +// GetSize returns the Size field value +func (o *DistributionLogsRecord) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *DistributionLogsRecord) SetSize(v int64) { + o.Size = v +} + +// GetStatusCode returns the StatusCode field value +func (o *DistributionLogsRecord) GetStatusCode() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetStatusCodeOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.StatusCode, true +} + +// SetStatusCode sets field value +func (o *DistributionLogsRecord) SetStatusCode(v int32) { + o.StatusCode = v +} + +// GetTimestamp returns the Timestamp field value +func (o *DistributionLogsRecord) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *DistributionLogsRecord) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +// GetWafViolation returns the WafViolation field value if set, zero value otherwise. +func (o *DistributionLogsRecord) GetWafViolation() WAFViolation { + if o == nil || IsNil(o.WafViolation) { + var ret WAFViolation + return ret + } + return *o.WafViolation +} + +// GetWafViolationOk returns a tuple with the WafViolation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetWafViolationOk() (*WAFViolation, bool) { + if o == nil || IsNil(o.WafViolation) { + return nil, false + } + return o.WafViolation, true +} + +// HasWafViolation returns a boolean if a field has been set. +func (o *DistributionLogsRecord) HasWafViolation() bool { + if o != nil && !IsNil(o.WafViolation) { + return true + } + + return false +} + +// SetWafViolation gets a reference to the given WAFViolation and assigns it to the WafViolation field. +func (o *DistributionLogsRecord) SetWafViolation(v WAFViolation) { + o.WafViolation = &v +} + +func (o DistributionLogsRecord) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionLogsRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cacheHit"] = o.CacheHit + toSerialize["dataCenterRegion"] = o.DataCenterRegion + toSerialize["distributionID"] = o.DistributionID + toSerialize["host"] = o.Host + toSerialize["path"] = o.Path + toSerialize["requestCountryCode"] = o.RequestCountryCode + toSerialize["size"] = o.Size + toSerialize["statusCode"] = o.StatusCode + toSerialize["timestamp"] = o.Timestamp + if !IsNil(o.WafViolation) { + toSerialize["wafViolation"] = o.WafViolation + } + return toSerialize, nil +} + +func (o *DistributionLogsRecord) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cacheHit", + "dataCenterRegion", + "distributionID", + "host", + "path", + "requestCountryCode", + "size", + "statusCode", + "timestamp", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionLogsRecord := _DistributionLogsRecord{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionLogsRecord) + + if err != nil { + return err + } + + *o = DistributionLogsRecord(varDistributionLogsRecord) + + return err +} + +type NullableDistributionLogsRecord struct { + value *DistributionLogsRecord + isSet bool +} + +func (v NullableDistributionLogsRecord) Get() *DistributionLogsRecord { + return v.value +} + +func (v *NullableDistributionLogsRecord) Set(val *DistributionLogsRecord) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionLogsRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionLogsRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionLogsRecord(val *DistributionLogsRecord) *NullableDistributionLogsRecord { + return &NullableDistributionLogsRecord{value: val, isSet: true} +} + +func (v NullableDistributionLogsRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionLogsRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_distribution_statistics_record.go b/services/cdn/v1betaapi/model_distribution_statistics_record.go new file mode 100644 index 000000000..5d902fa2a --- /dev/null +++ b/services/cdn/v1betaapi/model_distribution_statistics_record.go @@ -0,0 +1,302 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the DistributionStatisticsRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecord{} + +// DistributionStatisticsRecord Aggregated statistics of a distribution during a time interval +type DistributionStatisticsRecord struct { + // Number of cached requests that were served + CachedRequests int64 `json:"cachedRequests"` + // Total number of requests that were served + TotalRequests int64 `json:"totalRequests"` + // Total traffic in bytes that occurred during the time interval + TotalTrafficBytes int64 `json:"totalTrafficBytes"` + // Exclusive end of the time interval the statistics refer to + End time.Time `json:"end"` + Regions DistributionStatisticsRecordRegions `json:"regions"` + // Start of the time interval the statistics refer to + Start time.Time `json:"start"` +} + +type _DistributionStatisticsRecord DistributionStatisticsRecord + +// NewDistributionStatisticsRecord instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecord(cachedRequests int64, totalRequests int64, totalTrafficBytes int64, end time.Time, regions DistributionStatisticsRecordRegions, start time.Time) *DistributionStatisticsRecord { + this := DistributionStatisticsRecord{} + this.CachedRequests = cachedRequests + this.TotalRequests = totalRequests + this.TotalTrafficBytes = totalTrafficBytes + this.End = end + this.Regions = regions + this.Start = start + return &this +} + +// NewDistributionStatisticsRecordWithDefaults instantiates a new DistributionStatisticsRecord 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 NewDistributionStatisticsRecordWithDefaults() *DistributionStatisticsRecord { + this := DistributionStatisticsRecord{} + return &this +} + +// GetCachedRequests returns the CachedRequests field value +func (o *DistributionStatisticsRecord) GetCachedRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.CachedRequests +} + +// GetCachedRequestsOk returns a tuple with the CachedRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetCachedRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.CachedRequests, true +} + +// SetCachedRequests sets field value +func (o *DistributionStatisticsRecord) SetCachedRequests(v int64) { + o.CachedRequests = v +} + +// GetTotalRequests returns the TotalRequests field value +func (o *DistributionStatisticsRecord) GetTotalRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalRequests +} + +// GetTotalRequestsOk returns a tuple with the TotalRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetTotalRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequests, true +} + +// SetTotalRequests sets field value +func (o *DistributionStatisticsRecord) SetTotalRequests(v int64) { + o.TotalRequests = v +} + +// GetTotalTrafficBytes returns the TotalTrafficBytes field value +func (o *DistributionStatisticsRecord) GetTotalTrafficBytes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalTrafficBytes +} + +// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetTotalTrafficBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalTrafficBytes, true +} + +// SetTotalTrafficBytes sets field value +func (o *DistributionStatisticsRecord) SetTotalTrafficBytes(v int64) { + o.TotalTrafficBytes = v +} + +// GetEnd returns the End field value +func (o *DistributionStatisticsRecord) GetEnd() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.End +} + +// GetEndOk returns a tuple with the End field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetEndOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.End, true +} + +// SetEnd sets field value +func (o *DistributionStatisticsRecord) SetEnd(v time.Time) { + o.End = v +} + +// GetRegions returns the Regions field value +func (o *DistributionStatisticsRecord) GetRegions() DistributionStatisticsRecordRegions { + if o == nil { + var ret DistributionStatisticsRecordRegions + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetRegionsOk() (*DistributionStatisticsRecordRegions, bool) { + if o == nil { + return nil, false + } + return &o.Regions, true +} + +// SetRegions sets field value +func (o *DistributionStatisticsRecord) SetRegions(v DistributionStatisticsRecordRegions) { + o.Regions = v +} + +// GetStart returns the Start field value +func (o *DistributionStatisticsRecord) GetStart() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Start +} + +// GetStartOk returns a tuple with the Start field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecord) GetStartOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Start, true +} + +// SetStart sets field value +func (o *DistributionStatisticsRecord) SetStart(v time.Time) { + o.Start = v +} + +func (o DistributionStatisticsRecord) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cachedRequests"] = o.CachedRequests + toSerialize["totalRequests"] = o.TotalRequests + toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes + toSerialize["end"] = o.End + toSerialize["regions"] = o.Regions + toSerialize["start"] = o.Start + return toSerialize, nil +} + +func (o *DistributionStatisticsRecord) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cachedRequests", + "totalRequests", + "totalTrafficBytes", + "end", + "regions", + "start", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecord := _DistributionStatisticsRecord{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecord) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecord(varDistributionStatisticsRecord) + + return err +} + +type NullableDistributionStatisticsRecord struct { + value *DistributionStatisticsRecord + isSet bool +} + +func (v NullableDistributionStatisticsRecord) Get() *DistributionStatisticsRecord { + return v.value +} + +func (v *NullableDistributionStatisticsRecord) Set(val *DistributionStatisticsRecord) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecord) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecord) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecord(val *DistributionStatisticsRecord) *NullableDistributionStatisticsRecord { + return &NullableDistributionStatisticsRecord{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecord) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecord) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_distribution_statistics_record_entry.go b/services/cdn/v1betaapi/model_distribution_statistics_record_entry.go new file mode 100644 index 000000000..c9a1ce1a5 --- /dev/null +++ b/services/cdn/v1betaapi/model_distribution_statistics_record_entry.go @@ -0,0 +1,215 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionStatisticsRecordEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecordEntry{} + +// DistributionStatisticsRecordEntry struct for DistributionStatisticsRecordEntry +type DistributionStatisticsRecordEntry struct { + // Number of cached requests that were served + CachedRequests int64 `json:"cachedRequests"` + // Total number of requests that were served + TotalRequests int64 `json:"totalRequests"` + // Total traffic in bytes that occurred during the time interval + TotalTrafficBytes int64 `json:"totalTrafficBytes"` +} + +type _DistributionStatisticsRecordEntry DistributionStatisticsRecordEntry + +// NewDistributionStatisticsRecordEntry instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntry(cachedRequests int64, totalRequests int64, totalTrafficBytes int64) *DistributionStatisticsRecordEntry { + this := DistributionStatisticsRecordEntry{} + this.CachedRequests = cachedRequests + this.TotalRequests = totalRequests + this.TotalTrafficBytes = totalTrafficBytes + return &this +} + +// NewDistributionStatisticsRecordEntryWithDefaults instantiates a new DistributionStatisticsRecordEntry 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 NewDistributionStatisticsRecordEntryWithDefaults() *DistributionStatisticsRecordEntry { + this := DistributionStatisticsRecordEntry{} + return &this +} + +// GetCachedRequests returns the CachedRequests field value +func (o *DistributionStatisticsRecordEntry) GetCachedRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.CachedRequests +} + +// GetCachedRequestsOk returns a tuple with the CachedRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetCachedRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.CachedRequests, true +} + +// SetCachedRequests sets field value +func (o *DistributionStatisticsRecordEntry) SetCachedRequests(v int64) { + o.CachedRequests = v +} + +// GetTotalRequests returns the TotalRequests field value +func (o *DistributionStatisticsRecordEntry) GetTotalRequests() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalRequests +} + +// GetTotalRequestsOk returns a tuple with the TotalRequests field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetTotalRequestsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalRequests, true +} + +// SetTotalRequests sets field value +func (o *DistributionStatisticsRecordEntry) SetTotalRequests(v int64) { + o.TotalRequests = v +} + +// GetTotalTrafficBytes returns the TotalTrafficBytes field value +func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytes() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.TotalTrafficBytes +} + +// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytesOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.TotalTrafficBytes, true +} + +// SetTotalTrafficBytes sets field value +func (o *DistributionStatisticsRecordEntry) SetTotalTrafficBytes(v int64) { + o.TotalTrafficBytes = v +} + +func (o DistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecordEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cachedRequests"] = o.CachedRequests + toSerialize["totalRequests"] = o.TotalRequests + toSerialize["totalTrafficBytes"] = o.TotalTrafficBytes + return toSerialize, nil +} + +func (o *DistributionStatisticsRecordEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cachedRequests", + "totalRequests", + "totalTrafficBytes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecordEntry := _DistributionStatisticsRecordEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecordEntry) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecordEntry(varDistributionStatisticsRecordEntry) + + return err +} + +type NullableDistributionStatisticsRecordEntry struct { + value *DistributionStatisticsRecordEntry + isSet bool +} + +func (v NullableDistributionStatisticsRecordEntry) Get() *DistributionStatisticsRecordEntry { + return v.value +} + +func (v *NullableDistributionStatisticsRecordEntry) Set(val *DistributionStatisticsRecordEntry) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecordEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecordEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecordEntry(val *DistributionStatisticsRecordEntry) *NullableDistributionStatisticsRecordEntry { + return &NullableDistributionStatisticsRecordEntry{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecordEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecordEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_distribution_statistics_record_regions.go b/services/cdn/v1betaapi/model_distribution_statistics_record_regions.go new file mode 100644 index 000000000..d40356000 --- /dev/null +++ b/services/cdn/v1betaapi/model_distribution_statistics_record_regions.go @@ -0,0 +1,268 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionStatisticsRecordRegions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionStatisticsRecordRegions{} + +// DistributionStatisticsRecordRegions Mapping of regions to the metrics for this region for the defined time interval All regions are always present. If no traffic was reported for a region, it will still contain 0-filled properties +type DistributionStatisticsRecordRegions struct { + AF DistributionStatisticsRecordEntry `json:"AF"` + ASIA DistributionStatisticsRecordEntry `json:"ASIA"` + EU DistributionStatisticsRecordEntry `json:"EU"` + SA DistributionStatisticsRecordEntry `json:"SA"` + US DistributionStatisticsRecordEntry `json:"US"` +} + +type _DistributionStatisticsRecordRegions DistributionStatisticsRecordRegions + +// NewDistributionStatisticsRecordRegions instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegions(aF DistributionStatisticsRecordEntry, aSIA DistributionStatisticsRecordEntry, eU DistributionStatisticsRecordEntry, sA DistributionStatisticsRecordEntry, uS DistributionStatisticsRecordEntry) *DistributionStatisticsRecordRegions { + this := DistributionStatisticsRecordRegions{} + this.AF = aF + this.ASIA = aSIA + this.EU = eU + this.SA = sA + this.US = uS + return &this +} + +// NewDistributionStatisticsRecordRegionsWithDefaults instantiates a new DistributionStatisticsRecordRegions 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 NewDistributionStatisticsRecordRegionsWithDefaults() *DistributionStatisticsRecordRegions { + this := DistributionStatisticsRecordRegions{} + return &this +} + +// GetAF returns the AF field value +func (o *DistributionStatisticsRecordRegions) GetAF() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.AF +} + +// GetAFOk returns a tuple with the AF field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetAFOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.AF, true +} + +// SetAF sets field value +func (o *DistributionStatisticsRecordRegions) SetAF(v DistributionStatisticsRecordEntry) { + o.AF = v +} + +// GetASIA returns the ASIA field value +func (o *DistributionStatisticsRecordRegions) GetASIA() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.ASIA +} + +// GetASIAOk returns a tuple with the ASIA field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetASIAOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.ASIA, true +} + +// SetASIA sets field value +func (o *DistributionStatisticsRecordRegions) SetASIA(v DistributionStatisticsRecordEntry) { + o.ASIA = v +} + +// GetEU returns the EU field value +func (o *DistributionStatisticsRecordRegions) GetEU() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.EU +} + +// GetEUOk returns a tuple with the EU field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetEUOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.EU, true +} + +// SetEU sets field value +func (o *DistributionStatisticsRecordRegions) SetEU(v DistributionStatisticsRecordEntry) { + o.EU = v +} + +// GetSA returns the SA field value +func (o *DistributionStatisticsRecordRegions) GetSA() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.SA +} + +// GetSAOk returns a tuple with the SA field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetSAOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.SA, true +} + +// SetSA sets field value +func (o *DistributionStatisticsRecordRegions) SetSA(v DistributionStatisticsRecordEntry) { + o.SA = v +} + +// GetUS returns the US field value +func (o *DistributionStatisticsRecordRegions) GetUS() DistributionStatisticsRecordEntry { + if o == nil { + var ret DistributionStatisticsRecordEntry + return ret + } + + return o.US +} + +// GetUSOk returns a tuple with the US field value +// and a boolean to check if the value has been set. +func (o *DistributionStatisticsRecordRegions) GetUSOk() (*DistributionStatisticsRecordEntry, bool) { + if o == nil { + return nil, false + } + return &o.US, true +} + +// SetUS sets field value +func (o *DistributionStatisticsRecordRegions) SetUS(v DistributionStatisticsRecordEntry) { + o.US = v +} + +func (o DistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionStatisticsRecordRegions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["AF"] = o.AF + toSerialize["ASIA"] = o.ASIA + toSerialize["EU"] = o.EU + toSerialize["SA"] = o.SA + toSerialize["US"] = o.US + return toSerialize, nil +} + +func (o *DistributionStatisticsRecordRegions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "AF", + "ASIA", + "EU", + "SA", + "US", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionStatisticsRecordRegions := _DistributionStatisticsRecordRegions{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionStatisticsRecordRegions) + + if err != nil { + return err + } + + *o = DistributionStatisticsRecordRegions(varDistributionStatisticsRecordRegions) + + return err +} + +type NullableDistributionStatisticsRecordRegions struct { + value *DistributionStatisticsRecordRegions + isSet bool +} + +func (v NullableDistributionStatisticsRecordRegions) Get() *DistributionStatisticsRecordRegions { + return v.value +} + +func (v *NullableDistributionStatisticsRecordRegions) Set(val *DistributionStatisticsRecordRegions) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionStatisticsRecordRegions) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionStatisticsRecordRegions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionStatisticsRecordRegions(val *DistributionStatisticsRecordRegions) *NullableDistributionStatisticsRecordRegions { + return &NullableDistributionStatisticsRecordRegions{value: val, isSet: true} +} + +func (v NullableDistributionStatisticsRecordRegions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionStatisticsRecordRegions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_distribution_waf.go b/services/cdn/v1betaapi/model_distribution_waf.go new file mode 100644 index 000000000..5f9fb7c8a --- /dev/null +++ b/services/cdn/v1betaapi/model_distribution_waf.go @@ -0,0 +1,212 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DistributionWaf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionWaf{} + +// DistributionWaf For this property to be present two pre-conditions must be met: - the WAF was enabled at least once - the query parameter ?withWafStatus is truthy This property contains the waf Status. At this point in time, this contains all resolved rules. Rules are split into 3 groups: - enabledRules - logOnlyRules - disabledRules **Do note that the global waf mode (Disabled, LogOnly, Enabled) is *NOT* reflected in this list!** +type DistributionWaf struct { + DisabledRules []WAFStatusRuleBlock `json:"disabledRules"` + EnabledRules []WAFStatusRuleBlock `json:"enabledRules"` + LogOnlyRules []WAFStatusRuleBlock `json:"logOnlyRules"` +} + +type _DistributionWaf DistributionWaf + +// NewDistributionWaf instantiates a new DistributionWaf 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 NewDistributionWaf(disabledRules []WAFStatusRuleBlock, enabledRules []WAFStatusRuleBlock, logOnlyRules []WAFStatusRuleBlock) *DistributionWaf { + this := DistributionWaf{} + this.DisabledRules = disabledRules + this.EnabledRules = enabledRules + this.LogOnlyRules = logOnlyRules + return &this +} + +// NewDistributionWafWithDefaults instantiates a new DistributionWaf 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 NewDistributionWafWithDefaults() *DistributionWaf { + this := DistributionWaf{} + return &this +} + +// GetDisabledRules returns the DisabledRules field value +func (o *DistributionWaf) GetDisabledRules() []WAFStatusRuleBlock { + if o == nil { + var ret []WAFStatusRuleBlock + return ret + } + + return o.DisabledRules +} + +// GetDisabledRulesOk returns a tuple with the DisabledRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetDisabledRulesOk() ([]WAFStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.DisabledRules, true +} + +// SetDisabledRules sets field value +func (o *DistributionWaf) SetDisabledRules(v []WAFStatusRuleBlock) { + o.DisabledRules = v +} + +// GetEnabledRules returns the EnabledRules field value +func (o *DistributionWaf) GetEnabledRules() []WAFStatusRuleBlock { + if o == nil { + var ret []WAFStatusRuleBlock + return ret + } + + return o.EnabledRules +} + +// GetEnabledRulesOk returns a tuple with the EnabledRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetEnabledRulesOk() ([]WAFStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.EnabledRules, true +} + +// SetEnabledRules sets field value +func (o *DistributionWaf) SetEnabledRules(v []WAFStatusRuleBlock) { + o.EnabledRules = v +} + +// GetLogOnlyRules returns the LogOnlyRules field value +func (o *DistributionWaf) GetLogOnlyRules() []WAFStatusRuleBlock { + if o == nil { + var ret []WAFStatusRuleBlock + return ret + } + + return o.LogOnlyRules +} + +// GetLogOnlyRulesOk returns a tuple with the LogOnlyRules field value +// and a boolean to check if the value has been set. +func (o *DistributionWaf) GetLogOnlyRulesOk() ([]WAFStatusRuleBlock, bool) { + if o == nil { + return nil, false + } + return o.LogOnlyRules, true +} + +// SetLogOnlyRules sets field value +func (o *DistributionWaf) SetLogOnlyRules(v []WAFStatusRuleBlock) { + o.LogOnlyRules = v +} + +func (o DistributionWaf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DistributionWaf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["disabledRules"] = o.DisabledRules + toSerialize["enabledRules"] = o.EnabledRules + toSerialize["logOnlyRules"] = o.LogOnlyRules + return toSerialize, nil +} + +func (o *DistributionWaf) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "disabledRules", + "enabledRules", + "logOnlyRules", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDistributionWaf := _DistributionWaf{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDistributionWaf) + + if err != nil { + return err + } + + *o = DistributionWaf(varDistributionWaf) + + return err +} + +type NullableDistributionWaf struct { + value *DistributionWaf + isSet bool +} + +func (v NullableDistributionWaf) Get() *DistributionWaf { + return v.value +} + +func (v *NullableDistributionWaf) Set(val *DistributionWaf) { + v.value = val + v.isSet = true +} + +func (v NullableDistributionWaf) IsSet() bool { + return v.isSet +} + +func (v *NullableDistributionWaf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDistributionWaf(val *DistributionWaf) *NullableDistributionWaf { + return &NullableDistributionWaf{value: val, isSet: true} +} + +func (v NullableDistributionWaf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDistributionWaf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_domain.go b/services/cdn/v1betaapi/model_domain.go new file mode 100644 index 000000000..d3ae5ae17 --- /dev/null +++ b/services/cdn/v1betaapi/model_domain.go @@ -0,0 +1,251 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Domain type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Domain{} + +// Domain Definition of a custom or managed domain without any certificates or keys +type Domain struct { + // This object is present if the custom domain has errors. + Errors []StatusError `json:"errors,omitempty"` + // The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint + Name string `json:"name"` + Status DomainStatus `json:"status"` + // Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint + Type string `json:"type"` +} + +type _Domain Domain + +// NewDomain instantiates a new Domain 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 NewDomain(name string, status DomainStatus, types string) *Domain { + this := Domain{} + this.Name = name + this.Status = status + this.Type = types + return &this +} + +// NewDomainWithDefaults instantiates a new Domain 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 NewDomainWithDefaults() *Domain { + this := Domain{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *Domain) GetErrors() []StatusError { + if o == nil || IsNil(o.Errors) { + var ret []StatusError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Domain) GetErrorsOk() ([]StatusError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *Domain) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []StatusError and assigns it to the Errors field. +func (o *Domain) SetErrors(v []StatusError) { + o.Errors = v +} + +// GetName returns the Name field value +func (o *Domain) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Domain) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Domain) SetName(v string) { + o.Name = v +} + +// GetStatus returns the Status field value +func (o *Domain) GetStatus() DomainStatus { + if o == nil { + var ret DomainStatus + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Domain) GetStatusOk() (*DomainStatus, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Domain) SetStatus(v DomainStatus) { + o.Status = v +} + +// GetType returns the Type field value +func (o *Domain) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Domain) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Domain) SetType(v string) { + o.Type = v +} + +func (o Domain) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Domain) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + toSerialize["name"] = o.Name + toSerialize["status"] = o.Status + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *Domain) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "status", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDomain := _Domain{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDomain) + + if err != nil { + return err + } + + *o = Domain(varDomain) + + return err +} + +type NullableDomain struct { + value *Domain + isSet bool +} + +func (v NullableDomain) Get() *Domain { + return v.value +} + +func (v *NullableDomain) Set(val *Domain) { + v.value = val + v.isSet = true +} + +func (v NullableDomain) IsSet() bool { + return v.isSet +} + +func (v *NullableDomain) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomain(val *Domain) *NullableDomain { + return &NullableDomain{value: val, isSet: true} +} + +func (v NullableDomain) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomain) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_domain_status.go b/services/cdn/v1betaapi/model_domain_status.go new file mode 100644 index 000000000..d7a289261 --- /dev/null +++ b/services/cdn/v1betaapi/model_domain_status.go @@ -0,0 +1,116 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// DomainStatus The status of the domain: CREATING indicates that the custom domain is being set up. UPDATING means that requested changes are being applied to the custom domain. ACTIVE means the custom domain is currently configured and active. DELETING means that the domain is in the process of being removed from the distribution. In case the domain has the ERROR state, more information will be available in the errors list. +type DomainStatus string + +// List of DomainStatus +const ( + DOMAINSTATUS_CREATING DomainStatus = "CREATING" + DOMAINSTATUS_ACTIVE DomainStatus = "ACTIVE" + DOMAINSTATUS_UPDATING DomainStatus = "UPDATING" + DOMAINSTATUS_DELETING DomainStatus = "DELETING" + DOMAINSTATUS_ERROR DomainStatus = "ERROR" +) + +// All allowed values of DomainStatus enum +var AllowedDomainStatusEnumValues = []DomainStatus{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "ERROR", +} + +func (v *DomainStatus) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DomainStatus(value) + for _, existing := range AllowedDomainStatusEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DomainStatus", value) +} + +// NewDomainStatusFromValue returns a pointer to a valid DomainStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDomainStatusFromValue(v string) (*DomainStatus, error) { + ev := DomainStatus(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DomainStatus: valid values are %v", v, AllowedDomainStatusEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DomainStatus) IsValid() bool { + for _, existing := range AllowedDomainStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DomainStatus value +func (v DomainStatus) Ptr() *DomainStatus { + return &v +} + +type NullableDomainStatus struct { + value *DomainStatus + isSet bool +} + +func (v NullableDomainStatus) Get() *DomainStatus { + return v.value +} + +func (v *NullableDomainStatus) Set(val *DomainStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDomainStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainStatus(val *DomainStatus) *NullableDomainStatus { + return &NullableDomainStatus{value: val, isSet: true} +} + +func (v NullableDomainStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_error_details.go b/services/cdn/v1betaapi/model_error_details.go new file mode 100644 index 000000000..356bbe7ec --- /dev/null +++ b/services/cdn/v1betaapi/model_error_details.go @@ -0,0 +1,291 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ErrorDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorDetails{} + +// ErrorDetails struct for ErrorDetails +type ErrorDetails struct { + // German description of the error + De *string `json:"de,omitempty"` + // Deprecated + Description string `json:"description"` + // English description of the error + En string `json:"en"` + // Optional field in the request this error detail refers to + Field *string `json:"field,omitempty"` + Key string `json:"key"` +} + +type _ErrorDetails ErrorDetails + +// NewErrorDetails instantiates a new ErrorDetails 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 NewErrorDetails(description string, en string, key string) *ErrorDetails { + this := ErrorDetails{} + this.Description = description + this.En = en + this.Key = key + return &this +} + +// NewErrorDetailsWithDefaults instantiates a new ErrorDetails 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 NewErrorDetailsWithDefaults() *ErrorDetails { + this := ErrorDetails{} + return &this +} + +// GetDe returns the De field value if set, zero value otherwise. +func (o *ErrorDetails) GetDe() string { + if o == nil || IsNil(o.De) { + var ret string + return ret + } + return *o.De +} + +// GetDeOk returns a tuple with the De field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetDeOk() (*string, bool) { + if o == nil || IsNil(o.De) { + return nil, false + } + return o.De, true +} + +// HasDe returns a boolean if a field has been set. +func (o *ErrorDetails) HasDe() bool { + if o != nil && !IsNil(o.De) { + return true + } + + return false +} + +// SetDe gets a reference to the given string and assigns it to the De field. +func (o *ErrorDetails) SetDe(v string) { + o.De = &v +} + +// GetDescription returns the Description field value +// Deprecated +func (o *ErrorDetails) 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. +// Deprecated +func (o *ErrorDetails) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +// Deprecated +func (o *ErrorDetails) SetDescription(v string) { + o.Description = v +} + +// GetEn returns the En field value +func (o *ErrorDetails) GetEn() string { + if o == nil { + var ret string + return ret + } + + return o.En +} + +// GetEnOk returns a tuple with the En field value +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetEnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.En, true +} + +// SetEn sets field value +func (o *ErrorDetails) SetEn(v string) { + o.En = v +} + +// GetField returns the Field field value if set, zero value otherwise. +func (o *ErrorDetails) GetField() string { + if o == nil || IsNil(o.Field) { + var ret string + return ret + } + return *o.Field +} + +// GetFieldOk returns a tuple with the Field field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetFieldOk() (*string, bool) { + if o == nil || IsNil(o.Field) { + return nil, false + } + return o.Field, true +} + +// HasField returns a boolean if a field has been set. +func (o *ErrorDetails) HasField() bool { + if o != nil && !IsNil(o.Field) { + return true + } + + return false +} + +// SetField gets a reference to the given string and assigns it to the Field field. +func (o *ErrorDetails) SetField(v string) { + o.Field = &v +} + +// GetKey returns the Key field value +func (o *ErrorDetails) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *ErrorDetails) SetKey(v string) { + o.Key = v +} + +func (o ErrorDetails) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.De) { + toSerialize["de"] = o.De + } + toSerialize["description"] = o.Description + toSerialize["en"] = o.En + if !IsNil(o.Field) { + toSerialize["field"] = o.Field + } + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *ErrorDetails) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "en", + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varErrorDetails := _ErrorDetails{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varErrorDetails) + + if err != nil { + return err + } + + *o = ErrorDetails(varErrorDetails) + + return err +} + +type NullableErrorDetails struct { + value *ErrorDetails + isSet bool +} + +func (v NullableErrorDetails) Get() *ErrorDetails { + return v.value +} + +func (v *NullableErrorDetails) Set(val *ErrorDetails) { + v.value = val + v.isSet = true +} + +func (v NullableErrorDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorDetails(val *ErrorDetails) *NullableErrorDetails { + return &NullableErrorDetails{value: val, isSet: true} +} + +func (v NullableErrorDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_find_cache_paths_response.go b/services/cdn/v1betaapi/model_find_cache_paths_response.go new file mode 100644 index 000000000..7350009f1 --- /dev/null +++ b/services/cdn/v1betaapi/model_find_cache_paths_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the FindCachePathsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindCachePathsResponse{} + +// FindCachePathsResponse struct for FindCachePathsResponse +type FindCachePathsResponse struct { + Response []FindCachePathsResponseEntry `json:"response"` +} + +type _FindCachePathsResponse FindCachePathsResponse + +// NewFindCachePathsResponse instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponse(response []FindCachePathsResponseEntry) *FindCachePathsResponse { + this := FindCachePathsResponse{} + this.Response = response + return &this +} + +// NewFindCachePathsResponseWithDefaults instantiates a new FindCachePathsResponse 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 NewFindCachePathsResponseWithDefaults() *FindCachePathsResponse { + this := FindCachePathsResponse{} + return &this +} + +// GetResponse returns the Response field value +func (o *FindCachePathsResponse) GetResponse() []FindCachePathsResponseEntry { + if o == nil { + var ret []FindCachePathsResponseEntry + return ret + } + + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value +// and a boolean to check if the value has been set. +func (o *FindCachePathsResponse) GetResponseOk() ([]FindCachePathsResponseEntry, bool) { + if o == nil { + return nil, false + } + return o.Response, true +} + +// SetResponse sets field value +func (o *FindCachePathsResponse) SetResponse(v []FindCachePathsResponseEntry) { + o.Response = v +} + +func (o FindCachePathsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindCachePathsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["response"] = o.Response + return toSerialize, nil +} + +func (o *FindCachePathsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "response", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFindCachePathsResponse := _FindCachePathsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFindCachePathsResponse) + + if err != nil { + return err + } + + *o = FindCachePathsResponse(varFindCachePathsResponse) + + return err +} + +type NullableFindCachePathsResponse struct { + value *FindCachePathsResponse + isSet bool +} + +func (v NullableFindCachePathsResponse) Get() *FindCachePathsResponse { + return v.value +} + +func (v *NullableFindCachePathsResponse) Set(val *FindCachePathsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableFindCachePathsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableFindCachePathsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindCachePathsResponse(val *FindCachePathsResponse) *NullableFindCachePathsResponse { + return &NullableFindCachePathsResponse{value: val, isSet: true} +} + +func (v NullableFindCachePathsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindCachePathsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_find_cache_paths_response_entry.go b/services/cdn/v1betaapi/model_find_cache_paths_response_entry.go new file mode 100644 index 000000000..63cf6ee9c --- /dev/null +++ b/services/cdn/v1betaapi/model_find_cache_paths_response_entry.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the FindCachePathsResponseEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FindCachePathsResponseEntry{} + +// FindCachePathsResponseEntry struct for FindCachePathsResponseEntry +type FindCachePathsResponseEntry struct { + // Defines one path that was previously used as part of a granular purge + Path string `json:"path"` +} + +type _FindCachePathsResponseEntry FindCachePathsResponseEntry + +// NewFindCachePathsResponseEntry instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntry(path string) *FindCachePathsResponseEntry { + this := FindCachePathsResponseEntry{} + this.Path = path + return &this +} + +// NewFindCachePathsResponseEntryWithDefaults instantiates a new FindCachePathsResponseEntry 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 NewFindCachePathsResponseEntryWithDefaults() *FindCachePathsResponseEntry { + this := FindCachePathsResponseEntry{} + return &this +} + +// GetPath returns the Path field value +func (o *FindCachePathsResponseEntry) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *FindCachePathsResponseEntry) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *FindCachePathsResponseEntry) SetPath(v string) { + o.Path = v +} + +func (o FindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FindCachePathsResponseEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["path"] = o.Path + return toSerialize, nil +} + +func (o *FindCachePathsResponseEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "path", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFindCachePathsResponseEntry := _FindCachePathsResponseEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFindCachePathsResponseEntry) + + if err != nil { + return err + } + + *o = FindCachePathsResponseEntry(varFindCachePathsResponseEntry) + + return err +} + +type NullableFindCachePathsResponseEntry struct { + value *FindCachePathsResponseEntry + isSet bool +} + +func (v NullableFindCachePathsResponseEntry) Get() *FindCachePathsResponseEntry { + return v.value +} + +func (v *NullableFindCachePathsResponseEntry) Set(val *FindCachePathsResponseEntry) { + v.value = val + v.isSet = true +} + +func (v NullableFindCachePathsResponseEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableFindCachePathsResponseEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFindCachePathsResponseEntry(val *FindCachePathsResponseEntry) *NullableFindCachePathsResponseEntry { + return &NullableFindCachePathsResponseEntry{value: val, isSet: true} +} + +func (v NullableFindCachePathsResponseEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFindCachePathsResponseEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_generic_json_response.go b/services/cdn/v1betaapi/model_generic_json_response.go new file mode 100644 index 000000000..5547afa5f --- /dev/null +++ b/services/cdn/v1betaapi/model_generic_json_response.go @@ -0,0 +1,193 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GenericJSONResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenericJSONResponse{} + +// GenericJSONResponse struct for GenericJSONResponse +type GenericJSONResponse struct { + // Listing of issues with your request + Details []ErrorDetails `json:"details,omitempty"` + Message string `json:"message"` +} + +type _GenericJSONResponse GenericJSONResponse + +// NewGenericJSONResponse instantiates a new GenericJSONResponse 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 NewGenericJSONResponse(message string) *GenericJSONResponse { + this := GenericJSONResponse{} + this.Message = message + return &this +} + +// NewGenericJSONResponseWithDefaults instantiates a new GenericJSONResponse 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 NewGenericJSONResponseWithDefaults() *GenericJSONResponse { + this := GenericJSONResponse{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *GenericJSONResponse) GetDetails() []ErrorDetails { + if o == nil || IsNil(o.Details) { + var ret []ErrorDetails + return ret + } + return o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericJSONResponse) GetDetailsOk() ([]ErrorDetails, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *GenericJSONResponse) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given []ErrorDetails and assigns it to the Details field. +func (o *GenericJSONResponse) SetDetails(v []ErrorDetails) { + o.Details = v +} + +// GetMessage returns the Message field value +func (o *GenericJSONResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *GenericJSONResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *GenericJSONResponse) SetMessage(v string) { + o.Message = v +} + +func (o GenericJSONResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericJSONResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["message"] = o.Message + return toSerialize, nil +} + +func (o *GenericJSONResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGenericJSONResponse := _GenericJSONResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGenericJSONResponse) + + if err != nil { + return err + } + + *o = GenericJSONResponse(varGenericJSONResponse) + + return err +} + +type NullableGenericJSONResponse struct { + value *GenericJSONResponse + isSet bool +} + +func (v NullableGenericJSONResponse) Get() *GenericJSONResponse { + return v.value +} + +func (v *NullableGenericJSONResponse) Set(val *GenericJSONResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGenericJSONResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericJSONResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericJSONResponse(val *GenericJSONResponse) *NullableGenericJSONResponse { + return &NullableGenericJSONResponse{value: val, isSet: true} +} + +func (v NullableGenericJSONResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericJSONResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_cache_info_response.go b/services/cdn/v1betaapi/model_get_cache_info_response.go new file mode 100644 index 000000000..b6b27e415 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_cache_info_response.go @@ -0,0 +1,188 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the GetCacheInfoResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCacheInfoResponse{} + +// GetCacheInfoResponse struct for GetCacheInfoResponse +type GetCacheInfoResponse struct { + History []GetCacheInfoResponseHistoryEntry `json:"history"` + // Returns the last time the cache was purged by calling the PurgeCache endpoint. Time represented as RFC3339 compliant string. If the cache was never purged, this returns `null` + LastPurgeTime NullableTime `json:"lastPurgeTime"` +} + +type _GetCacheInfoResponse GetCacheInfoResponse + +// NewGetCacheInfoResponse instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponse(history []GetCacheInfoResponseHistoryEntry, lastPurgeTime NullableTime) *GetCacheInfoResponse { + this := GetCacheInfoResponse{} + this.History = history + this.LastPurgeTime = lastPurgeTime + return &this +} + +// NewGetCacheInfoResponseWithDefaults instantiates a new GetCacheInfoResponse 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 NewGetCacheInfoResponseWithDefaults() *GetCacheInfoResponse { + this := GetCacheInfoResponse{} + return &this +} + +// GetHistory returns the History field value +func (o *GetCacheInfoResponse) GetHistory() []GetCacheInfoResponseHistoryEntry { + if o == nil { + var ret []GetCacheInfoResponseHistoryEntry + return ret + } + + return o.History +} + +// GetHistoryOk returns a tuple with the History field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponse) GetHistoryOk() ([]GetCacheInfoResponseHistoryEntry, bool) { + if o == nil { + return nil, false + } + return o.History, true +} + +// SetHistory sets field value +func (o *GetCacheInfoResponse) SetHistory(v []GetCacheInfoResponseHistoryEntry) { + o.History = v +} + +// GetLastPurgeTime returns the LastPurgeTime field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *GetCacheInfoResponse) GetLastPurgeTime() time.Time { + if o == nil || o.LastPurgeTime.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastPurgeTime.Get() +} + +// GetLastPurgeTimeOk returns a tuple with the LastPurgeTime field value +// 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 *GetCacheInfoResponse) GetLastPurgeTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastPurgeTime.Get(), o.LastPurgeTime.IsSet() +} + +// SetLastPurgeTime sets field value +func (o *GetCacheInfoResponse) SetLastPurgeTime(v time.Time) { + o.LastPurgeTime.Set(&v) +} + +func (o GetCacheInfoResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCacheInfoResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["history"] = o.History + toSerialize["lastPurgeTime"] = o.LastPurgeTime.Get() + return toSerialize, nil +} + +func (o *GetCacheInfoResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "history", + "lastPurgeTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCacheInfoResponse := _GetCacheInfoResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCacheInfoResponse) + + if err != nil { + return err + } + + *o = GetCacheInfoResponse(varGetCacheInfoResponse) + + return err +} + +type NullableGetCacheInfoResponse struct { + value *GetCacheInfoResponse + isSet bool +} + +func (v NullableGetCacheInfoResponse) Get() *GetCacheInfoResponse { + return v.value +} + +func (v *NullableGetCacheInfoResponse) Set(val *GetCacheInfoResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponse(val *GetCacheInfoResponse) *NullableGetCacheInfoResponse { + return &NullableGetCacheInfoResponse{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go b/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go new file mode 100644 index 000000000..500eb3475 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_cache_info_response_history_entry.go @@ -0,0 +1,217 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the GetCacheInfoResponseHistoryEntry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{} + +// GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry +type GetCacheInfoResponseHistoryEntry struct { + // Deprecated + OccuredAt time.Time `json:"occuredAt"` + OccurredAt time.Time `json:"occurredAt"` + Type string `json:"type"` +} + +type _GetCacheInfoResponseHistoryEntry GetCacheInfoResponseHistoryEntry + +// NewGetCacheInfoResponseHistoryEntry instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntry(occuredAt time.Time, occurredAt time.Time, types string) *GetCacheInfoResponseHistoryEntry { + this := GetCacheInfoResponseHistoryEntry{} + this.OccuredAt = occuredAt + this.OccurredAt = occurredAt + this.Type = types + return &this +} + +// NewGetCacheInfoResponseHistoryEntryWithDefaults instantiates a new GetCacheInfoResponseHistoryEntry 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 NewGetCacheInfoResponseHistoryEntryWithDefaults() *GetCacheInfoResponseHistoryEntry { + this := GetCacheInfoResponseHistoryEntry{} + return &this +} + +// GetOccuredAt returns the OccuredAt field value +// Deprecated +func (o *GetCacheInfoResponseHistoryEntry) GetOccuredAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.OccuredAt +} + +// GetOccuredAtOk returns a tuple with the OccuredAt field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *GetCacheInfoResponseHistoryEntry) GetOccuredAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.OccuredAt, true +} + +// SetOccuredAt sets field value +// Deprecated +func (o *GetCacheInfoResponseHistoryEntry) SetOccuredAt(v time.Time) { + o.OccuredAt = v +} + +// GetOccurredAt returns the OccurredAt field value +func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.OccurredAt +} + +// GetOccurredAtOk returns a tuple with the OccurredAt field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.OccurredAt, true +} + +// SetOccurredAt sets field value +func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v time.Time) { + o.OccurredAt = v +} + +// GetType returns the Type field value +func (o *GetCacheInfoResponseHistoryEntry) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCacheInfoResponseHistoryEntry) SetType(v string) { + o.Type = v +} + +func (o GetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCacheInfoResponseHistoryEntry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["occuredAt"] = o.OccuredAt + toSerialize["occurredAt"] = o.OccurredAt + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *GetCacheInfoResponseHistoryEntry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "occuredAt", + "occurredAt", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCacheInfoResponseHistoryEntry := _GetCacheInfoResponseHistoryEntry{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCacheInfoResponseHistoryEntry) + + if err != nil { + return err + } + + *o = GetCacheInfoResponseHistoryEntry(varGetCacheInfoResponseHistoryEntry) + + return err +} + +type NullableGetCacheInfoResponseHistoryEntry struct { + value *GetCacheInfoResponseHistoryEntry + isSet bool +} + +func (v NullableGetCacheInfoResponseHistoryEntry) Get() *GetCacheInfoResponseHistoryEntry { + return v.value +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) Set(val *GetCacheInfoResponseHistoryEntry) { + v.value = val + v.isSet = true +} + +func (v NullableGetCacheInfoResponseHistoryEntry) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCacheInfoResponseHistoryEntry(val *GetCacheInfoResponseHistoryEntry) *NullableGetCacheInfoResponseHistoryEntry { + return &NullableGetCacheInfoResponseHistoryEntry{value: val, isSet: true} +} + +func (v NullableGetCacheInfoResponseHistoryEntry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCacheInfoResponseHistoryEntry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_custom_domain_custom_certificate.go b/services/cdn/v1betaapi/model_get_custom_domain_custom_certificate.go new file mode 100644 index 000000000..a9b733197 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_custom_domain_custom_certificate.go @@ -0,0 +1,185 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainCustomCertificate{} + +// GetCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. +type GetCustomDomainCustomCertificate struct { + Type string `json:"type"` + // Whenever a new custom certificate is added the version is increased by 1. + Version int32 `json:"version"` +} + +type _GetCustomDomainCustomCertificate GetCustomDomainCustomCertificate + +// NewGetCustomDomainCustomCertificate instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificate(types string, version int32) *GetCustomDomainCustomCertificate { + this := GetCustomDomainCustomCertificate{} + this.Type = types + this.Version = version + return &this +} + +// NewGetCustomDomainCustomCertificateWithDefaults instantiates a new GetCustomDomainCustomCertificate 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 NewGetCustomDomainCustomCertificateWithDefaults() *GetCustomDomainCustomCertificate { + this := GetCustomDomainCustomCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *GetCustomDomainCustomCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCustomDomainCustomCertificate) SetType(v string) { + o.Type = v +} + +// GetVersion returns the Version field value +func (o *GetCustomDomainCustomCertificate) GetVersion() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainCustomCertificate) GetVersionOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *GetCustomDomainCustomCertificate) SetVersion(v int32) { + o.Version = v +} + +func (o GetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *GetCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainCustomCertificate := _GetCustomDomainCustomCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainCustomCertificate) + + if err != nil { + return err + } + + *o = GetCustomDomainCustomCertificate(varGetCustomDomainCustomCertificate) + + return err +} + +type NullableGetCustomDomainCustomCertificate struct { + value *GetCustomDomainCustomCertificate + isSet bool +} + +func (v NullableGetCustomDomainCustomCertificate) Get() *GetCustomDomainCustomCertificate { + return v.value +} + +func (v *NullableGetCustomDomainCustomCertificate) Set(val *GetCustomDomainCustomCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainCustomCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainCustomCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainCustomCertificate(val *GetCustomDomainCustomCertificate) *NullableGetCustomDomainCustomCertificate { + return &NullableGetCustomDomainCustomCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_custom_domain_managed_certificate.go b/services/cdn/v1betaapi/model_get_custom_domain_managed_certificate.go new file mode 100644 index 000000000..92daf2ee4 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_custom_domain_managed_certificate.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainManagedCertificate{} + +// GetCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you +type GetCustomDomainManagedCertificate struct { + Type string `json:"type"` +} + +type _GetCustomDomainManagedCertificate GetCustomDomainManagedCertificate + +// NewGetCustomDomainManagedCertificate instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificate(types string) *GetCustomDomainManagedCertificate { + this := GetCustomDomainManagedCertificate{} + this.Type = types + return &this +} + +// NewGetCustomDomainManagedCertificateWithDefaults instantiates a new GetCustomDomainManagedCertificate 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 NewGetCustomDomainManagedCertificateWithDefaults() *GetCustomDomainManagedCertificate { + this := GetCustomDomainManagedCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *GetCustomDomainManagedCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *GetCustomDomainManagedCertificate) SetType(v string) { + o.Type = v +} + +func (o GetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *GetCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainManagedCertificate := _GetCustomDomainManagedCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainManagedCertificate) + + if err != nil { + return err + } + + *o = GetCustomDomainManagedCertificate(varGetCustomDomainManagedCertificate) + + return err +} + +type NullableGetCustomDomainManagedCertificate struct { + value *GetCustomDomainManagedCertificate + isSet bool +} + +func (v NullableGetCustomDomainManagedCertificate) Get() *GetCustomDomainManagedCertificate { + return v.value +} + +func (v *NullableGetCustomDomainManagedCertificate) Set(val *GetCustomDomainManagedCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainManagedCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainManagedCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainManagedCertificate(val *GetCustomDomainManagedCertificate) *NullableGetCustomDomainManagedCertificate { + return &NullableGetCustomDomainManagedCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_custom_domain_response.go b/services/cdn/v1betaapi/model_get_custom_domain_response.go new file mode 100644 index 000000000..1bdedcbd4 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_custom_domain_response.go @@ -0,0 +1,216 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetCustomDomainResponse{} + +// GetCustomDomainResponse struct for GetCustomDomainResponse +type GetCustomDomainResponse struct { + Certificate GetCustomDomainResponseCertificate `json:"certificate"` + CustomDomain CustomDomain `json:"customDomain"` + // Deprecated + Domain string `json:"domain" validate:"regexp=^[.\\\\-A-Za-z0-9]*$"` +} + +type _GetCustomDomainResponse GetCustomDomainResponse + +// NewGetCustomDomainResponse instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponse(certificate GetCustomDomainResponseCertificate, customDomain CustomDomain, domain string) *GetCustomDomainResponse { + this := GetCustomDomainResponse{} + this.Certificate = certificate + this.CustomDomain = customDomain + this.Domain = domain + return &this +} + +// NewGetCustomDomainResponseWithDefaults instantiates a new GetCustomDomainResponse 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 NewGetCustomDomainResponseWithDefaults() *GetCustomDomainResponse { + this := GetCustomDomainResponse{} + return &this +} + +// GetCertificate returns the Certificate field value +func (o *GetCustomDomainResponse) GetCertificate() GetCustomDomainResponseCertificate { + if o == nil { + var ret GetCustomDomainResponseCertificate + return ret + } + + return o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainResponse) GetCertificateOk() (*GetCustomDomainResponseCertificate, bool) { + if o == nil { + return nil, false + } + return &o.Certificate, true +} + +// SetCertificate sets field value +func (o *GetCustomDomainResponse) SetCertificate(v GetCustomDomainResponseCertificate) { + o.Certificate = v +} + +// GetCustomDomain returns the CustomDomain field value +func (o *GetCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil { + var ret CustomDomain + return ret + } + + return o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value +// and a boolean to check if the value has been set. +func (o *GetCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil { + return nil, false + } + return &o.CustomDomain, true +} + +// SetCustomDomain sets field value +func (o *GetCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = v +} + +// GetDomain returns the Domain field value +// Deprecated +func (o *GetCustomDomainResponse) GetDomain() string { + if o == nil { + var ret string + return ret + } + + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *GetCustomDomainResponse) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value +// Deprecated +func (o *GetCustomDomainResponse) SetDomain(v string) { + o.Domain = v +} + +func (o GetCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["certificate"] = o.Certificate + toSerialize["customDomain"] = o.CustomDomain + toSerialize["domain"] = o.Domain + return toSerialize, nil +} + +func (o *GetCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "certificate", + "customDomain", + "domain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetCustomDomainResponse := _GetCustomDomainResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetCustomDomainResponse) + + if err != nil { + return err + } + + *o = GetCustomDomainResponse(varGetCustomDomainResponse) + + return err +} + +type NullableGetCustomDomainResponse struct { + value *GetCustomDomainResponse + isSet bool +} + +func (v NullableGetCustomDomainResponse) Get() *GetCustomDomainResponse { + return v.value +} + +func (v *NullableGetCustomDomainResponse) Set(val *GetCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainResponse(val *GetCustomDomainResponse) *NullableGetCustomDomainResponse { + return &NullableGetCustomDomainResponse{value: val, isSet: true} +} + +func (v NullableGetCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_custom_domain_response_certificate.go b/services/cdn/v1betaapi/model_get_custom_domain_response_certificate.go new file mode 100644 index 000000000..8ce40e768 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_custom_domain_response_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// GetCustomDomainResponseCertificate - struct for GetCustomDomainResponseCertificate +type GetCustomDomainResponseCertificate struct { + GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate + GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate +} + +// GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in GetCustomDomainResponseCertificate +func GetCustomDomainCustomCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) GetCustomDomainResponseCertificate { + return GetCustomDomainResponseCertificate{ + GetCustomDomainCustomCertificate: v, + } +} + +// GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in GetCustomDomainResponseCertificate +func GetCustomDomainManagedCertificateAsGetCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) GetCustomDomainResponseCertificate { + return GetCustomDomainResponseCertificate{ + GetCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *GetCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into GetCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match + } else { + dst.GetCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into GetCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match + } else { + dst.GetCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal GetCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src GetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + if src.GetCustomDomainCustomCertificate != nil { + return json.Marshal(&src.GetCustomDomainCustomCertificate) + } + + if src.GetCustomDomainManagedCertificate != nil { + return json.Marshal(&src.GetCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *GetCustomDomainResponseCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.GetCustomDomainCustomCertificate != nil { + return obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj GetCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { + if obj.GetCustomDomainCustomCertificate != nil { + return *obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return *obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullableGetCustomDomainResponseCertificate struct { + value *GetCustomDomainResponseCertificate + isSet bool +} + +func (v NullableGetCustomDomainResponseCertificate) Get() *GetCustomDomainResponseCertificate { + return v.value +} + +func (v *NullableGetCustomDomainResponseCertificate) Set(val *GetCustomDomainResponseCertificate) { + v.value = val + v.isSet = true +} + +func (v NullableGetCustomDomainResponseCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCustomDomainResponseCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCustomDomainResponseCertificate(val *GetCustomDomainResponseCertificate) *NullableGetCustomDomainResponseCertificate { + return &NullableGetCustomDomainResponseCertificate{value: val, isSet: true} +} + +func (v NullableGetCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_distribution_response.go b/services/cdn/v1betaapi/model_get_distribution_response.go new file mode 100644 index 000000000..5f133a3ee --- /dev/null +++ b/services/cdn/v1betaapi/model_get_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDistributionResponse{} + +// GetDistributionResponse struct for GetDistributionResponse +type GetDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _GetDistributionResponse GetDistributionResponse + +// NewGetDistributionResponse instantiates a new GetDistributionResponse 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 NewGetDistributionResponse(distribution Distribution) *GetDistributionResponse { + this := GetDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewGetDistributionResponseWithDefaults instantiates a new GetDistributionResponse 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 NewGetDistributionResponseWithDefaults() *GetDistributionResponse { + this := GetDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *GetDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *GetDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *GetDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o GetDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *GetDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetDistributionResponse := _GetDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetDistributionResponse) + + if err != nil { + return err + } + + *o = GetDistributionResponse(varGetDistributionResponse) + + return err +} + +type NullableGetDistributionResponse struct { + value *GetDistributionResponse + isSet bool +} + +func (v NullableGetDistributionResponse) Get() *GetDistributionResponse { + return v.value +} + +func (v *NullableGetDistributionResponse) Set(val *GetDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetDistributionResponse(val *GetDistributionResponse) *NullableGetDistributionResponse { + return &NullableGetDistributionResponse{value: val, isSet: true} +} + +func (v NullableGetDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_logs_response.go b/services/cdn/v1betaapi/model_get_logs_response.go new file mode 100644 index 000000000..bd5a488c7 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_logs_response.go @@ -0,0 +1,192 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsResponse{} + +// GetLogsResponse struct for GetLogsResponse +type GetLogsResponse struct { + Logs []DistributionLogsRecord `json:"logs"` + NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` +} + +type _GetLogsResponse GetLogsResponse + +// NewGetLogsResponse instantiates a new GetLogsResponse 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 NewGetLogsResponse(logs []DistributionLogsRecord) *GetLogsResponse { + this := GetLogsResponse{} + this.Logs = logs + return &this +} + +// NewGetLogsResponseWithDefaults instantiates a new GetLogsResponse 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 NewGetLogsResponseWithDefaults() *GetLogsResponse { + this := GetLogsResponse{} + return &this +} + +// GetLogs returns the Logs field value +func (o *GetLogsResponse) GetLogs() []DistributionLogsRecord { + if o == nil { + var ret []DistributionLogsRecord + return ret + } + + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *GetLogsResponse) GetLogsOk() ([]DistributionLogsRecord, bool) { + if o == nil { + return nil, false + } + return o.Logs, true +} + +// SetLogs sets field value +func (o *GetLogsResponse) SetLogs(v []DistributionLogsRecord) { + o.Logs = v +} + +// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +func (o *GetLogsResponse) GetNextPageIdentifier() string { + if o == nil || IsNil(o.NextPageIdentifier) { + var ret string + return ret + } + return *o.NextPageIdentifier +} + +// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLogsResponse) GetNextPageIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.NextPageIdentifier) { + return nil, false + } + return o.NextPageIdentifier, true +} + +// HasNextPageIdentifier returns a boolean if a field has been set. +func (o *GetLogsResponse) HasNextPageIdentifier() bool { + if o != nil && !IsNil(o.NextPageIdentifier) { + return true + } + + return false +} + +// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. +func (o *GetLogsResponse) SetNextPageIdentifier(v string) { + o.NextPageIdentifier = &v +} + +func (o GetLogsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["logs"] = o.Logs + if !IsNil(o.NextPageIdentifier) { + toSerialize["nextPageIdentifier"] = o.NextPageIdentifier + } + return toSerialize, nil +} + +func (o *GetLogsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "logs", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsResponse := _GetLogsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsResponse) + + if err != nil { + return err + } + + *o = GetLogsResponse(varGetLogsResponse) + + return err +} + +type NullableGetLogsResponse struct { + value *GetLogsResponse + isSet bool +} + +func (v NullableGetLogsResponse) Get() *GetLogsResponse { + return v.value +} + +func (v *NullableGetLogsResponse) Set(val *GetLogsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsResponse(val *GetLogsResponse) *NullableGetLogsResponse { + return &NullableGetLogsResponse{value: val, isSet: true} +} + +func (v NullableGetLogsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_logs_search_filters_response.go b/services/cdn/v1betaapi/model_get_logs_search_filters_response.go new file mode 100644 index 000000000..7cf52d1a7 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_logs_search_filters_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetLogsSearchFiltersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsSearchFiltersResponse{} + +// GetLogsSearchFiltersResponse struct for GetLogsSearchFiltersResponse +type GetLogsSearchFiltersResponse struct { + Filters []string `json:"filters"` +} + +type _GetLogsSearchFiltersResponse GetLogsSearchFiltersResponse + +// NewGetLogsSearchFiltersResponse instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponse(filters []string) *GetLogsSearchFiltersResponse { + this := GetLogsSearchFiltersResponse{} + this.Filters = filters + return &this +} + +// NewGetLogsSearchFiltersResponseWithDefaults instantiates a new GetLogsSearchFiltersResponse 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 NewGetLogsSearchFiltersResponseWithDefaults() *GetLogsSearchFiltersResponse { + this := GetLogsSearchFiltersResponse{} + return &this +} + +// GetFilters returns the Filters field value +func (o *GetLogsSearchFiltersResponse) GetFilters() []string { + if o == nil { + var ret []string + return ret + } + + return o.Filters +} + +// GetFiltersOk returns a tuple with the Filters field value +// and a boolean to check if the value has been set. +func (o *GetLogsSearchFiltersResponse) GetFiltersOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Filters, true +} + +// SetFilters sets field value +func (o *GetLogsSearchFiltersResponse) SetFilters(v []string) { + o.Filters = v +} + +func (o GetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLogsSearchFiltersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["filters"] = o.Filters + return toSerialize, nil +} + +func (o *GetLogsSearchFiltersResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "filters", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetLogsSearchFiltersResponse := _GetLogsSearchFiltersResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetLogsSearchFiltersResponse) + + if err != nil { + return err + } + + *o = GetLogsSearchFiltersResponse(varGetLogsSearchFiltersResponse) + + return err +} + +type NullableGetLogsSearchFiltersResponse struct { + value *GetLogsSearchFiltersResponse + isSet bool +} + +func (v NullableGetLogsSearchFiltersResponse) Get() *GetLogsSearchFiltersResponse { + return v.value +} + +func (v *NullableGetLogsSearchFiltersResponse) Set(val *GetLogsSearchFiltersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetLogsSearchFiltersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLogsSearchFiltersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLogsSearchFiltersResponse(val *GetLogsSearchFiltersResponse) *NullableGetLogsSearchFiltersResponse { + return &NullableGetLogsSearchFiltersResponse{value: val, isSet: true} +} + +func (v NullableGetLogsSearchFiltersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLogsSearchFiltersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_get_statistics_response.go b/services/cdn/v1betaapi/model_get_statistics_response.go new file mode 100644 index 000000000..c91a56189 --- /dev/null +++ b/services/cdn/v1betaapi/model_get_statistics_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GetStatisticsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetStatisticsResponse{} + +// GetStatisticsResponse struct for GetStatisticsResponse +type GetStatisticsResponse struct { + Records []DistributionStatisticsRecord `json:"records"` +} + +type _GetStatisticsResponse GetStatisticsResponse + +// NewGetStatisticsResponse instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponse(records []DistributionStatisticsRecord) *GetStatisticsResponse { + this := GetStatisticsResponse{} + this.Records = records + return &this +} + +// NewGetStatisticsResponseWithDefaults instantiates a new GetStatisticsResponse 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 NewGetStatisticsResponseWithDefaults() *GetStatisticsResponse { + this := GetStatisticsResponse{} + return &this +} + +// GetRecords returns the Records field value +func (o *GetStatisticsResponse) GetRecords() []DistributionStatisticsRecord { + if o == nil { + var ret []DistributionStatisticsRecord + return ret + } + + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value +// and a boolean to check if the value has been set. +func (o *GetStatisticsResponse) GetRecordsOk() ([]DistributionStatisticsRecord, bool) { + if o == nil { + return nil, false + } + return o.Records, true +} + +// SetRecords sets field value +func (o *GetStatisticsResponse) SetRecords(v []DistributionStatisticsRecord) { + o.Records = v +} + +func (o GetStatisticsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetStatisticsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["records"] = o.Records + return toSerialize, nil +} + +func (o *GetStatisticsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "records", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetStatisticsResponse := _GetStatisticsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGetStatisticsResponse) + + if err != nil { + return err + } + + *o = GetStatisticsResponse(varGetStatisticsResponse) + + return err +} + +type NullableGetStatisticsResponse struct { + value *GetStatisticsResponse + isSet bool +} + +func (v NullableGetStatisticsResponse) Get() *GetStatisticsResponse { + return v.value +} + +func (v *NullableGetStatisticsResponse) Set(val *GetStatisticsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetStatisticsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetStatisticsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetStatisticsResponse(val *GetStatisticsResponse) *NullableGetStatisticsResponse { + return &NullableGetStatisticsResponse{value: val, isSet: true} +} + +func (v NullableGetStatisticsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetStatisticsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_http_backend.go b/services/cdn/v1betaapi/model_http_backend.go new file mode 100644 index 000000000..73e01fef9 --- /dev/null +++ b/services/cdn/v1betaapi/model_http_backend.go @@ -0,0 +1,242 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the HttpBackend type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpBackend{} + +// HttpBackend struct for HttpBackend +type HttpBackend struct { + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. + Geofencing map[string][]string `json:"geofencing"` + // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. + OriginRequestHeaders map[string]string `json:"originRequestHeaders"` + OriginUrl string `json:"originUrl"` + Type string `json:"type"` +} + +type _HttpBackend HttpBackend + +// NewHttpBackend instantiates a new HttpBackend 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 NewHttpBackend(geofencing map[string][]string, originRequestHeaders map[string]string, originUrl string, types string) *HttpBackend { + this := HttpBackend{} + this.Geofencing = geofencing + this.OriginRequestHeaders = originRequestHeaders + this.OriginUrl = originUrl + this.Type = types + return &this +} + +// NewHttpBackendWithDefaults instantiates a new HttpBackend 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 NewHttpBackendWithDefaults() *HttpBackend { + this := HttpBackend{} + return &this +} + +// GetGeofencing returns the Geofencing field value +func (o *HttpBackend) GetGeofencing() map[string][]string { + if o == nil { + var ret map[string][]string + return ret + } + + return o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil { + return nil, false + } + return &o.Geofencing, true +} + +// SetGeofencing sets field value +func (o *HttpBackend) SetGeofencing(v map[string][]string) { + o.Geofencing = v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value +func (o *HttpBackend) GetOriginRequestHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.OriginRequestHeaders, true +} + +// SetOriginRequestHeaders sets field value +func (o *HttpBackend) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = v +} + +// GetOriginUrl returns the OriginUrl field value +func (o *HttpBackend) GetOriginUrl() string { + if o == nil { + var ret string + return ret + } + + return o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetOriginUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OriginUrl, true +} + +// SetOriginUrl sets field value +func (o *HttpBackend) SetOriginUrl(v string) { + o.OriginUrl = v +} + +// GetType returns the Type field value +func (o *HttpBackend) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *HttpBackend) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HttpBackend) SetType(v string) { + o.Type = v +} + +func (o HttpBackend) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpBackend) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["geofencing"] = o.Geofencing + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + toSerialize["originUrl"] = o.OriginUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *HttpBackend) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "geofencing", + "originRequestHeaders", + "originUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHttpBackend := _HttpBackend{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpBackend) + + if err != nil { + return err + } + + *o = HttpBackend(varHttpBackend) + + return err +} + +type NullableHttpBackend struct { + value *HttpBackend + isSet bool +} + +func (v NullableHttpBackend) Get() *HttpBackend { + return v.value +} + +func (v *NullableHttpBackend) Set(val *HttpBackend) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackend) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackend) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackend(val *HttpBackend) *NullableHttpBackend { + return &NullableHttpBackend{value: val, isSet: true} +} + +func (v NullableHttpBackend) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackend) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_http_backend_patch.go b/services/cdn/v1betaapi/model_http_backend_patch.go new file mode 100644 index 000000000..8d87bfe3e --- /dev/null +++ b/services/cdn/v1betaapi/model_http_backend_patch.go @@ -0,0 +1,267 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the HttpBackendPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HttpBackendPatch{} + +// HttpBackendPatch A partial HTTP Backend +type HttpBackendPatch struct { + // An object mapping multiple alternative origins to country codes. Any request from one of those country codes will route to the alternative origin. Do note that country codes may only be used once. You cannot have a country be assigned to multiple alternative origins. + Geofencing *map[string][]string `json:"geofencing,omitempty"` + // Headers that will be sent with every request to the configured origin. **WARNING**: Do not store sensitive values in the headers. The configuration is stored as plain text. + OriginRequestHeaders *map[string]string `json:"originRequestHeaders,omitempty"` + OriginUrl *string `json:"originUrl,omitempty"` + // This property is required to determine the used backend type. + Type string `json:"type"` +} + +type _HttpBackendPatch HttpBackendPatch + +// NewHttpBackendPatch instantiates a new HttpBackendPatch 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 NewHttpBackendPatch(types string) *HttpBackendPatch { + this := HttpBackendPatch{} + this.Type = types + return &this +} + +// NewHttpBackendPatchWithDefaults instantiates a new HttpBackendPatch 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 NewHttpBackendPatchWithDefaults() *HttpBackendPatch { + this := HttpBackendPatch{} + return &this +} + +// GetGeofencing returns the Geofencing field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetGeofencing() map[string][]string { + if o == nil || IsNil(o.Geofencing) { + var ret map[string][]string + return ret + } + return *o.Geofencing +} + +// GetGeofencingOk returns a tuple with the Geofencing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetGeofencingOk() (*map[string][]string, bool) { + if o == nil || IsNil(o.Geofencing) { + return nil, false + } + return o.Geofencing, true +} + +// HasGeofencing returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasGeofencing() bool { + if o != nil && !IsNil(o.Geofencing) { + return true + } + + return false +} + +// SetGeofencing gets a reference to the given map[string][]string and assigns it to the Geofencing field. +func (o *HttpBackendPatch) SetGeofencing(v map[string][]string) { + o.Geofencing = &v +} + +// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetOriginRequestHeaders() map[string]string { + if o == nil || IsNil(o.OriginRequestHeaders) { + var ret map[string]string + return ret + } + return *o.OriginRequestHeaders +} + +// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetOriginRequestHeadersOk() (*map[string]string, bool) { + if o == nil || IsNil(o.OriginRequestHeaders) { + return nil, false + } + return o.OriginRequestHeaders, true +} + +// HasOriginRequestHeaders returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasOriginRequestHeaders() bool { + if o != nil && !IsNil(o.OriginRequestHeaders) { + return true + } + + return false +} + +// SetOriginRequestHeaders gets a reference to the given map[string]string and assigns it to the OriginRequestHeaders field. +func (o *HttpBackendPatch) SetOriginRequestHeaders(v map[string]string) { + o.OriginRequestHeaders = &v +} + +// GetOriginUrl returns the OriginUrl field value if set, zero value otherwise. +func (o *HttpBackendPatch) GetOriginUrl() string { + if o == nil || IsNil(o.OriginUrl) { + var ret string + return ret + } + return *o.OriginUrl +} + +// GetOriginUrlOk returns a tuple with the OriginUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetOriginUrlOk() (*string, bool) { + if o == nil || IsNil(o.OriginUrl) { + return nil, false + } + return o.OriginUrl, true +} + +// HasOriginUrl returns a boolean if a field has been set. +func (o *HttpBackendPatch) HasOriginUrl() bool { + if o != nil && !IsNil(o.OriginUrl) { + return true + } + + return false +} + +// SetOriginUrl gets a reference to the given string and assigns it to the OriginUrl field. +func (o *HttpBackendPatch) SetOriginUrl(v string) { + o.OriginUrl = &v +} + +// GetType returns the Type field value +func (o *HttpBackendPatch) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *HttpBackendPatch) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *HttpBackendPatch) SetType(v string) { + o.Type = v +} + +func (o HttpBackendPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Geofencing) { + toSerialize["geofencing"] = o.Geofencing + } + if !IsNil(o.OriginRequestHeaders) { + toSerialize["originRequestHeaders"] = o.OriginRequestHeaders + } + if !IsNil(o.OriginUrl) { + toSerialize["originUrl"] = o.OriginUrl + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *HttpBackendPatch) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHttpBackendPatch := _HttpBackendPatch{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varHttpBackendPatch) + + if err != nil { + return err + } + + *o = HttpBackendPatch(varHttpBackendPatch) + + return err +} + +type NullableHttpBackendPatch struct { + value *HttpBackendPatch + isSet bool +} + +func (v NullableHttpBackendPatch) Get() *HttpBackendPatch { + return v.value +} + +func (v *NullableHttpBackendPatch) Set(val *HttpBackendPatch) { + v.value = val + v.isSet = true +} + +func (v NullableHttpBackendPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableHttpBackendPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHttpBackendPatch(val *HttpBackendPatch) *NullableHttpBackendPatch { + return &NullableHttpBackendPatch{value: val, isSet: true} +} + +func (v NullableHttpBackendPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHttpBackendPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_list_distributions_response.go b/services/cdn/v1betaapi/model_list_distributions_response.go new file mode 100644 index 000000000..4788a6260 --- /dev/null +++ b/services/cdn/v1betaapi/model_list_distributions_response.go @@ -0,0 +1,192 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListDistributionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDistributionsResponse{} + +// ListDistributionsResponse struct for ListDistributionsResponse +type ListDistributionsResponse struct { + Distributions []Distribution `json:"distributions"` + NextPageIdentifier *string `json:"nextPageIdentifier,omitempty"` +} + +type _ListDistributionsResponse ListDistributionsResponse + +// NewListDistributionsResponse instantiates a new ListDistributionsResponse 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 NewListDistributionsResponse(distributions []Distribution) *ListDistributionsResponse { + this := ListDistributionsResponse{} + this.Distributions = distributions + return &this +} + +// NewListDistributionsResponseWithDefaults instantiates a new ListDistributionsResponse 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 NewListDistributionsResponseWithDefaults() *ListDistributionsResponse { + this := ListDistributionsResponse{} + return &this +} + +// GetDistributions returns the Distributions field value +func (o *ListDistributionsResponse) GetDistributions() []Distribution { + if o == nil { + var ret []Distribution + return ret + } + + return o.Distributions +} + +// GetDistributionsOk returns a tuple with the Distributions field value +// and a boolean to check if the value has been set. +func (o *ListDistributionsResponse) GetDistributionsOk() ([]Distribution, bool) { + if o == nil { + return nil, false + } + return o.Distributions, true +} + +// SetDistributions sets field value +func (o *ListDistributionsResponse) SetDistributions(v []Distribution) { + o.Distributions = v +} + +// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +func (o *ListDistributionsResponse) GetNextPageIdentifier() string { + if o == nil || IsNil(o.NextPageIdentifier) { + var ret string + return ret + } + return *o.NextPageIdentifier +} + +// GetNextPageIdentifierOk returns a tuple with the NextPageIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListDistributionsResponse) GetNextPageIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.NextPageIdentifier) { + return nil, false + } + return o.NextPageIdentifier, true +} + +// HasNextPageIdentifier returns a boolean if a field has been set. +func (o *ListDistributionsResponse) HasNextPageIdentifier() bool { + if o != nil && !IsNil(o.NextPageIdentifier) { + return true + } + + return false +} + +// SetNextPageIdentifier gets a reference to the given string and assigns it to the NextPageIdentifier field. +func (o *ListDistributionsResponse) SetNextPageIdentifier(v string) { + o.NextPageIdentifier = &v +} + +func (o ListDistributionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListDistributionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distributions"] = o.Distributions + if !IsNil(o.NextPageIdentifier) { + toSerialize["nextPageIdentifier"] = o.NextPageIdentifier + } + return toSerialize, nil +} + +func (o *ListDistributionsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distributions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListDistributionsResponse := _ListDistributionsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListDistributionsResponse) + + if err != nil { + return err + } + + *o = ListDistributionsResponse(varListDistributionsResponse) + + return err +} + +type NullableListDistributionsResponse struct { + value *ListDistributionsResponse + isSet bool +} + +func (v NullableListDistributionsResponse) Get() *ListDistributionsResponse { + return v.value +} + +func (v *NullableListDistributionsResponse) Set(val *ListDistributionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListDistributionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListDistributionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListDistributionsResponse(val *ListDistributionsResponse) *NullableListDistributionsResponse { + return &NullableListDistributionsResponse{value: val, isSet: true} +} + +func (v NullableListDistributionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListDistributionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_list_waf_collections_response.go b/services/cdn/v1betaapi/model_list_waf_collections_response.go new file mode 100644 index 000000000..562034c5e --- /dev/null +++ b/services/cdn/v1betaapi/model_list_waf_collections_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListWAFCollectionsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListWAFCollectionsResponse{} + +// ListWAFCollectionsResponse struct for ListWAFCollectionsResponse +type ListWAFCollectionsResponse struct { + Collections []WAFRuleCollection `json:"collections"` +} + +type _ListWAFCollectionsResponse ListWAFCollectionsResponse + +// NewListWAFCollectionsResponse instantiates a new ListWAFCollectionsResponse 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 NewListWAFCollectionsResponse(collections []WAFRuleCollection) *ListWAFCollectionsResponse { + this := ListWAFCollectionsResponse{} + this.Collections = collections + return &this +} + +// NewListWAFCollectionsResponseWithDefaults instantiates a new ListWAFCollectionsResponse 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 NewListWAFCollectionsResponseWithDefaults() *ListWAFCollectionsResponse { + this := ListWAFCollectionsResponse{} + return &this +} + +// GetCollections returns the Collections field value +func (o *ListWAFCollectionsResponse) GetCollections() []WAFRuleCollection { + if o == nil { + var ret []WAFRuleCollection + return ret + } + + return o.Collections +} + +// GetCollectionsOk returns a tuple with the Collections field value +// and a boolean to check if the value has been set. +func (o *ListWAFCollectionsResponse) GetCollectionsOk() ([]WAFRuleCollection, bool) { + if o == nil { + return nil, false + } + return o.Collections, true +} + +// SetCollections sets field value +func (o *ListWAFCollectionsResponse) SetCollections(v []WAFRuleCollection) { + o.Collections = v +} + +func (o ListWAFCollectionsResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListWAFCollectionsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["collections"] = o.Collections + return toSerialize, nil +} + +func (o *ListWAFCollectionsResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "collections", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListWAFCollectionsResponse := _ListWAFCollectionsResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListWAFCollectionsResponse) + + if err != nil { + return err + } + + *o = ListWAFCollectionsResponse(varListWAFCollectionsResponse) + + return err +} + +type NullableListWAFCollectionsResponse struct { + value *ListWAFCollectionsResponse + isSet bool +} + +func (v NullableListWAFCollectionsResponse) Get() *ListWAFCollectionsResponse { + return v.value +} + +func (v *NullableListWAFCollectionsResponse) Set(val *ListWAFCollectionsResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListWAFCollectionsResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListWAFCollectionsResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListWAFCollectionsResponse(val *ListWAFCollectionsResponse) *NullableListWAFCollectionsResponse { + return &NullableListWAFCollectionsResponse{value: val, isSet: true} +} + +func (v NullableListWAFCollectionsResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListWAFCollectionsResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_loki_log_sink.go b/services/cdn/v1betaapi/model_loki_log_sink.go new file mode 100644 index 000000000..51d6cf671 --- /dev/null +++ b/services/cdn/v1betaapi/model_loki_log_sink.go @@ -0,0 +1,184 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the LokiLogSink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LokiLogSink{} + +// LokiLogSink struct for LokiLogSink +type LokiLogSink struct { + PushUrl string `json:"pushUrl"` + Type string `json:"type"` +} + +type _LokiLogSink LokiLogSink + +// NewLokiLogSink instantiates a new LokiLogSink 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 NewLokiLogSink(pushUrl string, types string) *LokiLogSink { + this := LokiLogSink{} + this.PushUrl = pushUrl + this.Type = types + return &this +} + +// NewLokiLogSinkWithDefaults instantiates a new LokiLogSink 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 NewLokiLogSinkWithDefaults() *LokiLogSink { + this := LokiLogSink{} + return &this +} + +// GetPushUrl returns the PushUrl field value +func (o *LokiLogSink) GetPushUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value +// and a boolean to check if the value has been set. +func (o *LokiLogSink) GetPushUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PushUrl, true +} + +// SetPushUrl sets field value +func (o *LokiLogSink) SetPushUrl(v string) { + o.PushUrl = v +} + +// GetType returns the Type field value +func (o *LokiLogSink) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *LokiLogSink) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *LokiLogSink) SetType(v string) { + o.Type = v +} + +func (o LokiLogSink) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LokiLogSink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pushUrl"] = o.PushUrl + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *LokiLogSink) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pushUrl", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLokiLogSink := _LokiLogSink{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varLokiLogSink) + + if err != nil { + return err + } + + *o = LokiLogSink(varLokiLogSink) + + return err +} + +type NullableLokiLogSink struct { + value *LokiLogSink + isSet bool +} + +func (v NullableLokiLogSink) Get() *LokiLogSink { + return v.value +} + +func (v *NullableLokiLogSink) Set(val *LokiLogSink) { + v.value = val + v.isSet = true +} + +func (v NullableLokiLogSink) IsSet() bool { + return v.isSet +} + +func (v *NullableLokiLogSink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLokiLogSink(val *LokiLogSink) *NullableLokiLogSink { + return &NullableLokiLogSink{value: val, isSet: true} +} + +func (v NullableLokiLogSink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLokiLogSink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_optimizer.go b/services/cdn/v1betaapi/model_optimizer.go new file mode 100644 index 000000000..bf078c702 --- /dev/null +++ b/services/cdn/v1betaapi/model_optimizer.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Optimizer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Optimizer{} + +// Optimizer Optimizer is paid feature, a real-time on the fly image manipulation and optimization service that automatically optimizes your images for faster image delivery. +type Optimizer struct { + // Determines if the optimizer should be enabled for this distribution and incurs a monthly fee + Enabled bool `json:"enabled"` +} + +type _Optimizer Optimizer + +// NewOptimizer instantiates a new Optimizer 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 NewOptimizer(enabled bool) *Optimizer { + this := Optimizer{} + this.Enabled = enabled + return &this +} + +// NewOptimizerWithDefaults instantiates a new Optimizer 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 NewOptimizerWithDefaults() *Optimizer { + this := Optimizer{} + return &this +} + +// GetEnabled returns the Enabled field value +func (o *Optimizer) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *Optimizer) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *Optimizer) SetEnabled(v bool) { + o.Enabled = v +} + +func (o Optimizer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Optimizer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["enabled"] = o.Enabled + return toSerialize, nil +} + +func (o *Optimizer) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOptimizer := _Optimizer{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varOptimizer) + + if err != nil { + return err + } + + *o = Optimizer(varOptimizer) + + return err +} + +type NullableOptimizer struct { + value *Optimizer + isSet bool +} + +func (v NullableOptimizer) Get() *Optimizer { + return v.value +} + +func (v *NullableOptimizer) Set(val *Optimizer) { + v.value = val + v.isSet = true +} + +func (v NullableOptimizer) IsSet() bool { + return v.isSet +} + +func (v *NullableOptimizer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOptimizer(val *Optimizer) *NullableOptimizer { + return &NullableOptimizer{value: val, isSet: true} +} + +func (v NullableOptimizer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOptimizer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_optimizer_patch.go b/services/cdn/v1betaapi/model_optimizer_patch.go new file mode 100644 index 000000000..afc26ee14 --- /dev/null +++ b/services/cdn/v1betaapi/model_optimizer_patch.go @@ -0,0 +1,124 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the OptimizerPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OptimizerPatch{} + +// OptimizerPatch struct for OptimizerPatch +type OptimizerPatch struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// NewOptimizerPatch instantiates a new OptimizerPatch 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 NewOptimizerPatch() *OptimizerPatch { + this := OptimizerPatch{} + return &this +} + +// NewOptimizerPatchWithDefaults instantiates a new OptimizerPatch 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 NewOptimizerPatchWithDefaults() *OptimizerPatch { + this := OptimizerPatch{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *OptimizerPatch) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OptimizerPatch) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *OptimizerPatch) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *OptimizerPatch) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o OptimizerPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OptimizerPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableOptimizerPatch struct { + value *OptimizerPatch + isSet bool +} + +func (v NullableOptimizerPatch) Get() *OptimizerPatch { + return v.value +} + +func (v *NullableOptimizerPatch) Set(val *OptimizerPatch) { + v.value = val + v.isSet = true +} + +func (v NullableOptimizerPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableOptimizerPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOptimizerPatch(val *OptimizerPatch) *NullableOptimizerPatch { + return &NullableOptimizerPatch{value: val, isSet: true} +} + +func (v NullableOptimizerPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOptimizerPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_patch_distribution_payload.go b/services/cdn/v1betaapi/model_patch_distribution_payload.go new file mode 100644 index 000000000..332125118 --- /dev/null +++ b/services/cdn/v1betaapi/model_patch_distribution_payload.go @@ -0,0 +1,161 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the PatchDistributionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchDistributionPayload{} + +// PatchDistributionPayload Defines a partial distribution. Set values +type PatchDistributionPayload struct { + Config *ConfigPatch `json:"config,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` +} + +// NewPatchDistributionPayload instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayload() *PatchDistributionPayload { + this := PatchDistributionPayload{} + return &this +} + +// NewPatchDistributionPayloadWithDefaults instantiates a new PatchDistributionPayload 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 NewPatchDistributionPayloadWithDefaults() *PatchDistributionPayload { + this := PatchDistributionPayload{} + return &this +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *PatchDistributionPayload) GetConfig() ConfigPatch { + if o == nil || IsNil(o.Config) { + var ret ConfigPatch + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchDistributionPayload) GetConfigOk() (*ConfigPatch, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *PatchDistributionPayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ConfigPatch and assigns it to the Config field. +func (o *PatchDistributionPayload) SetConfig(v ConfigPatch) { + o.Config = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *PatchDistributionPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchDistributionPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *PatchDistributionPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *PatchDistributionPayload) SetIntentId(v string) { + o.IntentId = &v +} + +func (o PatchDistributionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchDistributionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + return toSerialize, nil +} + +type NullablePatchDistributionPayload struct { + value *PatchDistributionPayload + isSet bool +} + +func (v NullablePatchDistributionPayload) Get() *PatchDistributionPayload { + return v.value +} + +func (v *NullablePatchDistributionPayload) Set(val *PatchDistributionPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePatchDistributionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchDistributionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchDistributionPayload(val *PatchDistributionPayload) *NullablePatchDistributionPayload { + return &NullablePatchDistributionPayload{value: val, isSet: true} +} + +func (v NullablePatchDistributionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchDistributionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_patch_distribution_response.go b/services/cdn/v1betaapi/model_patch_distribution_response.go new file mode 100644 index 000000000..ff142df49 --- /dev/null +++ b/services/cdn/v1betaapi/model_patch_distribution_response.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PatchDistributionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchDistributionResponse{} + +// PatchDistributionResponse struct for PatchDistributionResponse +type PatchDistributionResponse struct { + Distribution Distribution `json:"distribution"` +} + +type _PatchDistributionResponse PatchDistributionResponse + +// NewPatchDistributionResponse instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponse(distribution Distribution) *PatchDistributionResponse { + this := PatchDistributionResponse{} + this.Distribution = distribution + return &this +} + +// NewPatchDistributionResponseWithDefaults instantiates a new PatchDistributionResponse 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 NewPatchDistributionResponseWithDefaults() *PatchDistributionResponse { + this := PatchDistributionResponse{} + return &this +} + +// GetDistribution returns the Distribution field value +func (o *PatchDistributionResponse) GetDistribution() Distribution { + if o == nil { + var ret Distribution + return ret + } + + return o.Distribution +} + +// GetDistributionOk returns a tuple with the Distribution field value +// and a boolean to check if the value has been set. +func (o *PatchDistributionResponse) GetDistributionOk() (*Distribution, bool) { + if o == nil { + return nil, false + } + return &o.Distribution, true +} + +// SetDistribution sets field value +func (o *PatchDistributionResponse) SetDistribution(v Distribution) { + o.Distribution = v +} + +func (o PatchDistributionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchDistributionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["distribution"] = o.Distribution + return toSerialize, nil +} + +func (o *PatchDistributionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "distribution", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPatchDistributionResponse := _PatchDistributionResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPatchDistributionResponse) + + if err != nil { + return err + } + + *o = PatchDistributionResponse(varPatchDistributionResponse) + + return err +} + +type NullablePatchDistributionResponse struct { + value *PatchDistributionResponse + isSet bool +} + +func (v NullablePatchDistributionResponse) Get() *PatchDistributionResponse { + return v.value +} + +func (v *NullablePatchDistributionResponse) Set(val *PatchDistributionResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePatchDistributionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchDistributionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchDistributionResponse(val *PatchDistributionResponse) *NullablePatchDistributionResponse { + return &NullablePatchDistributionResponse{value: val, isSet: true} +} + +func (v NullablePatchDistributionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchDistributionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_patch_loki_log_sink.go b/services/cdn/v1betaapi/model_patch_loki_log_sink.go new file mode 100644 index 000000000..380332457 --- /dev/null +++ b/services/cdn/v1betaapi/model_patch_loki_log_sink.go @@ -0,0 +1,240 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PatchLokiLogSink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchLokiLogSink{} + +// PatchLokiLogSink struct for PatchLokiLogSink +type PatchLokiLogSink struct { + Password string `json:"password"` + PushUrl string `json:"pushUrl"` + Type string `json:"type"` + Username string `json:"username"` +} + +type _PatchLokiLogSink PatchLokiLogSink + +// NewPatchLokiLogSink instantiates a new PatchLokiLogSink 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 NewPatchLokiLogSink(password string, pushUrl string, types string, username string) *PatchLokiLogSink { + this := PatchLokiLogSink{} + this.Password = password + this.PushUrl = pushUrl + this.Type = types + this.Username = username + return &this +} + +// NewPatchLokiLogSinkWithDefaults instantiates a new PatchLokiLogSink 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 NewPatchLokiLogSinkWithDefaults() *PatchLokiLogSink { + this := PatchLokiLogSink{} + return &this +} + +// GetPassword returns the Password field value +func (o *PatchLokiLogSink) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *PatchLokiLogSink) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *PatchLokiLogSink) SetPassword(v string) { + o.Password = v +} + +// GetPushUrl returns the PushUrl field value +func (o *PatchLokiLogSink) GetPushUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PushUrl +} + +// GetPushUrlOk returns a tuple with the PushUrl field value +// and a boolean to check if the value has been set. +func (o *PatchLokiLogSink) GetPushUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PushUrl, true +} + +// SetPushUrl sets field value +func (o *PatchLokiLogSink) SetPushUrl(v string) { + o.PushUrl = v +} + +// GetType returns the Type field value +func (o *PatchLokiLogSink) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PatchLokiLogSink) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PatchLokiLogSink) SetType(v string) { + o.Type = v +} + +// GetUsername returns the Username field value +func (o *PatchLokiLogSink) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *PatchLokiLogSink) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *PatchLokiLogSink) SetUsername(v string) { + o.Username = v +} + +func (o PatchLokiLogSink) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchLokiLogSink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["password"] = o.Password + toSerialize["pushUrl"] = o.PushUrl + toSerialize["type"] = o.Type + toSerialize["username"] = o.Username + return toSerialize, nil +} + +func (o *PatchLokiLogSink) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "password", + "pushUrl", + "type", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPatchLokiLogSink := _PatchLokiLogSink{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPatchLokiLogSink) + + if err != nil { + return err + } + + *o = PatchLokiLogSink(varPatchLokiLogSink) + + return err +} + +type NullablePatchLokiLogSink struct { + value *PatchLokiLogSink + isSet bool +} + +func (v NullablePatchLokiLogSink) Get() *PatchLokiLogSink { + return v.value +} + +func (v *NullablePatchLokiLogSink) Set(val *PatchLokiLogSink) { + v.value = val + v.isSet = true +} + +func (v NullablePatchLokiLogSink) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchLokiLogSink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchLokiLogSink(val *PatchLokiLogSink) *NullablePatchLokiLogSink { + return &NullablePatchLokiLogSink{value: val, isSet: true} +} + +func (v NullablePatchLokiLogSink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchLokiLogSink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_purge_cache_payload.go b/services/cdn/v1betaapi/model_purge_cache_payload.go new file mode 100644 index 000000000..5e81e1f52 --- /dev/null +++ b/services/cdn/v1betaapi/model_purge_cache_payload.go @@ -0,0 +1,125 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the PurgeCachePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PurgeCachePayload{} + +// PurgeCachePayload struct for PurgeCachePayload +type PurgeCachePayload struct { + // Defines an optional path. If this is set, a granular purge is done. If missing, the entire cache is invalidated. During a granular cache purge, only the provided path is purged. Please do not that for example `/some/path` and `/some/path.txt` are considered different paths. + Path *string `json:"path,omitempty"` +} + +// NewPurgeCachePayload instantiates a new PurgeCachePayload 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 NewPurgeCachePayload() *PurgeCachePayload { + this := PurgeCachePayload{} + return &this +} + +// NewPurgeCachePayloadWithDefaults instantiates a new PurgeCachePayload 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 NewPurgeCachePayloadWithDefaults() *PurgeCachePayload { + this := PurgeCachePayload{} + return &this +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *PurgeCachePayload) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PurgeCachePayload) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *PurgeCachePayload) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *PurgeCachePayload) SetPath(v string) { + o.Path = &v +} + +func (o PurgeCachePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PurgeCachePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + return toSerialize, nil +} + +type NullablePurgeCachePayload struct { + value *PurgeCachePayload + isSet bool +} + +func (v NullablePurgeCachePayload) Get() *PurgeCachePayload { + return v.value +} + +func (v *NullablePurgeCachePayload) Set(val *PurgeCachePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePurgeCachePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePurgeCachePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePurgeCachePayload(val *PurgeCachePayload) *NullablePurgeCachePayload { + return &NullablePurgeCachePayload{value: val, isSet: true} +} + +func (v NullablePurgeCachePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePurgeCachePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_custom_certificate.go b/services/cdn/v1betaapi/model_put_custom_domain_custom_certificate.go new file mode 100644 index 000000000..d0a58a7f6 --- /dev/null +++ b/services/cdn/v1betaapi/model_put_custom_domain_custom_certificate.go @@ -0,0 +1,214 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainCustomCertificate{} + +// PutCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key. +type PutCustomDomainCustomCertificate struct { + // base64-encoded PEM-encoded certificate + Certificate string `json:"certificate"` + // base64-encoded PEM encoded key + Key string `json:"key"` + Type string `json:"type"` +} + +type _PutCustomDomainCustomCertificate PutCustomDomainCustomCertificate + +// NewPutCustomDomainCustomCertificate instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificate(certificate string, key string, types string) *PutCustomDomainCustomCertificate { + this := PutCustomDomainCustomCertificate{} + this.Certificate = certificate + this.Key = key + this.Type = types + return &this +} + +// NewPutCustomDomainCustomCertificateWithDefaults instantiates a new PutCustomDomainCustomCertificate 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 NewPutCustomDomainCustomCertificateWithDefaults() *PutCustomDomainCustomCertificate { + this := PutCustomDomainCustomCertificate{} + return &this +} + +// GetCertificate returns the Certificate field value +func (o *PutCustomDomainCustomCertificate) GetCertificate() string { + if o == nil { + var ret string + return ret + } + + return o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Certificate, true +} + +// SetCertificate sets field value +func (o *PutCustomDomainCustomCertificate) SetCertificate(v string) { + o.Certificate = v +} + +// GetKey returns the Key field value +func (o *PutCustomDomainCustomCertificate) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *PutCustomDomainCustomCertificate) SetKey(v string) { + o.Key = v +} + +// GetType returns the Type field value +func (o *PutCustomDomainCustomCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainCustomCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PutCustomDomainCustomCertificate) SetType(v string) { + o.Type = v +} + +func (o PutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["certificate"] = o.Certificate + toSerialize["key"] = o.Key + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *PutCustomDomainCustomCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "certificate", + "key", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainCustomCertificate := _PutCustomDomainCustomCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainCustomCertificate) + + if err != nil { + return err + } + + *o = PutCustomDomainCustomCertificate(varPutCustomDomainCustomCertificate) + + return err +} + +type NullablePutCustomDomainCustomCertificate struct { + value *PutCustomDomainCustomCertificate + isSet bool +} + +func (v NullablePutCustomDomainCustomCertificate) Get() *PutCustomDomainCustomCertificate { + return v.value +} + +func (v *NullablePutCustomDomainCustomCertificate) Set(val *PutCustomDomainCustomCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainCustomCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainCustomCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainCustomCertificate(val *PutCustomDomainCustomCertificate) *NullablePutCustomDomainCustomCertificate { + return &NullablePutCustomDomainCustomCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainCustomCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainCustomCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_managed_certificate.go b/services/cdn/v1betaapi/model_put_custom_domain_managed_certificate.go new file mode 100644 index 000000000..aca11ef42 --- /dev/null +++ b/services/cdn/v1betaapi/model_put_custom_domain_managed_certificate.go @@ -0,0 +1,156 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainManagedCertificate{} + +// PutCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you +type PutCustomDomainManagedCertificate struct { + Type string `json:"type"` +} + +type _PutCustomDomainManagedCertificate PutCustomDomainManagedCertificate + +// NewPutCustomDomainManagedCertificate instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificate(types string) *PutCustomDomainManagedCertificate { + this := PutCustomDomainManagedCertificate{} + this.Type = types + return &this +} + +// NewPutCustomDomainManagedCertificateWithDefaults instantiates a new PutCustomDomainManagedCertificate 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 NewPutCustomDomainManagedCertificateWithDefaults() *PutCustomDomainManagedCertificate { + this := PutCustomDomainManagedCertificate{} + return &this +} + +// GetType returns the Type field value +func (o *PutCustomDomainManagedCertificate) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainManagedCertificate) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PutCustomDomainManagedCertificate) SetType(v string) { + o.Type = v +} + +func (o PutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *PutCustomDomainManagedCertificate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainManagedCertificate := _PutCustomDomainManagedCertificate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainManagedCertificate) + + if err != nil { + return err + } + + *o = PutCustomDomainManagedCertificate(varPutCustomDomainManagedCertificate) + + return err +} + +type NullablePutCustomDomainManagedCertificate struct { + value *PutCustomDomainManagedCertificate + isSet bool +} + +func (v NullablePutCustomDomainManagedCertificate) Get() *PutCustomDomainManagedCertificate { + return v.value +} + +func (v *NullablePutCustomDomainManagedCertificate) Set(val *PutCustomDomainManagedCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainManagedCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainManagedCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainManagedCertificate(val *PutCustomDomainManagedCertificate) *NullablePutCustomDomainManagedCertificate { + return &NullablePutCustomDomainManagedCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainManagedCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainManagedCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_payload.go b/services/cdn/v1betaapi/model_put_custom_domain_payload.go new file mode 100644 index 000000000..d12475994 --- /dev/null +++ b/services/cdn/v1betaapi/model_put_custom_domain_payload.go @@ -0,0 +1,161 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the PutCustomDomainPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainPayload{} + +// PutCustomDomainPayload struct for PutCustomDomainPayload +type PutCustomDomainPayload struct { + Certificate *PutCustomDomainPayloadCertificate `json:"certificate,omitempty"` + // While optional, it is greatly encouraged to provide an `intentId`. This is used to deduplicate requests. If multiple modifying Requests with the same `intentId` for a given `projectId` are received, all but the first request are dropped. + IntentId *string `json:"intentId,omitempty"` +} + +// NewPutCustomDomainPayload instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayload() *PutCustomDomainPayload { + this := PutCustomDomainPayload{} + return &this +} + +// NewPutCustomDomainPayloadWithDefaults instantiates a new PutCustomDomainPayload 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 NewPutCustomDomainPayloadWithDefaults() *PutCustomDomainPayload { + this := PutCustomDomainPayload{} + return &this +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise. +func (o *PutCustomDomainPayload) GetCertificate() PutCustomDomainPayloadCertificate { + if o == nil || IsNil(o.Certificate) { + var ret PutCustomDomainPayloadCertificate + return ret + } + return *o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainPayload) GetCertificateOk() (*PutCustomDomainPayloadCertificate, bool) { + if o == nil || IsNil(o.Certificate) { + return nil, false + } + return o.Certificate, true +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PutCustomDomainPayload) HasCertificate() bool { + if o != nil && !IsNil(o.Certificate) { + return true + } + + return false +} + +// SetCertificate gets a reference to the given PutCustomDomainPayloadCertificate and assigns it to the Certificate field. +func (o *PutCustomDomainPayload) SetCertificate(v PutCustomDomainPayloadCertificate) { + o.Certificate = &v +} + +// GetIntentId returns the IntentId field value if set, zero value otherwise. +func (o *PutCustomDomainPayload) GetIntentId() string { + if o == nil || IsNil(o.IntentId) { + var ret string + return ret + } + return *o.IntentId +} + +// GetIntentIdOk returns a tuple with the IntentId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainPayload) GetIntentIdOk() (*string, bool) { + if o == nil || IsNil(o.IntentId) { + return nil, false + } + return o.IntentId, true +} + +// HasIntentId returns a boolean if a field has been set. +func (o *PutCustomDomainPayload) HasIntentId() bool { + if o != nil && !IsNil(o.IntentId) { + return true + } + + return false +} + +// SetIntentId gets a reference to the given string and assigns it to the IntentId field. +func (o *PutCustomDomainPayload) SetIntentId(v string) { + o.IntentId = &v +} + +func (o PutCustomDomainPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Certificate) { + toSerialize["certificate"] = o.Certificate + } + if !IsNil(o.IntentId) { + toSerialize["intentId"] = o.IntentId + } + return toSerialize, nil +} + +type NullablePutCustomDomainPayload struct { + value *PutCustomDomainPayload + isSet bool +} + +func (v NullablePutCustomDomainPayload) Get() *PutCustomDomainPayload { + return v.value +} + +func (v *NullablePutCustomDomainPayload) Set(val *PutCustomDomainPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainPayload(val *PutCustomDomainPayload) *NullablePutCustomDomainPayload { + return &NullablePutCustomDomainPayload{value: val, isSet: true} +} + +func (v NullablePutCustomDomainPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_payload_certificate.go b/services/cdn/v1betaapi/model_put_custom_domain_payload_certificate.go new file mode 100644 index 000000000..ceff01931 --- /dev/null +++ b/services/cdn/v1betaapi/model_put_custom_domain_payload_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// PutCustomDomainPayloadCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted +type PutCustomDomainPayloadCertificate struct { + PutCustomDomainCustomCertificate *PutCustomDomainCustomCertificate + PutCustomDomainManagedCertificate *PutCustomDomainManagedCertificate +} + +// PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainCustomCertificate wrapped in PutCustomDomainPayloadCertificate +func PutCustomDomainCustomCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainCustomCertificate) PutCustomDomainPayloadCertificate { + return PutCustomDomainPayloadCertificate{ + PutCustomDomainCustomCertificate: v, + } +} + +// PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate is a convenience function that returns PutCustomDomainManagedCertificate wrapped in PutCustomDomainPayloadCertificate +func PutCustomDomainManagedCertificateAsPutCustomDomainPayloadCertificate(v *PutCustomDomainManagedCertificate) PutCustomDomainPayloadCertificate { + return PutCustomDomainPayloadCertificate{ + PutCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PutCustomDomainPayloadCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into PutCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.PutCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.PutCustomDomainCustomCertificate, return on the first match + } else { + dst.PutCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into PutCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.PutCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.PutCustomDomainManagedCertificate, return on the first match + } else { + dst.PutCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainPayloadCertificate as PutCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { + if src.PutCustomDomainCustomCertificate != nil { + return json.Marshal(&src.PutCustomDomainCustomCertificate) + } + + if src.PutCustomDomainManagedCertificate != nil { + return json.Marshal(&src.PutCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *PutCustomDomainPayloadCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.PutCustomDomainCustomCertificate != nil { + return obj.PutCustomDomainCustomCertificate + } + + if obj.PutCustomDomainManagedCertificate != nil { + return obj.PutCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj PutCustomDomainPayloadCertificate) GetActualInstanceValue() interface{} { + if obj.PutCustomDomainCustomCertificate != nil { + return *obj.PutCustomDomainCustomCertificate + } + + if obj.PutCustomDomainManagedCertificate != nil { + return *obj.PutCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullablePutCustomDomainPayloadCertificate struct { + value *PutCustomDomainPayloadCertificate + isSet bool +} + +func (v NullablePutCustomDomainPayloadCertificate) Get() *PutCustomDomainPayloadCertificate { + return v.value +} + +func (v *NullablePutCustomDomainPayloadCertificate) Set(val *PutCustomDomainPayloadCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainPayloadCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainPayloadCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainPayloadCertificate(val *PutCustomDomainPayloadCertificate) *NullablePutCustomDomainPayloadCertificate { + return &NullablePutCustomDomainPayloadCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainPayloadCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainPayloadCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_response.go b/services/cdn/v1betaapi/model_put_custom_domain_response.go new file mode 100644 index 000000000..fef641cda --- /dev/null +++ b/services/cdn/v1betaapi/model_put_custom_domain_response.go @@ -0,0 +1,224 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PutCustomDomainResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PutCustomDomainResponse{} + +// PutCustomDomainResponse struct for PutCustomDomainResponse +type PutCustomDomainResponse struct { + Certificate *PutCustomDomainResponseCertificate `json:"certificate,omitempty"` + CustomDomain CustomDomain `json:"customDomain"` + // Deprecated + Domain string `json:"domain" validate:"regexp=^[.\\\\-A-Za-z0-9]*$"` +} + +type _PutCustomDomainResponse PutCustomDomainResponse + +// NewPutCustomDomainResponse instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponse(customDomain CustomDomain, domain string) *PutCustomDomainResponse { + this := PutCustomDomainResponse{} + this.CustomDomain = customDomain + this.Domain = domain + return &this +} + +// NewPutCustomDomainResponseWithDefaults instantiates a new PutCustomDomainResponse 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 NewPutCustomDomainResponseWithDefaults() *PutCustomDomainResponse { + this := PutCustomDomainResponse{} + return &this +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise. +func (o *PutCustomDomainResponse) GetCertificate() PutCustomDomainResponseCertificate { + if o == nil || IsNil(o.Certificate) { + var ret PutCustomDomainResponseCertificate + return ret + } + return *o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PutCustomDomainResponse) GetCertificateOk() (*PutCustomDomainResponseCertificate, bool) { + if o == nil || IsNil(o.Certificate) { + return nil, false + } + return o.Certificate, true +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PutCustomDomainResponse) HasCertificate() bool { + if o != nil && !IsNil(o.Certificate) { + return true + } + + return false +} + +// SetCertificate gets a reference to the given PutCustomDomainResponseCertificate and assigns it to the Certificate field. +func (o *PutCustomDomainResponse) SetCertificate(v PutCustomDomainResponseCertificate) { + o.Certificate = &v +} + +// GetCustomDomain returns the CustomDomain field value +func (o *PutCustomDomainResponse) GetCustomDomain() CustomDomain { + if o == nil { + var ret CustomDomain + return ret + } + + return o.CustomDomain +} + +// GetCustomDomainOk returns a tuple with the CustomDomain field value +// and a boolean to check if the value has been set. +func (o *PutCustomDomainResponse) GetCustomDomainOk() (*CustomDomain, bool) { + if o == nil { + return nil, false + } + return &o.CustomDomain, true +} + +// SetCustomDomain sets field value +func (o *PutCustomDomainResponse) SetCustomDomain(v CustomDomain) { + o.CustomDomain = v +} + +// GetDomain returns the Domain field value +// Deprecated +func (o *PutCustomDomainResponse) GetDomain() string { + if o == nil { + var ret string + return ret + } + + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +// Deprecated +func (o *PutCustomDomainResponse) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value +// Deprecated +func (o *PutCustomDomainResponse) SetDomain(v string) { + o.Domain = v +} + +func (o PutCustomDomainResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PutCustomDomainResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Certificate) { + toSerialize["certificate"] = o.Certificate + } + toSerialize["customDomain"] = o.CustomDomain + toSerialize["domain"] = o.Domain + return toSerialize, nil +} + +func (o *PutCustomDomainResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "customDomain", + "domain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPutCustomDomainResponse := _PutCustomDomainResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPutCustomDomainResponse) + + if err != nil { + return err + } + + *o = PutCustomDomainResponse(varPutCustomDomainResponse) + + return err +} + +type NullablePutCustomDomainResponse struct { + value *PutCustomDomainResponse + isSet bool +} + +func (v NullablePutCustomDomainResponse) Get() *PutCustomDomainResponse { + return v.value +} + +func (v *NullablePutCustomDomainResponse) Set(val *PutCustomDomainResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainResponse(val *PutCustomDomainResponse) *NullablePutCustomDomainResponse { + return &NullablePutCustomDomainResponse{value: val, isSet: true} +} + +func (v NullablePutCustomDomainResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_put_custom_domain_response_certificate.go b/services/cdn/v1betaapi/model_put_custom_domain_response_certificate.go new file mode 100644 index 000000000..ab3dc5d58 --- /dev/null +++ b/services/cdn/v1betaapi/model_put_custom_domain_response_certificate.go @@ -0,0 +1,153 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// PutCustomDomainResponseCertificate - Pass a custom certificate to be served by the CDN when calling the custom domain. Will use a managed certificate when omitted +type PutCustomDomainResponseCertificate struct { + GetCustomDomainCustomCertificate *GetCustomDomainCustomCertificate + GetCustomDomainManagedCertificate *GetCustomDomainManagedCertificate +} + +// GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainCustomCertificate wrapped in PutCustomDomainResponseCertificate +func GetCustomDomainCustomCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainCustomCertificate) PutCustomDomainResponseCertificate { + return PutCustomDomainResponseCertificate{ + GetCustomDomainCustomCertificate: v, + } +} + +// GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate is a convenience function that returns GetCustomDomainManagedCertificate wrapped in PutCustomDomainResponseCertificate +func GetCustomDomainManagedCertificateAsPutCustomDomainResponseCertificate(v *GetCustomDomainManagedCertificate) PutCustomDomainResponseCertificate { + return PutCustomDomainResponseCertificate{ + GetCustomDomainManagedCertificate: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *PutCustomDomainResponseCertificate) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'custom' + if jsonDict["type"] == "custom" { + // try to unmarshal JSON data into GetCustomDomainCustomCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainCustomCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainCustomCertificate, return on the first match + } else { + dst.GetCustomDomainCustomCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainCustomCertificate: %s", err.Error()) + } + } + + // check if the discriminator value is 'managed' + if jsonDict["type"] == "managed" { + // try to unmarshal JSON data into GetCustomDomainManagedCertificate + err = json.Unmarshal(data, &dst.GetCustomDomainManagedCertificate) + if err == nil { + return nil // data stored in dst.GetCustomDomainManagedCertificate, return on the first match + } else { + dst.GetCustomDomainManagedCertificate = nil + return fmt.Errorf("failed to unmarshal PutCustomDomainResponseCertificate as GetCustomDomainManagedCertificate: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src PutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + if src.GetCustomDomainCustomCertificate != nil { + return json.Marshal(&src.GetCustomDomainCustomCertificate) + } + + if src.GetCustomDomainManagedCertificate != nil { + return json.Marshal(&src.GetCustomDomainManagedCertificate) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *PutCustomDomainResponseCertificate) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.GetCustomDomainCustomCertificate != nil { + return obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj PutCustomDomainResponseCertificate) GetActualInstanceValue() interface{} { + if obj.GetCustomDomainCustomCertificate != nil { + return *obj.GetCustomDomainCustomCertificate + } + + if obj.GetCustomDomainManagedCertificate != nil { + return *obj.GetCustomDomainManagedCertificate + } + + // all schemas are nil + return nil +} + +type NullablePutCustomDomainResponseCertificate struct { + value *PutCustomDomainResponseCertificate + isSet bool +} + +func (v NullablePutCustomDomainResponseCertificate) Get() *PutCustomDomainResponseCertificate { + return v.value +} + +func (v *NullablePutCustomDomainResponseCertificate) Set(val *PutCustomDomainResponseCertificate) { + v.value = val + v.isSet = true +} + +func (v NullablePutCustomDomainResponseCertificate) IsSet() bool { + return v.isSet +} + +func (v *NullablePutCustomDomainResponseCertificate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePutCustomDomainResponseCertificate(val *PutCustomDomainResponseCertificate) *NullablePutCustomDomainResponseCertificate { + return &NullablePutCustomDomainResponseCertificate{value: val, isSet: true} +} + +func (v NullablePutCustomDomainResponseCertificate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePutCustomDomainResponseCertificate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_region.go b/services/cdn/v1betaapi/model_region.go new file mode 100644 index 000000000..986d06673 --- /dev/null +++ b/services/cdn/v1betaapi/model_region.go @@ -0,0 +1,116 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// Region The following regions exist: - `EU` - Europe - `US` - United States / North America - `AF` - Africa - `SA` - South America - `ASIA` - Asia and Oceania +type Region string + +// List of Region +const ( + REGION_EU Region = "EU" + REGION_US Region = "US" + REGION_AF Region = "AF" + REGION_SA Region = "SA" + REGION_ASIA Region = "ASIA" +) + +// All allowed values of Region enum +var AllowedRegionEnumValues = []Region{ + "EU", + "US", + "AF", + "SA", + "ASIA", +} + +func (v *Region) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := Region(value) + for _, existing := range AllowedRegionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid Region", value) +} + +// NewRegionFromValue returns a pointer to a valid Region +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRegionFromValue(v string) (*Region, error) { + ev := Region(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for Region: valid values are %v", v, AllowedRegionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v Region) IsValid() bool { + for _, existing := range AllowedRegionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Region value +func (v Region) Ptr() *Region { + return &v +} + +type NullableRegion struct { + value *Region + isSet bool +} + +func (v NullableRegion) Get() *Region { + return v.value +} + +func (v *NullableRegion) Set(val *Region) { + v.value = val + v.isSet = true +} + +func (v NullableRegion) IsSet() bool { + return v.isSet +} + +func (v *NullableRegion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegion(val *Region) *NullableRegion { + return &NullableRegion{value: val, isSet: true} +} + +func (v NullableRegion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_status_error.go b/services/cdn/v1betaapi/model_status_error.go new file mode 100644 index 000000000..46e3a86e0 --- /dev/null +++ b/services/cdn/v1betaapi/model_status_error.go @@ -0,0 +1,223 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the StatusError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StatusError{} + +// StatusError struct for StatusError +type StatusError struct { + // A german translation string corresponding to the error key. Note that we do not guarantee german translations are present. + De *string `json:"de,omitempty"` + // An english translation string corresponding to the error key. An english translation key is always present. + En string `json:"en"` + // An enum value that describes a Status Error. + Key string `json:"key"` +} + +type _StatusError StatusError + +// NewStatusError instantiates a new StatusError 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 NewStatusError(en string, key string) *StatusError { + this := StatusError{} + this.En = en + this.Key = key + return &this +} + +// NewStatusErrorWithDefaults instantiates a new StatusError 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 NewStatusErrorWithDefaults() *StatusError { + this := StatusError{} + return &this +} + +// GetDe returns the De field value if set, zero value otherwise. +func (o *StatusError) GetDe() string { + if o == nil || IsNil(o.De) { + var ret string + return ret + } + return *o.De +} + +// GetDeOk returns a tuple with the De field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StatusError) GetDeOk() (*string, bool) { + if o == nil || IsNil(o.De) { + return nil, false + } + return o.De, true +} + +// HasDe returns a boolean if a field has been set. +func (o *StatusError) HasDe() bool { + if o != nil && !IsNil(o.De) { + return true + } + + return false +} + +// SetDe gets a reference to the given string and assigns it to the De field. +func (o *StatusError) SetDe(v string) { + o.De = &v +} + +// GetEn returns the En field value +func (o *StatusError) GetEn() string { + if o == nil { + var ret string + return ret + } + + return o.En +} + +// GetEnOk returns a tuple with the En field value +// and a boolean to check if the value has been set. +func (o *StatusError) GetEnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.En, true +} + +// SetEn sets field value +func (o *StatusError) SetEn(v string) { + o.En = v +} + +// GetKey returns the Key field value +func (o *StatusError) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *StatusError) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *StatusError) SetKey(v string) { + o.Key = v +} + +func (o StatusError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StatusError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.De) { + toSerialize["de"] = o.De + } + toSerialize["en"] = o.En + toSerialize["key"] = o.Key + return toSerialize, nil +} + +func (o *StatusError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "en", + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStatusError := _StatusError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varStatusError) + + if err != nil { + return err + } + + *o = StatusError(varStatusError) + + return err +} + +type NullableStatusError struct { + value *StatusError + isSet bool +} + +func (v NullableStatusError) Get() *StatusError { + return v.value +} + +func (v *NullableStatusError) Set(val *StatusError) { + v.value = val + v.isSet = true +} + +func (v NullableStatusError) IsSet() bool { + return v.isSet +} + +func (v *NullableStatusError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStatusError(val *StatusError) *NullableStatusError { + return &NullableStatusError{value: val, isSet: true} +} + +func (v NullableStatusError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStatusError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_config.go b/services/cdn/v1betaapi/model_waf_config.go new file mode 100644 index 000000000..1d8ecbe15 --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_config.go @@ -0,0 +1,357 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WafConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafConfig{} + +// WafConfig Configuration of the WAF of a distribution +type WafConfig struct { + AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` + AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` + AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` + // IDs of the WAF rules that are **explicitly** enabled for this distribution. If this rule is in a disabled / log Only RuleGroup or Collection, it will be enabled regardless as `enabledRuleIds` overrides those in specificity. Do note that rules can also be enabled because a Rulegroup or Collection is enabled. **DO NOT** use this property to find all active rules. Instead, pass `?withWafStatus=true` as a query parameter to `GetDistribution` or `ListDistributions`. This will expose the `waf` Property on distribution Level. From there you can `$.waf.enabledRules.map(e => e.id)` to get a list of all enabled rules. + EnabledRuleIds []string `json:"enabledRuleIds"` + Mode WafMode `json:"mode"` + ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` + Type WafType `json:"type"` +} + +type _WafConfig WafConfig + +// NewWafConfig instantiates a new WafConfig 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 NewWafConfig(enabledRuleIds []string, mode WafMode, types WafType) *WafConfig { + this := WafConfig{} + this.EnabledRuleIds = enabledRuleIds + this.Mode = mode + this.Type = types + return &this +} + +// NewWafConfigWithDefaults instantiates a new WafConfig 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 NewWafConfigWithDefaults() *WafConfig { + this := WafConfig{} + return &this +} + +// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedHttpMethods() []string { + if o == nil || IsNil(o.AllowedHttpMethods) { + var ret []string + return ret + } + return o.AllowedHttpMethods +} + +// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedHttpMethodsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpMethods) { + return nil, false + } + return o.AllowedHttpMethods, true +} + +// HasAllowedHttpMethods returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedHttpMethods() bool { + if o != nil && !IsNil(o.AllowedHttpMethods) { + return true + } + + return false +} + +// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. +func (o *WafConfig) SetAllowedHttpMethods(v []string) { + o.AllowedHttpMethods = v +} + +// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedHttpVersions() []string { + if o == nil || IsNil(o.AllowedHttpVersions) { + var ret []string + return ret + } + return o.AllowedHttpVersions +} + +// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedHttpVersionsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpVersions) { + return nil, false + } + return o.AllowedHttpVersions, true +} + +// HasAllowedHttpVersions returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedHttpVersions() bool { + if o != nil && !IsNil(o.AllowedHttpVersions) { + return true + } + + return false +} + +// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. +func (o *WafConfig) SetAllowedHttpVersions(v []string) { + o.AllowedHttpVersions = v +} + +// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. +func (o *WafConfig) GetAllowedRequestContentTypes() []string { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + var ret []string + return ret + } + return o.AllowedRequestContentTypes +} + +// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetAllowedRequestContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + return nil, false + } + return o.AllowedRequestContentTypes, true +} + +// HasAllowedRequestContentTypes returns a boolean if a field has been set. +func (o *WafConfig) HasAllowedRequestContentTypes() bool { + if o != nil && !IsNil(o.AllowedRequestContentTypes) { + return true + } + + return false +} + +// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. +func (o *WafConfig) SetAllowedRequestContentTypes(v []string) { + o.AllowedRequestContentTypes = v +} + +// GetEnabledRuleIds returns the EnabledRuleIds field value +func (o *WafConfig) GetEnabledRuleIds() []string { + if o == nil { + var ret []string + return ret + } + + return o.EnabledRuleIds +} + +// GetEnabledRuleIdsOk returns a tuple with the EnabledRuleIds field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetEnabledRuleIdsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.EnabledRuleIds, true +} + +// SetEnabledRuleIds sets field value +func (o *WafConfig) SetEnabledRuleIds(v []string) { + o.EnabledRuleIds = v +} + +// GetMode returns the Mode field value +func (o *WafConfig) GetMode() WafMode { + if o == nil { + var ret WafMode + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetModeOk() (*WafMode, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *WafConfig) SetMode(v WafMode) { + o.Mode = v +} + +// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. +func (o *WafConfig) GetParanoiaLevel() WafParanoiaLevel { + if o == nil || IsNil(o.ParanoiaLevel) { + var ret WafParanoiaLevel + return ret + } + return *o.ParanoiaLevel +} + +// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfig) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { + if o == nil || IsNil(o.ParanoiaLevel) { + return nil, false + } + return o.ParanoiaLevel, true +} + +// HasParanoiaLevel returns a boolean if a field has been set. +func (o *WafConfig) HasParanoiaLevel() bool { + if o != nil && !IsNil(o.ParanoiaLevel) { + return true + } + + return false +} + +// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. +func (o *WafConfig) SetParanoiaLevel(v WafParanoiaLevel) { + o.ParanoiaLevel = &v +} + +// GetType returns the Type field value +func (o *WafConfig) GetType() WafType { + if o == nil { + var ret WafType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *WafConfig) GetTypeOk() (*WafType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *WafConfig) SetType(v WafType) { + o.Type = v +} + +func (o WafConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedHttpMethods) { + toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods + } + if !IsNil(o.AllowedHttpVersions) { + toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions + } + if !IsNil(o.AllowedRequestContentTypes) { + toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes + } + toSerialize["enabledRuleIds"] = o.EnabledRuleIds + toSerialize["mode"] = o.Mode + if !IsNil(o.ParanoiaLevel) { + toSerialize["paranoiaLevel"] = o.ParanoiaLevel + } + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *WafConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabledRuleIds", + "mode", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWafConfig := _WafConfig{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWafConfig) + + if err != nil { + return err + } + + *o = WafConfig(varWafConfig) + + return err +} + +type NullableWafConfig struct { + value *WafConfig + isSet bool +} + +func (v NullableWafConfig) Get() *WafConfig { + return v.value +} + +func (v *NullableWafConfig) Set(val *WafConfig) { + v.value = val + v.isSet = true +} + +func (v NullableWafConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableWafConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafConfig(val *WafConfig) *NullableWafConfig { + return &NullableWafConfig{value: val, isSet: true} +} + +func (v NullableWafConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_config_patch.go b/services/cdn/v1betaapi/model_waf_config_patch.go new file mode 100644 index 000000000..2c749f67f --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_config_patch.go @@ -0,0 +1,304 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the WafConfigPatch type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WafConfigPatch{} + +// WafConfigPatch struct for WafConfigPatch +type WafConfigPatch struct { + AllowedHttpMethods []string `json:"allowedHttpMethods,omitempty"` + AllowedHttpVersions []string `json:"allowedHttpVersions,omitempty"` + AllowedRequestContentTypes []string `json:"allowedRequestContentTypes,omitempty"` + Mode *WafMode `json:"mode,omitempty"` + ParanoiaLevel *WafParanoiaLevel `json:"paranoiaLevel,omitempty"` + Type *WafType `json:"type,omitempty"` +} + +// NewWafConfigPatch instantiates a new WafConfigPatch 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 NewWafConfigPatch() *WafConfigPatch { + this := WafConfigPatch{} + return &this +} + +// NewWafConfigPatchWithDefaults instantiates a new WafConfigPatch 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 NewWafConfigPatchWithDefaults() *WafConfigPatch { + this := WafConfigPatch{} + return &this +} + +// GetAllowedHttpMethods returns the AllowedHttpMethods field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedHttpMethods() []string { + if o == nil || IsNil(o.AllowedHttpMethods) { + var ret []string + return ret + } + return o.AllowedHttpMethods +} + +// GetAllowedHttpMethodsOk returns a tuple with the AllowedHttpMethods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedHttpMethodsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpMethods) { + return nil, false + } + return o.AllowedHttpMethods, true +} + +// HasAllowedHttpMethods returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedHttpMethods() bool { + if o != nil && !IsNil(o.AllowedHttpMethods) { + return true + } + + return false +} + +// SetAllowedHttpMethods gets a reference to the given []string and assigns it to the AllowedHttpMethods field. +func (o *WafConfigPatch) SetAllowedHttpMethods(v []string) { + o.AllowedHttpMethods = v +} + +// GetAllowedHttpVersions returns the AllowedHttpVersions field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedHttpVersions() []string { + if o == nil || IsNil(o.AllowedHttpVersions) { + var ret []string + return ret + } + return o.AllowedHttpVersions +} + +// GetAllowedHttpVersionsOk returns a tuple with the AllowedHttpVersions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedHttpVersionsOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedHttpVersions) { + return nil, false + } + return o.AllowedHttpVersions, true +} + +// HasAllowedHttpVersions returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedHttpVersions() bool { + if o != nil && !IsNil(o.AllowedHttpVersions) { + return true + } + + return false +} + +// SetAllowedHttpVersions gets a reference to the given []string and assigns it to the AllowedHttpVersions field. +func (o *WafConfigPatch) SetAllowedHttpVersions(v []string) { + o.AllowedHttpVersions = v +} + +// GetAllowedRequestContentTypes returns the AllowedRequestContentTypes field value if set, zero value otherwise. +func (o *WafConfigPatch) GetAllowedRequestContentTypes() []string { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + var ret []string + return ret + } + return o.AllowedRequestContentTypes +} + +// GetAllowedRequestContentTypesOk returns a tuple with the AllowedRequestContentTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetAllowedRequestContentTypesOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedRequestContentTypes) { + return nil, false + } + return o.AllowedRequestContentTypes, true +} + +// HasAllowedRequestContentTypes returns a boolean if a field has been set. +func (o *WafConfigPatch) HasAllowedRequestContentTypes() bool { + if o != nil && !IsNil(o.AllowedRequestContentTypes) { + return true + } + + return false +} + +// SetAllowedRequestContentTypes gets a reference to the given []string and assigns it to the AllowedRequestContentTypes field. +func (o *WafConfigPatch) SetAllowedRequestContentTypes(v []string) { + o.AllowedRequestContentTypes = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *WafConfigPatch) GetMode() WafMode { + if o == nil || IsNil(o.Mode) { + var ret WafMode + 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 *WafConfigPatch) GetModeOk() (*WafMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *WafConfigPatch) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given WafMode and assigns it to the Mode field. +func (o *WafConfigPatch) SetMode(v WafMode) { + o.Mode = &v +} + +// GetParanoiaLevel returns the ParanoiaLevel field value if set, zero value otherwise. +func (o *WafConfigPatch) GetParanoiaLevel() WafParanoiaLevel { + if o == nil || IsNil(o.ParanoiaLevel) { + var ret WafParanoiaLevel + return ret + } + return *o.ParanoiaLevel +} + +// GetParanoiaLevelOk returns a tuple with the ParanoiaLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetParanoiaLevelOk() (*WafParanoiaLevel, bool) { + if o == nil || IsNil(o.ParanoiaLevel) { + return nil, false + } + return o.ParanoiaLevel, true +} + +// HasParanoiaLevel returns a boolean if a field has been set. +func (o *WafConfigPatch) HasParanoiaLevel() bool { + if o != nil && !IsNil(o.ParanoiaLevel) { + return true + } + + return false +} + +// SetParanoiaLevel gets a reference to the given WafParanoiaLevel and assigns it to the ParanoiaLevel field. +func (o *WafConfigPatch) SetParanoiaLevel(v WafParanoiaLevel) { + o.ParanoiaLevel = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *WafConfigPatch) GetType() WafType { + if o == nil || IsNil(o.Type) { + var ret WafType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WafConfigPatch) GetTypeOk() (*WafType, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *WafConfigPatch) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given WafType and assigns it to the Type field. +func (o *WafConfigPatch) SetType(v WafType) { + o.Type = &v +} + +func (o WafConfigPatch) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WafConfigPatch) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedHttpMethods) { + toSerialize["allowedHttpMethods"] = o.AllowedHttpMethods + } + if !IsNil(o.AllowedHttpVersions) { + toSerialize["allowedHttpVersions"] = o.AllowedHttpVersions + } + if !IsNil(o.AllowedRequestContentTypes) { + toSerialize["allowedRequestContentTypes"] = o.AllowedRequestContentTypes + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.ParanoiaLevel) { + toSerialize["paranoiaLevel"] = o.ParanoiaLevel + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableWafConfigPatch struct { + value *WafConfigPatch + isSet bool +} + +func (v NullableWafConfigPatch) Get() *WafConfigPatch { + return v.value +} + +func (v *NullableWafConfigPatch) Set(val *WafConfigPatch) { + v.value = val + v.isSet = true +} + +func (v NullableWafConfigPatch) IsSet() bool { + return v.isSet +} + +func (v *NullableWafConfigPatch) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafConfigPatch(val *WafConfigPatch) *NullableWafConfigPatch { + return &NullableWafConfigPatch{value: val, isSet: true} +} + +func (v NullableWafConfigPatch) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafConfigPatch) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_mode.go b/services/cdn/v1betaapi/model_waf_mode.go new file mode 100644 index 000000000..39bf348d1 --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_mode.go @@ -0,0 +1,112 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// WafMode the model 'WafMode' +type WafMode string + +// List of WafMode +const ( + WAFMODE_DISABLED WafMode = "DISABLED" + WAFMODE_ENABLED WafMode = "ENABLED" + WAFMODE_LOG_ONLY WafMode = "LOG_ONLY" +) + +// All allowed values of WafMode enum +var AllowedWafModeEnumValues = []WafMode{ + "DISABLED", + "ENABLED", + "LOG_ONLY", +} + +func (v *WafMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafMode(value) + for _, existing := range AllowedWafModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafMode", value) +} + +// NewWafModeFromValue returns a pointer to a valid WafMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafModeFromValue(v string) (*WafMode, error) { + ev := WafMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafMode: valid values are %v", v, AllowedWafModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafMode) IsValid() bool { + for _, existing := range AllowedWafModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafMode value +func (v WafMode) Ptr() *WafMode { + return &v +} + +type NullableWafMode struct { + value *WafMode + isSet bool +} + +func (v NullableWafMode) Get() *WafMode { + return v.value +} + +func (v *NullableWafMode) Set(val *WafMode) { + v.value = val + v.isSet = true +} + +func (v NullableWafMode) IsSet() bool { + return v.isSet +} + +func (v *NullableWafMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafMode(val *WafMode) *NullableWafMode { + return &NullableWafMode{value: val, isSet: true} +} + +func (v NullableWafMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_paranoia_level.go b/services/cdn/v1betaapi/model_waf_paranoia_level.go new file mode 100644 index 000000000..9c2908677 --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_paranoia_level.go @@ -0,0 +1,114 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// WafParanoiaLevel The paranoia level defines how aggressively the WAF should action on requests. It ranges from `L1` (least strict, lowest chance of false positives) to `L4` (most strict, highest chance of false positives). A higher paranoia level is more effective at catching attacks but can also block legitimate traffic. +type WafParanoiaLevel string + +// List of WafParanoiaLevel +const ( + WAFPARANOIALEVEL_L1 WafParanoiaLevel = "L1" + WAFPARANOIALEVEL_L2 WafParanoiaLevel = "L2" + WAFPARANOIALEVEL_L3 WafParanoiaLevel = "L3" + WAFPARANOIALEVEL_L4 WafParanoiaLevel = "L4" +) + +// All allowed values of WafParanoiaLevel enum +var AllowedWafParanoiaLevelEnumValues = []WafParanoiaLevel{ + "L1", + "L2", + "L3", + "L4", +} + +func (v *WafParanoiaLevel) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafParanoiaLevel(value) + for _, existing := range AllowedWafParanoiaLevelEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafParanoiaLevel", value) +} + +// NewWafParanoiaLevelFromValue returns a pointer to a valid WafParanoiaLevel +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafParanoiaLevelFromValue(v string) (*WafParanoiaLevel, error) { + ev := WafParanoiaLevel(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafParanoiaLevel: valid values are %v", v, AllowedWafParanoiaLevelEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafParanoiaLevel) IsValid() bool { + for _, existing := range AllowedWafParanoiaLevelEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafParanoiaLevel value +func (v WafParanoiaLevel) Ptr() *WafParanoiaLevel { + return &v +} + +type NullableWafParanoiaLevel struct { + value *WafParanoiaLevel + isSet bool +} + +func (v NullableWafParanoiaLevel) Get() *WafParanoiaLevel { + return v.value +} + +func (v *NullableWafParanoiaLevel) Set(val *WafParanoiaLevel) { + v.value = val + v.isSet = true +} + +func (v NullableWafParanoiaLevel) IsSet() bool { + return v.isSet +} + +func (v *NullableWafParanoiaLevel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafParanoiaLevel(val *WafParanoiaLevel) *NullableWafParanoiaLevel { + return &NullableWafParanoiaLevel{value: val, isSet: true} +} + +func (v NullableWafParanoiaLevel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafParanoiaLevel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_rule.go b/services/cdn/v1betaapi/model_waf_rule.go new file mode 100644 index 000000000..232e37410 --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_rule.go @@ -0,0 +1,222 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WAFRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFRule{} + +// WAFRule struct for WAFRule +type WAFRule struct { + // Optional CoreRuleSet rule ID in case this is a CRS rule + Code *string `json:"code,omitempty"` + // LocalizedString is a map from language to string value + Description map[string]string `json:"description"` + Id string `json:"id"` +} + +type _WAFRule WAFRule + +// NewWAFRule instantiates a new WAFRule 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 NewWAFRule(description map[string]string, id string) *WAFRule { + this := WAFRule{} + this.Description = description + this.Id = id + return &this +} + +// NewWAFRuleWithDefaults instantiates a new WAFRule 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 NewWAFRuleWithDefaults() *WAFRule { + this := WAFRule{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *WAFRule) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WAFRule) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *WAFRule) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *WAFRule) SetCode(v string) { + o.Code = &v +} + +// GetDescription returns the Description field value +func (o *WAFRule) GetDescription() map[string]string { + if o == nil { + var ret map[string]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 *WAFRule) GetDescriptionOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *WAFRule) SetDescription(v map[string]string) { + o.Description = v +} + +// GetId returns the Id field value +func (o *WAFRule) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WAFRule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WAFRule) SetId(v string) { + o.Id = v +} + +func (o WAFRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + toSerialize["description"] = o.Description + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *WAFRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWAFRule := _WAFRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWAFRule) + + if err != nil { + return err + } + + *o = WAFRule(varWAFRule) + + return err +} + +type NullableWAFRule struct { + value *WAFRule + isSet bool +} + +func (v NullableWAFRule) Get() *WAFRule { + return v.value +} + +func (v *NullableWAFRule) Set(val *WAFRule) { + v.value = val + v.isSet = true +} + +func (v NullableWAFRule) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFRule(val *WAFRule) *NullableWAFRule { + return &NullableWAFRule{value: val, isSet: true} +} + +func (v NullableWAFRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_rule_action.go b/services/cdn/v1betaapi/model_waf_rule_action.go new file mode 100644 index 000000000..9435d93a3 --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_rule_action.go @@ -0,0 +1,112 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// WAFRuleAction The action a WAF rule can take based on a request +type WAFRuleAction string + +// List of WAFRuleAction +const ( + WAFRULEACTION_BLOCKED WAFRuleAction = "BLOCKED" + WAFRULEACTION_LOGGED WAFRuleAction = "LOGGED" + WAFRULEACTION_ALLOWED WAFRuleAction = "ALLOWED" +) + +// All allowed values of WAFRuleAction enum +var AllowedWAFRuleActionEnumValues = []WAFRuleAction{ + "BLOCKED", + "LOGGED", + "ALLOWED", +} + +func (v *WAFRuleAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WAFRuleAction(value) + for _, existing := range AllowedWAFRuleActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WAFRuleAction", value) +} + +// NewWAFRuleActionFromValue returns a pointer to a valid WAFRuleAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWAFRuleActionFromValue(v string) (*WAFRuleAction, error) { + ev := WAFRuleAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WAFRuleAction: valid values are %v", v, AllowedWAFRuleActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WAFRuleAction) IsValid() bool { + for _, existing := range AllowedWAFRuleActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WAFRuleAction value +func (v WAFRuleAction) Ptr() *WAFRuleAction { + return &v +} + +type NullableWAFRuleAction struct { + value *WAFRuleAction + isSet bool +} + +func (v NullableWAFRuleAction) Get() *WAFRuleAction { + return v.value +} + +func (v *NullableWAFRuleAction) Set(val *WAFRuleAction) { + v.value = val + v.isSet = true +} + +func (v NullableWAFRuleAction) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFRuleAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFRuleAction(val *WAFRuleAction) *NullableWAFRuleAction { + return &NullableWAFRuleAction{value: val, isSet: true} +} + +func (v NullableWAFRuleAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFRuleAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_rule_collection.go b/services/cdn/v1betaapi/model_waf_rule_collection.go new file mode 100644 index 000000000..00762c2fe --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_rule_collection.go @@ -0,0 +1,213 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WAFRuleCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFRuleCollection{} + +// WAFRuleCollection struct for WAFRuleCollection +type WAFRuleCollection struct { + Groups []WAFRuleGroup `json:"groups"` + Id string `json:"id"` + // LocalizedString is a map from language to string value + Name map[string]string `json:"name"` +} + +type _WAFRuleCollection WAFRuleCollection + +// NewWAFRuleCollection instantiates a new WAFRuleCollection 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 NewWAFRuleCollection(groups []WAFRuleGroup, id string, name map[string]string) *WAFRuleCollection { + this := WAFRuleCollection{} + this.Groups = groups + this.Id = id + this.Name = name + return &this +} + +// NewWAFRuleCollectionWithDefaults instantiates a new WAFRuleCollection 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 NewWAFRuleCollectionWithDefaults() *WAFRuleCollection { + this := WAFRuleCollection{} + return &this +} + +// GetGroups returns the Groups field value +func (o *WAFRuleCollection) GetGroups() []WAFRuleGroup { + if o == nil { + var ret []WAFRuleGroup + return ret + } + + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *WAFRuleCollection) GetGroupsOk() ([]WAFRuleGroup, bool) { + if o == nil { + return nil, false + } + return o.Groups, true +} + +// SetGroups sets field value +func (o *WAFRuleCollection) SetGroups(v []WAFRuleGroup) { + o.Groups = v +} + +// GetId returns the Id field value +func (o *WAFRuleCollection) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WAFRuleCollection) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WAFRuleCollection) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *WAFRuleCollection) GetName() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WAFRuleCollection) GetNameOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WAFRuleCollection) SetName(v map[string]string) { + o.Name = v +} + +func (o WAFRuleCollection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFRuleCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["groups"] = o.Groups + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *WAFRuleCollection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "groups", + "id", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWAFRuleCollection := _WAFRuleCollection{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWAFRuleCollection) + + if err != nil { + return err + } + + *o = WAFRuleCollection(varWAFRuleCollection) + + return err +} + +type NullableWAFRuleCollection struct { + value *WAFRuleCollection + isSet bool +} + +func (v NullableWAFRuleCollection) Get() *WAFRuleCollection { + return v.value +} + +func (v *NullableWAFRuleCollection) Set(val *WAFRuleCollection) { + v.value = val + v.isSet = true +} + +func (v NullableWAFRuleCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFRuleCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFRuleCollection(val *WAFRuleCollection) *NullableWAFRuleCollection { + return &NullableWAFRuleCollection{value: val, isSet: true} +} + +func (v NullableWAFRuleCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFRuleCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_rule_group.go b/services/cdn/v1betaapi/model_waf_rule_group.go new file mode 100644 index 000000000..52d7f8f0f --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_rule_group.go @@ -0,0 +1,214 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WAFRuleGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFRuleGroup{} + +// WAFRuleGroup struct for WAFRuleGroup +type WAFRuleGroup struct { + // LocalizedString is a map from language to string value + Description map[string]string `json:"description"` + // LocalizedString is a map from language to string value + Name map[string]string `json:"name"` + Rules []WAFRule `json:"rules"` +} + +type _WAFRuleGroup WAFRuleGroup + +// NewWAFRuleGroup instantiates a new WAFRuleGroup 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 NewWAFRuleGroup(description map[string]string, name map[string]string, rules []WAFRule) *WAFRuleGroup { + this := WAFRuleGroup{} + this.Description = description + this.Name = name + this.Rules = rules + return &this +} + +// NewWAFRuleGroupWithDefaults instantiates a new WAFRuleGroup 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 NewWAFRuleGroupWithDefaults() *WAFRuleGroup { + this := WAFRuleGroup{} + return &this +} + +// GetDescription returns the Description field value +func (o *WAFRuleGroup) GetDescription() map[string]string { + if o == nil { + var ret map[string]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 *WAFRuleGroup) GetDescriptionOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *WAFRuleGroup) SetDescription(v map[string]string) { + o.Description = v +} + +// GetName returns the Name field value +func (o *WAFRuleGroup) GetName() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WAFRuleGroup) GetNameOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WAFRuleGroup) SetName(v map[string]string) { + o.Name = v +} + +// GetRules returns the Rules field value +func (o *WAFRuleGroup) GetRules() []WAFRule { + if o == nil { + var ret []WAFRule + return ret + } + + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value +// and a boolean to check if the value has been set. +func (o *WAFRuleGroup) GetRulesOk() ([]WAFRule, bool) { + if o == nil { + return nil, false + } + return o.Rules, true +} + +// SetRules sets field value +func (o *WAFRuleGroup) SetRules(v []WAFRule) { + o.Rules = v +} + +func (o WAFRuleGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFRuleGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["description"] = o.Description + toSerialize["name"] = o.Name + toSerialize["rules"] = o.Rules + return toSerialize, nil +} + +func (o *WAFRuleGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "description", + "name", + "rules", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWAFRuleGroup := _WAFRuleGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWAFRuleGroup) + + if err != nil { + return err + } + + *o = WAFRuleGroup(varWAFRuleGroup) + + return err +} + +type NullableWAFRuleGroup struct { + value *WAFRuleGroup + isSet bool +} + +func (v NullableWAFRuleGroup) Get() *WAFRuleGroup { + return v.value +} + +func (v *NullableWAFRuleGroup) Set(val *WAFRuleGroup) { + v.value = val + v.isSet = true +} + +func (v NullableWAFRuleGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFRuleGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFRuleGroup(val *WAFRuleGroup) *NullableWAFRuleGroup { + return &NullableWAFRuleGroup{value: val, isSet: true} +} + +func (v NullableWAFRuleGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFRuleGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_status_rule_block.go b/services/cdn/v1betaapi/model_waf_status_rule_block.go new file mode 100644 index 000000000..b13c7f249 --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_status_rule_block.go @@ -0,0 +1,157 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WAFStatusRuleBlock type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFStatusRuleBlock{} + +// WAFStatusRuleBlock struct for WAFStatusRuleBlock +type WAFStatusRuleBlock struct { + // Specifies the ID of the Rule. + Id string `json:"id"` +} + +type _WAFStatusRuleBlock WAFStatusRuleBlock + +// NewWAFStatusRuleBlock instantiates a new WAFStatusRuleBlock 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 NewWAFStatusRuleBlock(id string) *WAFStatusRuleBlock { + this := WAFStatusRuleBlock{} + this.Id = id + return &this +} + +// NewWAFStatusRuleBlockWithDefaults instantiates a new WAFStatusRuleBlock 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 NewWAFStatusRuleBlockWithDefaults() *WAFStatusRuleBlock { + this := WAFStatusRuleBlock{} + return &this +} + +// GetId returns the Id field value +func (o *WAFStatusRuleBlock) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *WAFStatusRuleBlock) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *WAFStatusRuleBlock) SetId(v string) { + o.Id = v +} + +func (o WAFStatusRuleBlock) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFStatusRuleBlock) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *WAFStatusRuleBlock) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWAFStatusRuleBlock := _WAFStatusRuleBlock{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWAFStatusRuleBlock) + + if err != nil { + return err + } + + *o = WAFStatusRuleBlock(varWAFStatusRuleBlock) + + return err +} + +type NullableWAFStatusRuleBlock struct { + value *WAFStatusRuleBlock + isSet bool +} + +func (v NullableWAFStatusRuleBlock) Get() *WAFStatusRuleBlock { + return v.value +} + +func (v *NullableWAFStatusRuleBlock) Set(val *WAFStatusRuleBlock) { + v.value = val + v.isSet = true +} + +func (v NullableWAFStatusRuleBlock) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFStatusRuleBlock) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFStatusRuleBlock(val *WAFStatusRuleBlock) *NullableWAFStatusRuleBlock { + return &NullableWAFStatusRuleBlock{value: val, isSet: true} +} + +func (v NullableWAFStatusRuleBlock) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFStatusRuleBlock) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_type.go b/services/cdn/v1betaapi/model_waf_type.go new file mode 100644 index 000000000..cc7f57b44 --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_type.go @@ -0,0 +1,110 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" + "fmt" +) + +// WafType Enable or disable the Premium WAF. Do note that enabling the Premium WAF will cause additional fees. Some features are gated behind the Premium WAF, like additional, **premium-only rules** and the ability to create **custom rules** (not yet implemented) +type WafType string + +// List of WafType +const ( + WAFTYPE_FREE WafType = "FREE" + WAFTYPE_PREMIUM WafType = "PREMIUM" +) + +// All allowed values of WafType enum +var AllowedWafTypeEnumValues = []WafType{ + "FREE", + "PREMIUM", +} + +func (v *WafType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WafType(value) + for _, existing := range AllowedWafTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WafType", value) +} + +// NewWafTypeFromValue returns a pointer to a valid WafType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWafTypeFromValue(v string) (*WafType, error) { + ev := WafType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WafType: valid values are %v", v, AllowedWafTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WafType) IsValid() bool { + for _, existing := range AllowedWafTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WafType value +func (v WafType) Ptr() *WafType { + return &v +} + +type NullableWafType struct { + value *WafType + isSet bool +} + +func (v NullableWafType) Get() *WafType { + return v.value +} + +func (v *NullableWafType) Set(val *WafType) { + v.value = val + v.isSet = true +} + +func (v NullableWafType) IsSet() bool { + return v.isSet +} + +func (v *NullableWafType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWafType(val *WafType) *NullableWafType { + return &NullableWafType{value: val, isSet: true} +} + +func (v NullableWafType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWafType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/model_waf_violation.go b/services/cdn/v1betaapi/model_waf_violation.go new file mode 100644 index 000000000..f1852cc50 --- /dev/null +++ b/services/cdn/v1betaapi/model_waf_violation.go @@ -0,0 +1,300 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the WAFViolation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WAFViolation{} + +// WAFViolation Information about a violated WAF rule in case the WAF is enabled and a rule was triggered (either in BLOCK or LOG_ONLY mode) +type WAFViolation struct { + Action WAFRuleAction `json:"action"` + // ASN for the request + Asn string `json:"asn"` + // Rule specific message explaining the violation + Message string `json:"message"` + // HTTP Method of the request that triggered the violation + Method string `json:"method"` + RequestHeaders map[string]string `json:"requestHeaders"` + // ID of the WAF rule that was triggered + RuleId string `json:"ruleId"` +} + +type _WAFViolation WAFViolation + +// NewWAFViolation instantiates a new WAFViolation 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 NewWAFViolation(action WAFRuleAction, asn string, message string, method string, requestHeaders map[string]string, ruleId string) *WAFViolation { + this := WAFViolation{} + this.Action = action + this.Asn = asn + this.Message = message + this.Method = method + this.RequestHeaders = requestHeaders + this.RuleId = ruleId + return &this +} + +// NewWAFViolationWithDefaults instantiates a new WAFViolation 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 NewWAFViolationWithDefaults() *WAFViolation { + this := WAFViolation{} + return &this +} + +// GetAction returns the Action field value +func (o *WAFViolation) GetAction() WAFRuleAction { + if o == nil { + var ret WAFRuleAction + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetActionOk() (*WAFRuleAction, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *WAFViolation) SetAction(v WAFRuleAction) { + o.Action = v +} + +// GetAsn returns the Asn field value +func (o *WAFViolation) GetAsn() string { + if o == nil { + var ret string + return ret + } + + return o.Asn +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetAsnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Asn, true +} + +// SetAsn sets field value +func (o *WAFViolation) SetAsn(v string) { + o.Asn = v +} + +// GetMessage returns the Message field value +func (o *WAFViolation) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *WAFViolation) SetMessage(v string) { + o.Message = v +} + +// GetMethod returns the Method field value +func (o *WAFViolation) GetMethod() string { + if o == nil { + var ret string + return ret + } + + return o.Method +} + +// GetMethodOk returns a tuple with the Method field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetMethodOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Method, true +} + +// SetMethod sets field value +func (o *WAFViolation) SetMethod(v string) { + o.Method = v +} + +// GetRequestHeaders returns the RequestHeaders field value +func (o *WAFViolation) GetRequestHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.RequestHeaders +} + +// GetRequestHeadersOk returns a tuple with the RequestHeaders field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetRequestHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.RequestHeaders, true +} + +// SetRequestHeaders sets field value +func (o *WAFViolation) SetRequestHeaders(v map[string]string) { + o.RequestHeaders = v +} + +// GetRuleId returns the RuleId field value +func (o *WAFViolation) GetRuleId() string { + if o == nil { + var ret string + return ret + } + + return o.RuleId +} + +// GetRuleIdOk returns a tuple with the RuleId field value +// and a boolean to check if the value has been set. +func (o *WAFViolation) GetRuleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RuleId, true +} + +// SetRuleId sets field value +func (o *WAFViolation) SetRuleId(v string) { + o.RuleId = v +} + +func (o WAFViolation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WAFViolation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["action"] = o.Action + toSerialize["asn"] = o.Asn + toSerialize["message"] = o.Message + toSerialize["method"] = o.Method + toSerialize["requestHeaders"] = o.RequestHeaders + toSerialize["ruleId"] = o.RuleId + return toSerialize, nil +} + +func (o *WAFViolation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "action", + "asn", + "message", + "method", + "requestHeaders", + "ruleId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWAFViolation := _WAFViolation{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varWAFViolation) + + if err != nil { + return err + } + + *o = WAFViolation(varWAFViolation) + + return err +} + +type NullableWAFViolation struct { + value *WAFViolation + isSet bool +} + +func (v NullableWAFViolation) Get() *WAFViolation { + return v.value +} + +func (v *NullableWAFViolation) Set(val *WAFViolation) { + v.value = val + v.isSet = true +} + +func (v NullableWAFViolation) IsSet() bool { + return v.isSet +} + +func (v *NullableWAFViolation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWAFViolation(val *WAFViolation) *NullableWAFViolation { + return &NullableWAFViolation{value: val, isSet: true} +} + +func (v NullableWAFViolation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWAFViolation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/cdn/v1betaapi/response.go b/services/cdn/v1betaapi/response.go new file mode 100644 index 000000000..4ca9f57a8 --- /dev/null +++ b/services/cdn/v1betaapi/response.go @@ -0,0 +1,47 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/cdn/v1betaapi/utils.go b/services/cdn/v1betaapi/utils.go new file mode 100644 index 000000000..ab551eb36 --- /dev/null +++ b/services/cdn/v1betaapi/utils.go @@ -0,0 +1,361 @@ +/* +CDN API + +API used to create and manage your CDN distributions. + +API version: 1beta.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/cdn/wait/deprecation.go b/services/cdn/wait/deprecation.go new file mode 100644 index 000000000..58f184c09 --- /dev/null +++ b/services/cdn/wait/deprecation.go @@ -0,0 +1,2 @@ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package wait