diff --git a/CHANGELOG.md b/CHANGELOG.md index f71dfcee8..23865f558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ - **Breaking Change:** Introduce typed enum constants for status attributes - `git`: [v0.3.2](services/git/CHANGELOG.md#v032-2025-05-02) - **Bugfix**: Spelling corrections in documentation +- `cdn`[v1.0.0](services/cdn/CHANGELOG.md#v100-2025-05-02) + - **Feature:** Support for log management + - **Feature:** Create distribution payload has additional optional attributes for blocked countries, IPs and volume limitation + - **Feature:** Config Patch payload has additional optional attributes for blocked countries, IPs and volume limitation + - **Breaking Change:** Config has additional required attributes for blocked countries, IPs and volume limitation - `alb`: [v0.2.2](services/alb/CHANGELOG.md#v022-2025-05-02) - **Feature:** Switch to beta2 API diff --git a/services/cdn/CHANGELOG.md b/services/cdn/CHANGELOG.md index 7f7c68d97..eae103a97 100644 --- a/services/cdn/CHANGELOG.md +++ b/services/cdn/CHANGELOG.md @@ -1,3 +1,9 @@ +## v1.0.0 (2025-05-02) +- **Feature:** Support for log management +- **Feature:** Create distribution payload has additional optional attributes for blocked countries, IPs and volume limitation +- **Feature:** Config Patch payload has additional optional attributes for blocked countries, IPs and volume limitation +- **Breaking Change:** Config has additional required attributes for blocked countries, IPs and volume limitation + ## v0.3.1 (2025-04-29) - **Bugfix:** Correctly handle empty payload in body diff --git a/services/cdn/api_default.go b/services/cdn/api_default.go index e2e0d32c1..10d00b7ff 100644 --- a/services/cdn/api_default.go +++ b/services/cdn/api_default.go @@ -187,7 +187,7 @@ 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's ID + @param projectId Your STACKIT Project ID @return ApiCreateDistributionRequest */ func (a *APIClient) CreateDistribution(ctx context.Context, projectId string) ApiCreateDistributionRequest { @@ -361,7 +361,7 @@ 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's ID + @param projectId Your STACKIT Project ID @param distributionId @param domain @return ApiDeleteCustomDomainRequest @@ -538,7 +538,7 @@ 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's ID + @param projectId Your STACKIT Project ID @param distributionId @return ApiDeleteDistributionRequest */ @@ -726,7 +726,7 @@ this would return the following paths, in the following order, assuming `/te` wa - `/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's ID + @param projectId Your STACKIT Project ID @param distributionId @return ApiFindCachePathsRequest */ @@ -901,7 +901,7 @@ If (and only if) you provide the path query parameter, the history will also con 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's ID + @param projectId Your STACKIT Project ID @param distributionId @return ApiGetCacheInfoRequest */ @@ -1080,7 +1080,7 @@ 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's ID + @param projectId Your STACKIT Project ID @param distributionId @param domain @return ApiGetCustomDomainRequest @@ -1257,7 +1257,7 @@ 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's ID + @param projectId Your STACKIT Project ID @param distributionId @return ApiGetDistributionRequest */ @@ -1280,6 +1280,231 @@ func (a *APIClient) GetDistributionExecute(ctx context.Context, projectId string return r.Execute() } +type ApiGetLogsRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + distributionId string + from *time.Time + to *time.Time + pageSize *int32 + pageIdentifier *string + sortBy *string + sortOrder *string +} + +// 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 +} + +// The following sort options exist. We default to `timestamp` - `timestamp` - Sort by log message time stamp. + +func (r ApiGetLogsRequest) SortBy(sortBy string) ApiGetLogsRequest { + r.sortBy = &sortBy + return r +} + +func (r ApiGetLogsRequest) SortOrder(sortOrder string) ApiGetLogsRequest { + r.sortOrder = &sortOrder + return r +} + +func (r ApiGetLogsRequest) Execute() (*GetLogsResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetLogsResponse + ) + a := r.apiService + 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, "") + } + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageSize", r.pageSize, "") + } + if r.pageIdentifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pageIdentifier", r.pageIdentifier, "") + } + if r.sortBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortBy", r.sortBy, "") + } + if r.sortOrder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sortOrder", r.sortOrder, "") + } + // 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{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + 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 + } + 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 + } + 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 + } + 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 + } + + 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 +} + +/* +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 *APIClient) GetLogs(ctx context.Context, projectId string, distributionId string) ApiGetLogsRequest { + return ApiGetLogsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } +} + +func (a *APIClient) GetLogsExecute(ctx context.Context, projectId string, distributionId string) (*GetLogsResponse, error) { + r := ApiGetLogsRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + distributionId: distributionId, + } + return r.Execute() +} + type ApiGetStatisticsRequest struct { ctx context.Context apiService *DefaultApiService @@ -1297,7 +1522,7 @@ func (r ApiGetStatisticsRequest) From(from time.Time) ApiGetStatisticsRequest { return r } -// the end of the time range for which statistics should be returned. If not specified, the end of the current time's interval is used, e.g. next day for daily, next month for monthly, and so on. +// 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 @@ -1464,7 +1689,7 @@ The upper bound is optional. If you omit it, the API will use the start of the n 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's ID + @param projectId Your STACKIT Project ID @param distributionId @return ApiGetStatisticsRequest */ @@ -1511,7 +1736,7 @@ func (r ApiListDistributionsRequest) PageIdentifier(pageIdentifier string) ApiLi return r } -// The following sort options exist. We default to `createdAt` - `id` - Sort by the distributions's ID using String comparison - `updatedAt` - Sort by when the distribution's 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 looking at the distribution's status, using String comparison +// 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 func (r ApiListDistributionsRequest) SortBy(sortBy string) ApiListDistributionsRequest { r.sortBy = &sortBy @@ -1668,7 +1893,7 @@ 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's ID + @param projectId Your STACKIT Project ID @return ApiListDistributionsRequest */ func (a *APIClient) ListDistributions(ctx context.Context, projectId string) ApiListDistributionsRequest { @@ -1836,7 +2061,7 @@ 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's ID + @param projectId Your STACKIT Project ID @param distributionId @return ApiPatchDistributionRequest */ @@ -2002,13 +2227,13 @@ func (r ApiPurgeCacheRequest) Execute() (map[string]interface{}, error) { } /* -PurgeCache: Clear distribution's cache +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's ID + @param projectId Your STACKIT Project ID @param distributionId @return ApiPurgeCacheRequest */ @@ -2184,7 +2409,7 @@ 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's ID + @param projectId Your STACKIT Project ID @param distributionId @param domain @return ApiPutCustomDomainRequest diff --git a/services/cdn/api_default_test.go b/services/cdn/api_default_test.go index 073861a64..4fa69de4f 100644 --- a/services/cdn/api_default_test.go +++ b/services/cdn/api_default_test.go @@ -415,6 +415,61 @@ func Test_cdn_DefaultApiService(t *testing.T) { } }) + t.Run("Test DefaultApiService GetLogs", func(t *testing.T) { + _apiUrlPath := "/v1beta/projects/{projectId}/distributions/{distributionId}/logs" + projectIdValue := "projectId-value" + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + distributionIdValue := uuid.NewString() + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"distributionId"+"}", url.PathEscape(ParameterValueToString(distributionIdValue, "distributionId")), -1) + + testDefaultApiServeMux := http.NewServeMux() + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { + data := GetLogsResponse{} + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(data) + }) + testServer := httptest.NewServer(testDefaultApiServeMux) + defer testServer.Close() + + configuration := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Region: "test_region", + Servers: config.ServerConfigurations{ + { + URL: testServer.URL, + Description: "Localhost for cdn_DefaultApi", + Variables: map[string]config.ServerVariable{ + "region": { + DefaultValue: "test_region.", + EnumValues: []string{ + "test_region.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) + if err != nil { + t.Fatalf("creating API client: %v", err) + } + + projectId := projectIdValue + distributionId := distributionIdValue + + resp, reqErr := apiClient.GetLogs(context.Background(), projectId, distributionId).Execute() + + if reqErr != nil { + t.Fatalf("error in call: %v", reqErr) + } + if IsNil(resp) { + t.Fatalf("response not present") + } + }) + t.Run("Test DefaultApiService GetStatistics", func(t *testing.T) { _apiUrlPath := "/v1beta/projects/{projectId}/distributions/{distributionId}/statistics" projectIdValue := "projectId-value" diff --git a/services/cdn/model_config.go b/services/cdn/model_config.go index e7819e958..49dfe1f1b 100644 --- a/services/cdn/model_config.go +++ b/services/cdn/model_config.go @@ -37,6 +37,66 @@ func setConfigGetBackendAttributeType(arg *ConfigGetBackendAttributeType, val Co *arg = &val } +/* + types and functions for blockedCountries +*/ + +// isArray +type ConfigGetBlockedCountriesAttributeType = *[]string +type ConfigGetBlockedCountriesArgType = []string +type ConfigGetBlockedCountriesRetType = []string + +func getConfigGetBlockedCountriesAttributeTypeOk(arg ConfigGetBlockedCountriesAttributeType) (ret ConfigGetBlockedCountriesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setConfigGetBlockedCountriesAttributeType(arg *ConfigGetBlockedCountriesAttributeType, val ConfigGetBlockedCountriesRetType) { + *arg = &val +} + +/* + types and functions for blockedIPs +*/ + +// isArray +type ConfigGetBlockedIPsAttributeType = *[]string +type ConfigGetBlockedIPsArgType = []string +type ConfigGetBlockedIPsRetType = []string + +func getConfigGetBlockedIPsAttributeTypeOk(arg ConfigGetBlockedIPsAttributeType) (ret ConfigGetBlockedIPsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setConfigGetBlockedIPsAttributeType(arg *ConfigGetBlockedIPsAttributeType, val ConfigGetBlockedIPsRetType) { + *arg = &val +} + +/* + types and functions for monthlyLimitBytes +*/ + +// isLong +type ConfigGetMonthlyLimitBytesAttributeType = *int64 +type ConfigGetMonthlyLimitBytesArgType = *int64 +type ConfigGetMonthlyLimitBytesRetType = *int64 + +func getConfigGetMonthlyLimitBytesAttributeTypeOk(arg ConfigGetMonthlyLimitBytesAttributeType) (ret ConfigGetMonthlyLimitBytesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setConfigGetMonthlyLimitBytesAttributeType(arg *ConfigGetMonthlyLimitBytesAttributeType, val ConfigGetMonthlyLimitBytesRetType) { + *arg = val +} + /* types and functions for regions */ @@ -61,6 +121,14 @@ func setConfigGetRegionsAttributeType(arg *ConfigGetRegionsAttributeType, val Co type Config struct { // REQUIRED Backend ConfigGetBackendAttributeType `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. + // REQUIRED + BlockedCountries ConfigGetBlockedCountriesAttributeType `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. + // REQUIRED + BlockedIPs ConfigGetBlockedIPsAttributeType `json:"blockedIPs"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes ConfigGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,omitempty"` // REQUIRED Regions ConfigGetRegionsAttributeType `json:"regions"` } @@ -71,9 +139,11 @@ type _Config Config // This constructor will assign default values to properties that have it defined, // 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 ConfigGetBackendArgType, regions ConfigGetRegionsArgType) *Config { +func NewConfig(backend ConfigGetBackendArgType, blockedCountries ConfigGetBlockedCountriesArgType, blockedIPs ConfigGetBlockedIPsArgType, regions ConfigGetRegionsArgType) *Config { this := Config{} setConfigGetBackendAttributeType(&this.Backend, backend) + setConfigGetBlockedCountriesAttributeType(&this.BlockedCountries, blockedCountries) + setConfigGetBlockedIPsAttributeType(&this.BlockedIPs, blockedIPs) setConfigGetRegionsAttributeType(&this.Regions, regions) return &this } @@ -103,6 +173,74 @@ func (o *Config) SetBackend(v ConfigGetBackendRetType) { setConfigGetBackendAttributeType(&o.Backend, v) } +// GetBlockedCountries returns the BlockedCountries field value +func (o *Config) GetBlockedCountries() (ret ConfigGetBlockedCountriesRetType) { + ret, _ = o.GetBlockedCountriesOk() + return ret +} + +// GetBlockedCountriesOk returns a tuple with the BlockedCountries field value +// and a boolean to check if the value has been set. +func (o *Config) GetBlockedCountriesOk() (ret ConfigGetBlockedCountriesRetType, ok bool) { + return getConfigGetBlockedCountriesAttributeTypeOk(o.BlockedCountries) +} + +// SetBlockedCountries sets field value +func (o *Config) SetBlockedCountries(v ConfigGetBlockedCountriesRetType) { + setConfigGetBlockedCountriesAttributeType(&o.BlockedCountries, v) +} + +// GetBlockedIPs returns the BlockedIPs field value +func (o *Config) GetBlockedIPs() (ret ConfigGetBlockedIPsRetType) { + ret, _ = o.GetBlockedIPsOk() + return ret +} + +// GetBlockedIPsOk returns a tuple with the BlockedIPs field value +// and a boolean to check if the value has been set. +func (o *Config) GetBlockedIPsOk() (ret ConfigGetBlockedIPsRetType, ok bool) { + return getConfigGetBlockedIPsAttributeTypeOk(o.BlockedIPs) +} + +// SetBlockedIPs sets field value +func (o *Config) SetBlockedIPs(v ConfigGetBlockedIPsRetType) { + setConfigGetBlockedIPsAttributeType(&o.BlockedIPs, 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() (res ConfigGetMonthlyLimitBytesRetType) { + res, _ = o.GetMonthlyLimitBytesOk() + return +} + +// 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() (ret ConfigGetMonthlyLimitBytesRetType, ok bool) { + return getConfigGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes) +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +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. +func (o *Config) SetMonthlyLimitBytes(v ConfigGetMonthlyLimitBytesRetType) { + setConfigGetMonthlyLimitBytesAttributeType(&o.MonthlyLimitBytes, v) +} + +// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +func (o *Config) SetMonthlyLimitBytesNil() { + o.MonthlyLimitBytes = nil +} + +// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +func (o *Config) UnsetMonthlyLimitBytes() { + o.MonthlyLimitBytes = nil +} + // GetRegions returns the Regions field value func (o *Config) GetRegions() (ret ConfigGetRegionsRetType) { ret, _ = o.GetRegionsOk() @@ -125,6 +263,15 @@ func (o Config) ToMap() (map[string]interface{}, error) { if val, ok := getConfigGetBackendAttributeTypeOk(o.Backend); ok { toSerialize["Backend"] = val } + if val, ok := getConfigGetBlockedCountriesAttributeTypeOk(o.BlockedCountries); ok { + toSerialize["BlockedCountries"] = val + } + if val, ok := getConfigGetBlockedIPsAttributeTypeOk(o.BlockedIPs); ok { + toSerialize["BlockedIPs"] = val + } + if val, ok := getConfigGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok { + toSerialize["MonthlyLimitBytes"] = val + } if val, ok := getConfigGetRegionsAttributeTypeOk(o.Regions); ok { toSerialize["Regions"] = val } diff --git a/services/cdn/model_config_patch.go b/services/cdn/model_config_patch.go index 40dd3370e..c3222cd80 100644 --- a/services/cdn/model_config_patch.go +++ b/services/cdn/model_config_patch.go @@ -37,6 +37,66 @@ func setConfigPatchGetBackendAttributeType(arg *ConfigPatchGetBackendAttributeTy *arg = &val } +/* + types and functions for blockedCountries +*/ + +// isArray +type ConfigPatchGetBlockedCountriesAttributeType = *[]string +type ConfigPatchGetBlockedCountriesArgType = []string +type ConfigPatchGetBlockedCountriesRetType = []string + +func getConfigPatchGetBlockedCountriesAttributeTypeOk(arg ConfigPatchGetBlockedCountriesAttributeType) (ret ConfigPatchGetBlockedCountriesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setConfigPatchGetBlockedCountriesAttributeType(arg *ConfigPatchGetBlockedCountriesAttributeType, val ConfigPatchGetBlockedCountriesRetType) { + *arg = &val +} + +/* + types and functions for blockedIPs +*/ + +// isArray +type ConfigPatchGetBlockedIPsAttributeType = *[]string +type ConfigPatchGetBlockedIPsArgType = []string +type ConfigPatchGetBlockedIPsRetType = []string + +func getConfigPatchGetBlockedIPsAttributeTypeOk(arg ConfigPatchGetBlockedIPsAttributeType) (ret ConfigPatchGetBlockedIPsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setConfigPatchGetBlockedIPsAttributeType(arg *ConfigPatchGetBlockedIPsAttributeType, val ConfigPatchGetBlockedIPsRetType) { + *arg = &val +} + +/* + types and functions for monthlyLimitBytes +*/ + +// isLong +type ConfigPatchGetMonthlyLimitBytesAttributeType = *int64 +type ConfigPatchGetMonthlyLimitBytesArgType = *int64 +type ConfigPatchGetMonthlyLimitBytesRetType = *int64 + +func getConfigPatchGetMonthlyLimitBytesAttributeTypeOk(arg ConfigPatchGetMonthlyLimitBytesAttributeType) (ret ConfigPatchGetMonthlyLimitBytesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +func setConfigPatchGetMonthlyLimitBytesAttributeType(arg *ConfigPatchGetMonthlyLimitBytesAttributeType, val ConfigPatchGetMonthlyLimitBytesRetType) { + *arg = val +} + /* types and functions for regions */ @@ -60,7 +120,13 @@ func setConfigPatchGetRegionsAttributeType(arg *ConfigPatchGetRegionsAttributeTy // ConfigPatch struct for ConfigPatch type ConfigPatch struct { Backend ConfigPatchGetBackendAttributeType `json:"backend,omitempty"` - Regions ConfigPatchGetRegionsAttributeType `json:"regions,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 ConfigPatchGetBlockedCountriesAttributeType `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 ConfigPatchGetBlockedIPsAttributeType `json:"blockedIPs,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes ConfigPatchGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,omitempty"` + Regions ConfigPatchGetRegionsAttributeType `json:"regions,omitempty"` } // NewConfigPatch instantiates a new ConfigPatch object @@ -103,6 +169,86 @@ func (o *ConfigPatch) SetBackend(v ConfigPatchGetBackendRetType) { setConfigPatchGetBackendAttributeType(&o.Backend, v) } +// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +func (o *ConfigPatch) GetBlockedCountries() (res ConfigPatchGetBlockedCountriesRetType) { + res, _ = o.GetBlockedCountriesOk() + return +} + +// 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() (ret ConfigPatchGetBlockedCountriesRetType, ok bool) { + return getConfigPatchGetBlockedCountriesAttributeTypeOk(o.BlockedCountries) +} + +// HasBlockedCountries returns a boolean if a field has been set. +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. +func (o *ConfigPatch) SetBlockedCountries(v ConfigPatchGetBlockedCountriesRetType) { + setConfigPatchGetBlockedCountriesAttributeType(&o.BlockedCountries, v) +} + +// GetBlockedIPs returns the BlockedIPs field value if set, zero value otherwise. +func (o *ConfigPatch) GetBlockedIPs() (res ConfigPatchGetBlockedIPsRetType) { + res, _ = o.GetBlockedIPsOk() + return +} + +// 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() (ret ConfigPatchGetBlockedIPsRetType, ok bool) { + return getConfigPatchGetBlockedIPsAttributeTypeOk(o.BlockedIPs) +} + +// HasBlockedIPs returns a boolean if a field has been set. +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. +func (o *ConfigPatch) SetBlockedIPs(v ConfigPatchGetBlockedIPsRetType) { + setConfigPatchGetBlockedIPsAttributeType(&o.BlockedIPs, v) +} + +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConfigPatch) GetMonthlyLimitBytes() (res ConfigPatchGetMonthlyLimitBytesRetType) { + res, _ = o.GetMonthlyLimitBytesOk() + return +} + +// 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() (ret ConfigPatchGetMonthlyLimitBytesRetType, ok bool) { + return getConfigPatchGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes) +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +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. +func (o *ConfigPatch) SetMonthlyLimitBytes(v ConfigPatchGetMonthlyLimitBytesRetType) { + setConfigPatchGetMonthlyLimitBytesAttributeType(&o.MonthlyLimitBytes, v) +} + +// SetMonthlyLimitBytesNil sets the value for MonthlyLimitBytes to be an explicit nil +func (o *ConfigPatch) SetMonthlyLimitBytesNil() { + o.MonthlyLimitBytes = nil +} + +// UnsetMonthlyLimitBytes ensures that no value is present for MonthlyLimitBytes, not even an explicit nil +func (o *ConfigPatch) UnsetMonthlyLimitBytes() { + o.MonthlyLimitBytes = nil +} + // GetRegions returns the Regions field value if set, zero value otherwise. func (o *ConfigPatch) GetRegions() (res ConfigPatchGetRegionsRetType) { res, _ = o.GetRegionsOk() @@ -131,6 +277,15 @@ func (o ConfigPatch) ToMap() (map[string]interface{}, error) { if val, ok := getConfigPatchGetBackendAttributeTypeOk(o.Backend); ok { toSerialize["Backend"] = val } + if val, ok := getConfigPatchGetBlockedCountriesAttributeTypeOk(o.BlockedCountries); ok { + toSerialize["BlockedCountries"] = val + } + if val, ok := getConfigPatchGetBlockedIPsAttributeTypeOk(o.BlockedIPs); ok { + toSerialize["BlockedIPs"] = val + } + if val, ok := getConfigPatchGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok { + toSerialize["MonthlyLimitBytes"] = val + } if val, ok := getConfigPatchGetRegionsAttributeTypeOk(o.Regions); ok { toSerialize["Regions"] = val } diff --git a/services/cdn/model_create_distribution_payload.go b/services/cdn/model_create_distribution_payload.go index 2af6baaa5..97a83312b 100644 --- a/services/cdn/model_create_distribution_payload.go +++ b/services/cdn/model_create_distribution_payload.go @@ -17,6 +17,46 @@ import ( // checks if the CreateDistributionPayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateDistributionPayload{} +/* + types and functions for blockedCountries +*/ + +// isArray +type CreateDistributionPayloadGetBlockedCountriesAttributeType = *[]string +type CreateDistributionPayloadGetBlockedCountriesArgType = []string +type CreateDistributionPayloadGetBlockedCountriesRetType = []string + +func getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(arg CreateDistributionPayloadGetBlockedCountriesAttributeType) (ret CreateDistributionPayloadGetBlockedCountriesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateDistributionPayloadGetBlockedCountriesAttributeType(arg *CreateDistributionPayloadGetBlockedCountriesAttributeType, val CreateDistributionPayloadGetBlockedCountriesRetType) { + *arg = &val +} + +/* + types and functions for blockedIPs +*/ + +// isArray +type CreateDistributionPayloadGetBlockedIPsAttributeType = *[]string +type CreateDistributionPayloadGetBlockedIPsArgType = []string +type CreateDistributionPayloadGetBlockedIPsRetType = []string + +func getCreateDistributionPayloadGetBlockedIPsAttributeTypeOk(arg CreateDistributionPayloadGetBlockedIPsAttributeType) (ret CreateDistributionPayloadGetBlockedIPsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateDistributionPayloadGetBlockedIPsAttributeType(arg *CreateDistributionPayloadGetBlockedIPsAttributeType, val CreateDistributionPayloadGetBlockedIPsRetType) { + *arg = &val +} + /* types and functions for intentId */ @@ -38,6 +78,26 @@ func setCreateDistributionPayloadGetIntentIdAttributeType(arg *CreateDistributio type CreateDistributionPayloadGetIntentIdArgType = string type CreateDistributionPayloadGetIntentIdRetType = string +/* + types and functions for monthlyLimitBytes +*/ + +// isLong +type CreateDistributionPayloadGetMonthlyLimitBytesAttributeType = *int64 +type CreateDistributionPayloadGetMonthlyLimitBytesArgType = int64 +type CreateDistributionPayloadGetMonthlyLimitBytesRetType = int64 + +func getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(arg CreateDistributionPayloadGetMonthlyLimitBytesAttributeType) (ret CreateDistributionPayloadGetMonthlyLimitBytesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateDistributionPayloadGetMonthlyLimitBytesAttributeType(arg *CreateDistributionPayloadGetMonthlyLimitBytesAttributeType, val CreateDistributionPayloadGetMonthlyLimitBytesRetType) { + *arg = &val +} + /* types and functions for originRequestHeaders */ @@ -101,8 +161,14 @@ func setCreateDistributionPayloadGetRegionsAttributeType(arg *CreateDistribution // 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 CreateDistributionPayloadGetBlockedCountriesAttributeType `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 CreateDistributionPayloadGetBlockedIPsAttributeType `json:"blockedIPs,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 CreateDistributionPayloadGetIntentIdAttributeType `json:"intentId,omitempty"` + // Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use. + MonthlyLimitBytes CreateDistributionPayloadGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,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 CreateDistributionPayloadGetOriginRequestHeadersAttributeType `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` @@ -134,6 +200,52 @@ func NewCreateDistributionPayloadWithDefaults() *CreateDistributionPayload { return &this } +// GetBlockedCountries returns the BlockedCountries field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetBlockedCountries() (res CreateDistributionPayloadGetBlockedCountriesRetType) { + res, _ = o.GetBlockedCountriesOk() + return +} + +// 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() (ret CreateDistributionPayloadGetBlockedCountriesRetType, ok bool) { + return getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(o.BlockedCountries) +} + +// HasBlockedCountries returns a boolean if a field has been set. +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. +func (o *CreateDistributionPayload) SetBlockedCountries(v CreateDistributionPayloadGetBlockedCountriesRetType) { + setCreateDistributionPayloadGetBlockedCountriesAttributeType(&o.BlockedCountries, v) +} + +// GetBlockedIPs returns the BlockedIPs field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetBlockedIPs() (res CreateDistributionPayloadGetBlockedIPsRetType) { + res, _ = o.GetBlockedIPsOk() + return +} + +// 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() (ret CreateDistributionPayloadGetBlockedIPsRetType, ok bool) { + return getCreateDistributionPayloadGetBlockedIPsAttributeTypeOk(o.BlockedIPs) +} + +// HasBlockedIPs returns a boolean if a field has been set. +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. +func (o *CreateDistributionPayload) SetBlockedIPs(v CreateDistributionPayloadGetBlockedIPsRetType) { + setCreateDistributionPayloadGetBlockedIPsAttributeType(&o.BlockedIPs, v) +} + // GetIntentId returns the IntentId field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetIntentId() (res CreateDistributionPayloadGetIntentIdRetType) { res, _ = o.GetIntentIdOk() @@ -157,6 +269,29 @@ func (o *CreateDistributionPayload) SetIntentId(v CreateDistributionPayloadGetIn setCreateDistributionPayloadGetIntentIdAttributeType(&o.IntentId, v) } +// GetMonthlyLimitBytes returns the MonthlyLimitBytes field value if set, zero value otherwise. +func (o *CreateDistributionPayload) GetMonthlyLimitBytes() (res CreateDistributionPayloadGetMonthlyLimitBytesRetType) { + res, _ = o.GetMonthlyLimitBytesOk() + return +} + +// 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() (ret CreateDistributionPayloadGetMonthlyLimitBytesRetType, ok bool) { + return getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes) +} + +// HasMonthlyLimitBytes returns a boolean if a field has been set. +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. +func (o *CreateDistributionPayload) SetMonthlyLimitBytes(v CreateDistributionPayloadGetMonthlyLimitBytesRetType) { + setCreateDistributionPayloadGetMonthlyLimitBytesAttributeType(&o.MonthlyLimitBytes, v) +} + // GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise. func (o *CreateDistributionPayload) GetOriginRequestHeaders() (res CreateDistributionPayloadGetOriginRequestHeadersRetType) { res, _ = o.GetOriginRequestHeadersOk() @@ -216,9 +351,18 @@ func (o *CreateDistributionPayload) SetRegions(v CreateDistributionPayloadGetReg func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if val, ok := getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(o.BlockedCountries); ok { + toSerialize["BlockedCountries"] = val + } + if val, ok := getCreateDistributionPayloadGetBlockedIPsAttributeTypeOk(o.BlockedIPs); ok { + toSerialize["BlockedIPs"] = val + } if val, ok := getCreateDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId); ok { toSerialize["IntentId"] = val } + if val, ok := getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok { + toSerialize["MonthlyLimitBytes"] = val + } if val, ok := getCreateDistributionPayloadGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders); ok { toSerialize["OriginRequestHeaders"] = val } diff --git a/services/cdn/model_distribution.go b/services/cdn/model_distribution.go index 69c327557..dab9fb9d4 100644 --- a/services/cdn/model_distribution.go +++ b/services/cdn/model_distribution.go @@ -198,7 +198,7 @@ type Distribution struct { // - `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. // REQUIRED Status DistributionGetStatusAttributeType `json:"status"` - // RFC3339 string which returns the last time the distribution's configuration was modified. + // RFC3339 string which returns the last time the distribution configuration was modified. // REQUIRED UpdatedAt DistributionGetUpdatedAtAttributeType `json:"updatedAt"` } diff --git a/services/cdn/model_distribution_logs_record.go b/services/cdn/model_distribution_logs_record.go new file mode 100644 index 000000000..f9ba32e90 --- /dev/null +++ b/services/cdn/model_distribution_logs_record.go @@ -0,0 +1,477 @@ +/* +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 cdn + +import ( + "encoding/json" + "time" +) + +// checks if the DistributionLogsRecord type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DistributionLogsRecord{} + +/* + types and functions for cacheHit +*/ + +// isBoolean +type DistributionLogsRecordgetCacheHitAttributeType = *bool +type DistributionLogsRecordgetCacheHitArgType = bool +type DistributionLogsRecordgetCacheHitRetType = bool + +func getDistributionLogsRecordgetCacheHitAttributeTypeOk(arg DistributionLogsRecordgetCacheHitAttributeType) (ret DistributionLogsRecordgetCacheHitRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordgetCacheHitAttributeType(arg *DistributionLogsRecordgetCacheHitAttributeType, val DistributionLogsRecordgetCacheHitRetType) { + *arg = &val +} + +/* + types and functions for dataCenterRegion +*/ + +// isNotNullableString +type DistributionLogsRecordGetDataCenterRegionAttributeType = *string + +func getDistributionLogsRecordGetDataCenterRegionAttributeTypeOk(arg DistributionLogsRecordGetDataCenterRegionAttributeType) (ret DistributionLogsRecordGetDataCenterRegionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordGetDataCenterRegionAttributeType(arg *DistributionLogsRecordGetDataCenterRegionAttributeType, val DistributionLogsRecordGetDataCenterRegionRetType) { + *arg = &val +} + +type DistributionLogsRecordGetDataCenterRegionArgType = string +type DistributionLogsRecordGetDataCenterRegionRetType = string + +/* + types and functions for distributionID +*/ + +// isNotNullableString +type DistributionLogsRecordGetDistributionIDAttributeType = *string + +func getDistributionLogsRecordGetDistributionIDAttributeTypeOk(arg DistributionLogsRecordGetDistributionIDAttributeType) (ret DistributionLogsRecordGetDistributionIDRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordGetDistributionIDAttributeType(arg *DistributionLogsRecordGetDistributionIDAttributeType, val DistributionLogsRecordGetDistributionIDRetType) { + *arg = &val +} + +type DistributionLogsRecordGetDistributionIDArgType = string +type DistributionLogsRecordGetDistributionIDRetType = string + +/* + types and functions for host +*/ + +// isNotNullableString +type DistributionLogsRecordGetHostAttributeType = *string + +func getDistributionLogsRecordGetHostAttributeTypeOk(arg DistributionLogsRecordGetHostAttributeType) (ret DistributionLogsRecordGetHostRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordGetHostAttributeType(arg *DistributionLogsRecordGetHostAttributeType, val DistributionLogsRecordGetHostRetType) { + *arg = &val +} + +type DistributionLogsRecordGetHostArgType = string +type DistributionLogsRecordGetHostRetType = string + +/* + types and functions for path +*/ + +// isNotNullableString +type DistributionLogsRecordGetPathAttributeType = *string + +func getDistributionLogsRecordGetPathAttributeTypeOk(arg DistributionLogsRecordGetPathAttributeType) (ret DistributionLogsRecordGetPathRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordGetPathAttributeType(arg *DistributionLogsRecordGetPathAttributeType, val DistributionLogsRecordGetPathRetType) { + *arg = &val +} + +type DistributionLogsRecordGetPathArgType = string +type DistributionLogsRecordGetPathRetType = string + +/* + types and functions for requestCountryCode +*/ + +// isNotNullableString +type DistributionLogsRecordGetRequestCountryCodeAttributeType = *string + +func getDistributionLogsRecordGetRequestCountryCodeAttributeTypeOk(arg DistributionLogsRecordGetRequestCountryCodeAttributeType) (ret DistributionLogsRecordGetRequestCountryCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordGetRequestCountryCodeAttributeType(arg *DistributionLogsRecordGetRequestCountryCodeAttributeType, val DistributionLogsRecordGetRequestCountryCodeRetType) { + *arg = &val +} + +type DistributionLogsRecordGetRequestCountryCodeArgType = string +type DistributionLogsRecordGetRequestCountryCodeRetType = string + +/* + types and functions for size +*/ + +// isLong +type DistributionLogsRecordGetSizeAttributeType = *int64 +type DistributionLogsRecordGetSizeArgType = int64 +type DistributionLogsRecordGetSizeRetType = int64 + +func getDistributionLogsRecordGetSizeAttributeTypeOk(arg DistributionLogsRecordGetSizeAttributeType) (ret DistributionLogsRecordGetSizeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordGetSizeAttributeType(arg *DistributionLogsRecordGetSizeAttributeType, val DistributionLogsRecordGetSizeRetType) { + *arg = &val +} + +/* + types and functions for statusCode +*/ + +// isInteger +type DistributionLogsRecordGetStatusCodeAttributeType = *int64 +type DistributionLogsRecordGetStatusCodeArgType = int64 +type DistributionLogsRecordGetStatusCodeRetType = int64 + +func getDistributionLogsRecordGetStatusCodeAttributeTypeOk(arg DistributionLogsRecordGetStatusCodeAttributeType) (ret DistributionLogsRecordGetStatusCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordGetStatusCodeAttributeType(arg *DistributionLogsRecordGetStatusCodeAttributeType, val DistributionLogsRecordGetStatusCodeRetType) { + *arg = &val +} + +/* + types and functions for timestamp +*/ + +// isDateTime +type DistributionLogsRecordGetTimestampAttributeType = *time.Time +type DistributionLogsRecordGetTimestampArgType = time.Time +type DistributionLogsRecordGetTimestampRetType = time.Time + +func getDistributionLogsRecordGetTimestampAttributeTypeOk(arg DistributionLogsRecordGetTimestampAttributeType) (ret DistributionLogsRecordGetTimestampRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setDistributionLogsRecordGetTimestampAttributeType(arg *DistributionLogsRecordGetTimestampAttributeType, val DistributionLogsRecordGetTimestampRetType) { + *arg = &val +} + +// DistributionLogsRecord struct for DistributionLogsRecord +type DistributionLogsRecord struct { + // REQUIRED + CacheHit DistributionLogsRecordgetCacheHitAttributeType `json:"cacheHit"` + // REQUIRED + DataCenterRegion DistributionLogsRecordGetDataCenterRegionAttributeType `json:"dataCenterRegion"` + // REQUIRED + DistributionID DistributionLogsRecordGetDistributionIDAttributeType `json:"distributionID"` + // REQUIRED + Host DistributionLogsRecordGetHostAttributeType `json:"host"` + // REQUIRED + Path DistributionLogsRecordGetPathAttributeType `json:"path"` + // ISO 3166-1 A2 compliant country code + // REQUIRED + RequestCountryCode DistributionLogsRecordGetRequestCountryCodeAttributeType `json:"requestCountryCode"` + // REQUIRED + Size DistributionLogsRecordGetSizeAttributeType `json:"size"` + // Can be cast to int32 without loss of precision. + // REQUIRED + StatusCode DistributionLogsRecordGetStatusCodeAttributeType `json:"statusCode"` + // REQUIRED + Timestamp DistributionLogsRecordGetTimestampAttributeType `json:"timestamp"` +} + +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 DistributionLogsRecordgetCacheHitArgType, dataCenterRegion DistributionLogsRecordGetDataCenterRegionArgType, distributionID DistributionLogsRecordGetDistributionIDArgType, host DistributionLogsRecordGetHostArgType, path DistributionLogsRecordGetPathArgType, requestCountryCode DistributionLogsRecordGetRequestCountryCodeArgType, size DistributionLogsRecordGetSizeArgType, statusCode DistributionLogsRecordGetStatusCodeArgType, timestamp DistributionLogsRecordGetTimestampArgType) *DistributionLogsRecord { + this := DistributionLogsRecord{} + setDistributionLogsRecordgetCacheHitAttributeType(&this.CacheHit, cacheHit) + setDistributionLogsRecordGetDataCenterRegionAttributeType(&this.DataCenterRegion, dataCenterRegion) + setDistributionLogsRecordGetDistributionIDAttributeType(&this.DistributionID, distributionID) + setDistributionLogsRecordGetHostAttributeType(&this.Host, host) + setDistributionLogsRecordGetPathAttributeType(&this.Path, path) + setDistributionLogsRecordGetRequestCountryCodeAttributeType(&this.RequestCountryCode, requestCountryCode) + setDistributionLogsRecordGetSizeAttributeType(&this.Size, size) + setDistributionLogsRecordGetStatusCodeAttributeType(&this.StatusCode, statusCode) + setDistributionLogsRecordGetTimestampAttributeType(&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() (ret DistributionLogsRecordgetCacheHitRetType) { + ret, _ = o.GetCacheHitOk() + return ret +} + +// GetCacheHitOk returns a tuple with the CacheHit field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetCacheHitOk() (ret DistributionLogsRecordgetCacheHitRetType, ok bool) { + return getDistributionLogsRecordgetCacheHitAttributeTypeOk(o.CacheHit) +} + +// SetCacheHit sets field value +func (o *DistributionLogsRecord) SetCacheHit(v DistributionLogsRecordgetCacheHitRetType) { + setDistributionLogsRecordgetCacheHitAttributeType(&o.CacheHit, v) +} + +// GetDataCenterRegion returns the DataCenterRegion field value +func (o *DistributionLogsRecord) GetDataCenterRegion() (ret DistributionLogsRecordGetDataCenterRegionRetType) { + ret, _ = o.GetDataCenterRegionOk() + return ret +} + +// GetDataCenterRegionOk returns a tuple with the DataCenterRegion field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetDataCenterRegionOk() (ret DistributionLogsRecordGetDataCenterRegionRetType, ok bool) { + return getDistributionLogsRecordGetDataCenterRegionAttributeTypeOk(o.DataCenterRegion) +} + +// SetDataCenterRegion sets field value +func (o *DistributionLogsRecord) SetDataCenterRegion(v DistributionLogsRecordGetDataCenterRegionRetType) { + setDistributionLogsRecordGetDataCenterRegionAttributeType(&o.DataCenterRegion, v) +} + +// GetDistributionID returns the DistributionID field value +func (o *DistributionLogsRecord) GetDistributionID() (ret DistributionLogsRecordGetDistributionIDRetType) { + ret, _ = o.GetDistributionIDOk() + return ret +} + +// GetDistributionIDOk returns a tuple with the DistributionID field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetDistributionIDOk() (ret DistributionLogsRecordGetDistributionIDRetType, ok bool) { + return getDistributionLogsRecordGetDistributionIDAttributeTypeOk(o.DistributionID) +} + +// SetDistributionID sets field value +func (o *DistributionLogsRecord) SetDistributionID(v DistributionLogsRecordGetDistributionIDRetType) { + setDistributionLogsRecordGetDistributionIDAttributeType(&o.DistributionID, v) +} + +// GetHost returns the Host field value +func (o *DistributionLogsRecord) GetHost() (ret DistributionLogsRecordGetHostRetType) { + ret, _ = o.GetHostOk() + return ret +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetHostOk() (ret DistributionLogsRecordGetHostRetType, ok bool) { + return getDistributionLogsRecordGetHostAttributeTypeOk(o.Host) +} + +// SetHost sets field value +func (o *DistributionLogsRecord) SetHost(v DistributionLogsRecordGetHostRetType) { + setDistributionLogsRecordGetHostAttributeType(&o.Host, v) +} + +// GetPath returns the Path field value +func (o *DistributionLogsRecord) GetPath() (ret DistributionLogsRecordGetPathRetType) { + ret, _ = o.GetPathOk() + return ret +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetPathOk() (ret DistributionLogsRecordGetPathRetType, ok bool) { + return getDistributionLogsRecordGetPathAttributeTypeOk(o.Path) +} + +// SetPath sets field value +func (o *DistributionLogsRecord) SetPath(v DistributionLogsRecordGetPathRetType) { + setDistributionLogsRecordGetPathAttributeType(&o.Path, v) +} + +// GetRequestCountryCode returns the RequestCountryCode field value +func (o *DistributionLogsRecord) GetRequestCountryCode() (ret DistributionLogsRecordGetRequestCountryCodeRetType) { + ret, _ = o.GetRequestCountryCodeOk() + return ret +} + +// GetRequestCountryCodeOk returns a tuple with the RequestCountryCode field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetRequestCountryCodeOk() (ret DistributionLogsRecordGetRequestCountryCodeRetType, ok bool) { + return getDistributionLogsRecordGetRequestCountryCodeAttributeTypeOk(o.RequestCountryCode) +} + +// SetRequestCountryCode sets field value +func (o *DistributionLogsRecord) SetRequestCountryCode(v DistributionLogsRecordGetRequestCountryCodeRetType) { + setDistributionLogsRecordGetRequestCountryCodeAttributeType(&o.RequestCountryCode, v) +} + +// GetSize returns the Size field value +func (o *DistributionLogsRecord) GetSize() (ret DistributionLogsRecordGetSizeRetType) { + ret, _ = o.GetSizeOk() + return ret +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetSizeOk() (ret DistributionLogsRecordGetSizeRetType, ok bool) { + return getDistributionLogsRecordGetSizeAttributeTypeOk(o.Size) +} + +// SetSize sets field value +func (o *DistributionLogsRecord) SetSize(v DistributionLogsRecordGetSizeRetType) { + setDistributionLogsRecordGetSizeAttributeType(&o.Size, v) +} + +// GetStatusCode returns the StatusCode field value +func (o *DistributionLogsRecord) GetStatusCode() (ret DistributionLogsRecordGetStatusCodeRetType) { + ret, _ = o.GetStatusCodeOk() + return ret +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetStatusCodeOk() (ret DistributionLogsRecordGetStatusCodeRetType, ok bool) { + return getDistributionLogsRecordGetStatusCodeAttributeTypeOk(o.StatusCode) +} + +// SetStatusCode sets field value +func (o *DistributionLogsRecord) SetStatusCode(v DistributionLogsRecordGetStatusCodeRetType) { + setDistributionLogsRecordGetStatusCodeAttributeType(&o.StatusCode, v) +} + +// GetTimestamp returns the Timestamp field value +func (o *DistributionLogsRecord) GetTimestamp() (ret DistributionLogsRecordGetTimestampRetType) { + ret, _ = o.GetTimestampOk() + return ret +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *DistributionLogsRecord) GetTimestampOk() (ret DistributionLogsRecordGetTimestampRetType, ok bool) { + return getDistributionLogsRecordGetTimestampAttributeTypeOk(o.Timestamp) +} + +// SetTimestamp sets field value +func (o *DistributionLogsRecord) SetTimestamp(v DistributionLogsRecordGetTimestampRetType) { + setDistributionLogsRecordGetTimestampAttributeType(&o.Timestamp, v) +} + +func (o DistributionLogsRecord) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getDistributionLogsRecordgetCacheHitAttributeTypeOk(o.CacheHit); ok { + toSerialize["CacheHit"] = val + } + if val, ok := getDistributionLogsRecordGetDataCenterRegionAttributeTypeOk(o.DataCenterRegion); ok { + toSerialize["DataCenterRegion"] = val + } + if val, ok := getDistributionLogsRecordGetDistributionIDAttributeTypeOk(o.DistributionID); ok { + toSerialize["DistributionID"] = val + } + if val, ok := getDistributionLogsRecordGetHostAttributeTypeOk(o.Host); ok { + toSerialize["Host"] = val + } + if val, ok := getDistributionLogsRecordGetPathAttributeTypeOk(o.Path); ok { + toSerialize["Path"] = val + } + if val, ok := getDistributionLogsRecordGetRequestCountryCodeAttributeTypeOk(o.RequestCountryCode); ok { + toSerialize["RequestCountryCode"] = val + } + if val, ok := getDistributionLogsRecordGetSizeAttributeTypeOk(o.Size); ok { + toSerialize["Size"] = val + } + if val, ok := getDistributionLogsRecordGetStatusCodeAttributeTypeOk(o.StatusCode); ok { + toSerialize["StatusCode"] = val + } + if val, ok := getDistributionLogsRecordGetTimestampAttributeTypeOk(o.Timestamp); ok { + toSerialize["Timestamp"] = val + } + return toSerialize, nil +} + +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/model_error_details.go b/services/cdn/model_error_details.go new file mode 100644 index 000000000..1fcfb8dea --- /dev/null +++ b/services/cdn/model_error_details.go @@ -0,0 +1,316 @@ +/* +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 cdn + +import ( + "encoding/json" +) + +// checks if the ErrorDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorDetails{} + +/* + types and functions for de +*/ + +// isNotNullableString +type ErrorDetailsGetDeAttributeType = *string + +func getErrorDetailsGetDeAttributeTypeOk(arg ErrorDetailsGetDeAttributeType) (ret ErrorDetailsGetDeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorDetailsGetDeAttributeType(arg *ErrorDetailsGetDeAttributeType, val ErrorDetailsGetDeRetType) { + *arg = &val +} + +type ErrorDetailsGetDeArgType = string +type ErrorDetailsGetDeRetType = string + +/* + types and functions for description +*/ + +// isNotNullableString +type ErrorDetailsGetDescriptionAttributeType = *string + +func getErrorDetailsGetDescriptionAttributeTypeOk(arg ErrorDetailsGetDescriptionAttributeType) (ret ErrorDetailsGetDescriptionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorDetailsGetDescriptionAttributeType(arg *ErrorDetailsGetDescriptionAttributeType, val ErrorDetailsGetDescriptionRetType) { + *arg = &val +} + +type ErrorDetailsGetDescriptionArgType = string +type ErrorDetailsGetDescriptionRetType = string + +/* + types and functions for en +*/ + +// isNotNullableString +type ErrorDetailsGetEnAttributeType = *string + +func getErrorDetailsGetEnAttributeTypeOk(arg ErrorDetailsGetEnAttributeType) (ret ErrorDetailsGetEnRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorDetailsGetEnAttributeType(arg *ErrorDetailsGetEnAttributeType, val ErrorDetailsGetEnRetType) { + *arg = &val +} + +type ErrorDetailsGetEnArgType = string +type ErrorDetailsGetEnRetType = string + +/* + types and functions for field +*/ + +// isNotNullableString +type ErrorDetailsGetFieldAttributeType = *string + +func getErrorDetailsGetFieldAttributeTypeOk(arg ErrorDetailsGetFieldAttributeType) (ret ErrorDetailsGetFieldRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorDetailsGetFieldAttributeType(arg *ErrorDetailsGetFieldAttributeType, val ErrorDetailsGetFieldRetType) { + *arg = &val +} + +type ErrorDetailsGetFieldArgType = string +type ErrorDetailsGetFieldRetType = string + +/* + types and functions for key +*/ + +// isEnumRef +type ErrorDetailsGetKeyAttributeType = *string +type ErrorDetailsGetKeyArgType = string +type ErrorDetailsGetKeyRetType = string + +func getErrorDetailsGetKeyAttributeTypeOk(arg ErrorDetailsGetKeyAttributeType) (ret ErrorDetailsGetKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setErrorDetailsGetKeyAttributeType(arg *ErrorDetailsGetKeyAttributeType, val ErrorDetailsGetKeyRetType) { + *arg = &val +} + +// ErrorDetails struct for ErrorDetails +type ErrorDetails struct { + // German description of the error + De ErrorDetailsGetDeAttributeType `json:"de,omitempty"` + // Deprecated: Check the GitHub changelog for alternatives + // REQUIRED + Description ErrorDetailsGetDescriptionAttributeType `json:"description"` + // English description of the error + // REQUIRED + En ErrorDetailsGetEnAttributeType `json:"en"` + // Optional field in the request this error detail refers to + Field ErrorDetailsGetFieldAttributeType `json:"field,omitempty"` + // REQUIRED + Key ErrorDetailsGetKeyAttributeType `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 ErrorDetailsGetDescriptionArgType, en ErrorDetailsGetEnArgType, key ErrorDetailsGetKeyArgType) *ErrorDetails { + this := ErrorDetails{} + setErrorDetailsGetDescriptionAttributeType(&this.Description, description) + setErrorDetailsGetEnAttributeType(&this.En, en) + setErrorDetailsGetKeyAttributeType(&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() (res ErrorDetailsGetDeRetType) { + res, _ = o.GetDeOk() + return +} + +// 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() (ret ErrorDetailsGetDeRetType, ok bool) { + return getErrorDetailsGetDeAttributeTypeOk(o.De) +} + +// HasDe returns a boolean if a field has been set. +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. +func (o *ErrorDetails) SetDe(v ErrorDetailsGetDeRetType) { + setErrorDetailsGetDeAttributeType(&o.De, v) +} + +// GetDescription returns the Description field value +// Deprecated +func (o *ErrorDetails) GetDescription() (ret ErrorDetailsGetDescriptionRetType) { + ret, _ = o.GetDescriptionOk() + return ret +} + +// 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() (ret ErrorDetailsGetDescriptionRetType, ok bool) { + return getErrorDetailsGetDescriptionAttributeTypeOk(o.Description) +} + +// SetDescription sets field value +// Deprecated +func (o *ErrorDetails) SetDescription(v ErrorDetailsGetDescriptionRetType) { + setErrorDetailsGetDescriptionAttributeType(&o.Description, v) +} + +// GetEn returns the En field value +func (o *ErrorDetails) GetEn() (ret ErrorDetailsGetEnRetType) { + ret, _ = o.GetEnOk() + return ret +} + +// GetEnOk returns a tuple with the En field value +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetEnOk() (ret ErrorDetailsGetEnRetType, ok bool) { + return getErrorDetailsGetEnAttributeTypeOk(o.En) +} + +// SetEn sets field value +func (o *ErrorDetails) SetEn(v ErrorDetailsGetEnRetType) { + setErrorDetailsGetEnAttributeType(&o.En, v) +} + +// GetField returns the Field field value if set, zero value otherwise. +func (o *ErrorDetails) GetField() (res ErrorDetailsGetFieldRetType) { + res, _ = o.GetFieldOk() + return +} + +// 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() (ret ErrorDetailsGetFieldRetType, ok bool) { + return getErrorDetailsGetFieldAttributeTypeOk(o.Field) +} + +// HasField returns a boolean if a field has been set. +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. +func (o *ErrorDetails) SetField(v ErrorDetailsGetFieldRetType) { + setErrorDetailsGetFieldAttributeType(&o.Field, v) +} + +// GetKey returns the Key field value +func (o *ErrorDetails) GetKey() (ret ErrorDetailsGetKeyRetType) { + ret, _ = o.GetKeyOk() + return ret +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *ErrorDetails) GetKeyOk() (ret ErrorDetailsGetKeyRetType, ok bool) { + return getErrorDetailsGetKeyAttributeTypeOk(o.Key) +} + +// SetKey sets field value +func (o *ErrorDetails) SetKey(v ErrorDetailsGetKeyRetType) { + setErrorDetailsGetKeyAttributeType(&o.Key, v) +} + +func (o ErrorDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getErrorDetailsGetDeAttributeTypeOk(o.De); ok { + toSerialize["De"] = val + } + if val, ok := getErrorDetailsGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getErrorDetailsGetEnAttributeTypeOk(o.En); ok { + toSerialize["En"] = val + } + if val, ok := getErrorDetailsGetFieldAttributeTypeOk(o.Field); ok { + toSerialize["Field"] = val + } + if val, ok := getErrorDetailsGetKeyAttributeTypeOk(o.Key); ok { + toSerialize["Key"] = val + } + return toSerialize, nil +} + +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/model_generic_json_response.go b/services/cdn/model_generic_json_response.go index 104bbf67d..41634bb6e 100644 --- a/services/cdn/model_generic_json_response.go +++ b/services/cdn/model_generic_json_response.go @@ -22,9 +22,9 @@ var _ MappedNullable = &GenericJSONResponse{} */ // isArray -type GenericJSONResponseGetDetailsAttributeType = *[]GenericJSONResponseDetailsInner -type GenericJSONResponseGetDetailsArgType = []GenericJSONResponseDetailsInner -type GenericJSONResponseGetDetailsRetType = []GenericJSONResponseDetailsInner +type GenericJSONResponseGetDetailsAttributeType = *[]ErrorDetails +type GenericJSONResponseGetDetailsArgType = []ErrorDetails +type GenericJSONResponseGetDetailsRetType = []ErrorDetails func getGenericJSONResponseGetDetailsAttributeTypeOk(arg GenericJSONResponseGetDetailsAttributeType) (ret GenericJSONResponseGetDetailsRetType, ok bool) { if arg == nil { @@ -104,7 +104,7 @@ func (o *GenericJSONResponse) HasDetails() bool { return ok } -// SetDetails gets a reference to the given []GenericJSONResponseDetailsInner and assigns it to the Details field. +// SetDetails gets a reference to the given []ErrorDetails and assigns it to the Details field. func (o *GenericJSONResponse) SetDetails(v GenericJSONResponseGetDetailsRetType) { setGenericJSONResponseGetDetailsAttributeType(&o.Details, v) } diff --git a/services/cdn/model_generic_json_response_details_inner.go b/services/cdn/model_generic_json_response_details_inner.go deleted file mode 100644 index 7515904d7..000000000 --- a/services/cdn/model_generic_json_response_details_inner.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -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 cdn - -import ( - "encoding/json" -) - -// checks if the GenericJSONResponseDetailsInner type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GenericJSONResponseDetailsInner{} - -/* - types and functions for description -*/ - -// isNotNullableString -type GenericJSONResponseDetailsInnerGetDescriptionAttributeType = *string - -func getGenericJSONResponseDetailsInnerGetDescriptionAttributeTypeOk(arg GenericJSONResponseDetailsInnerGetDescriptionAttributeType) (ret GenericJSONResponseDetailsInnerGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setGenericJSONResponseDetailsInnerGetDescriptionAttributeType(arg *GenericJSONResponseDetailsInnerGetDescriptionAttributeType, val GenericJSONResponseDetailsInnerGetDescriptionRetType) { - *arg = &val -} - -type GenericJSONResponseDetailsInnerGetDescriptionArgType = string -type GenericJSONResponseDetailsInnerGetDescriptionRetType = string - -/* - types and functions for field -*/ - -// isNotNullableString -type GenericJSONResponseDetailsInnerGetFieldAttributeType = *string - -func getGenericJSONResponseDetailsInnerGetFieldAttributeTypeOk(arg GenericJSONResponseDetailsInnerGetFieldAttributeType) (ret GenericJSONResponseDetailsInnerGetFieldRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setGenericJSONResponseDetailsInnerGetFieldAttributeType(arg *GenericJSONResponseDetailsInnerGetFieldAttributeType, val GenericJSONResponseDetailsInnerGetFieldRetType) { - *arg = &val -} - -type GenericJSONResponseDetailsInnerGetFieldArgType = string -type GenericJSONResponseDetailsInnerGetFieldRetType = string - -// GenericJSONResponseDetailsInner struct for GenericJSONResponseDetailsInner -type GenericJSONResponseDetailsInner struct { - // REQUIRED - Description GenericJSONResponseDetailsInnerGetDescriptionAttributeType `json:"description"` - // REQUIRED - Field GenericJSONResponseDetailsInnerGetFieldAttributeType `json:"field"` -} - -type _GenericJSONResponseDetailsInner GenericJSONResponseDetailsInner - -// NewGenericJSONResponseDetailsInner instantiates a new GenericJSONResponseDetailsInner object -// This constructor will assign default values to properties that have it defined, -// 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 NewGenericJSONResponseDetailsInner(description GenericJSONResponseDetailsInnerGetDescriptionArgType, field GenericJSONResponseDetailsInnerGetFieldArgType) *GenericJSONResponseDetailsInner { - this := GenericJSONResponseDetailsInner{} - setGenericJSONResponseDetailsInnerGetDescriptionAttributeType(&this.Description, description) - setGenericJSONResponseDetailsInnerGetFieldAttributeType(&this.Field, field) - return &this -} - -// NewGenericJSONResponseDetailsInnerWithDefaults instantiates a new GenericJSONResponseDetailsInner object -// This 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 NewGenericJSONResponseDetailsInnerWithDefaults() *GenericJSONResponseDetailsInner { - this := GenericJSONResponseDetailsInner{} - return &this -} - -// GetDescription returns the Description field value -func (o *GenericJSONResponseDetailsInner) GetDescription() (ret GenericJSONResponseDetailsInnerGetDescriptionRetType) { - ret, _ = o.GetDescriptionOk() - return ret -} - -// GetDescriptionOk returns a tuple with the Description field value -// and a boolean to check if the value has been set. -func (o *GenericJSONResponseDetailsInner) GetDescriptionOk() (ret GenericJSONResponseDetailsInnerGetDescriptionRetType, ok bool) { - return getGenericJSONResponseDetailsInnerGetDescriptionAttributeTypeOk(o.Description) -} - -// SetDescription sets field value -func (o *GenericJSONResponseDetailsInner) SetDescription(v GenericJSONResponseDetailsInnerGetDescriptionRetType) { - setGenericJSONResponseDetailsInnerGetDescriptionAttributeType(&o.Description, v) -} - -// GetField returns the Field field value -func (o *GenericJSONResponseDetailsInner) GetField() (ret GenericJSONResponseDetailsInnerGetFieldRetType) { - ret, _ = o.GetFieldOk() - return ret -} - -// GetFieldOk returns a tuple with the Field field value -// and a boolean to check if the value has been set. -func (o *GenericJSONResponseDetailsInner) GetFieldOk() (ret GenericJSONResponseDetailsInnerGetFieldRetType, ok bool) { - return getGenericJSONResponseDetailsInnerGetFieldAttributeTypeOk(o.Field) -} - -// SetField sets field value -func (o *GenericJSONResponseDetailsInner) SetField(v GenericJSONResponseDetailsInnerGetFieldRetType) { - setGenericJSONResponseDetailsInnerGetFieldAttributeType(&o.Field, v) -} - -func (o GenericJSONResponseDetailsInner) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getGenericJSONResponseDetailsInnerGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getGenericJSONResponseDetailsInnerGetFieldAttributeTypeOk(o.Field); ok { - toSerialize["Field"] = val - } - return toSerialize, nil -} - -type NullableGenericJSONResponseDetailsInner struct { - value *GenericJSONResponseDetailsInner - isSet bool -} - -func (v NullableGenericJSONResponseDetailsInner) Get() *GenericJSONResponseDetailsInner { - return v.value -} - -func (v *NullableGenericJSONResponseDetailsInner) Set(val *GenericJSONResponseDetailsInner) { - v.value = val - v.isSet = true -} - -func (v NullableGenericJSONResponseDetailsInner) IsSet() bool { - return v.isSet -} - -func (v *NullableGenericJSONResponseDetailsInner) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGenericJSONResponseDetailsInner(val *GenericJSONResponseDetailsInner) *NullableGenericJSONResponseDetailsInner { - return &NullableGenericJSONResponseDetailsInner{value: val, isSet: true} -} - -func (v NullableGenericJSONResponseDetailsInner) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGenericJSONResponseDetailsInner) 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 new file mode 100644 index 000000000..05efaf1ee --- /dev/null +++ b/services/cdn/model_get_logs_response.go @@ -0,0 +1,173 @@ +/* +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 cdn + +import ( + "encoding/json" +) + +// checks if the GetLogsResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLogsResponse{} + +/* + types and functions for logs +*/ + +// isArray +type GetLogsResponseGetLogsAttributeType = *[]DistributionLogsRecord +type GetLogsResponseGetLogsArgType = []DistributionLogsRecord +type GetLogsResponseGetLogsRetType = []DistributionLogsRecord + +func getGetLogsResponseGetLogsAttributeTypeOk(arg GetLogsResponseGetLogsAttributeType) (ret GetLogsResponseGetLogsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetLogsResponseGetLogsAttributeType(arg *GetLogsResponseGetLogsAttributeType, val GetLogsResponseGetLogsRetType) { + *arg = &val +} + +/* + types and functions for nextPageIdentifier +*/ + +// isNotNullableString +type GetLogsResponseGetNextPageIdentifierAttributeType = *string + +func getGetLogsResponseGetNextPageIdentifierAttributeTypeOk(arg GetLogsResponseGetNextPageIdentifierAttributeType) (ret GetLogsResponseGetNextPageIdentifierRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetLogsResponseGetNextPageIdentifierAttributeType(arg *GetLogsResponseGetNextPageIdentifierAttributeType, val GetLogsResponseGetNextPageIdentifierRetType) { + *arg = &val +} + +type GetLogsResponseGetNextPageIdentifierArgType = string +type GetLogsResponseGetNextPageIdentifierRetType = string + +// GetLogsResponse struct for GetLogsResponse +type GetLogsResponse struct { + // REQUIRED + Logs GetLogsResponseGetLogsAttributeType `json:"logs"` + NextPageIdentifier GetLogsResponseGetNextPageIdentifierAttributeType `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 GetLogsResponseGetLogsArgType) *GetLogsResponse { + this := GetLogsResponse{} + setGetLogsResponseGetLogsAttributeType(&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() (ret GetLogsResponseGetLogsRetType) { + ret, _ = o.GetLogsOk() + return ret +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *GetLogsResponse) GetLogsOk() (ret GetLogsResponseGetLogsRetType, ok bool) { + return getGetLogsResponseGetLogsAttributeTypeOk(o.Logs) +} + +// SetLogs sets field value +func (o *GetLogsResponse) SetLogs(v GetLogsResponseGetLogsRetType) { + setGetLogsResponseGetLogsAttributeType(&o.Logs, v) +} + +// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise. +func (o *GetLogsResponse) GetNextPageIdentifier() (res GetLogsResponseGetNextPageIdentifierRetType) { + res, _ = o.GetNextPageIdentifierOk() + return +} + +// 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() (ret GetLogsResponseGetNextPageIdentifierRetType, ok bool) { + return getGetLogsResponseGetNextPageIdentifierAttributeTypeOk(o.NextPageIdentifier) +} + +// HasNextPageIdentifier returns a boolean if a field has been set. +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. +func (o *GetLogsResponse) SetNextPageIdentifier(v GetLogsResponseGetNextPageIdentifierRetType) { + setGetLogsResponseGetNextPageIdentifierAttributeType(&o.NextPageIdentifier, v) +} + +func (o GetLogsResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetLogsResponseGetLogsAttributeTypeOk(o.Logs); ok { + toSerialize["Logs"] = val + } + if val, ok := getGetLogsResponseGetNextPageIdentifierAttributeTypeOk(o.NextPageIdentifier); ok { + toSerialize["NextPageIdentifier"] = val + } + return toSerialize, nil +} + +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) +}