feat: auto generated files and new structure (#4)
## Description
<!-- **Please link some issue here describing what you are trying to achieve.**
In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->
relates to #1234
## Checklist
- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)
Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
This commit is contained in:
parent
979220be66
commit
9f41c4da7f
1283 changed files with 273211 additions and 4614 deletions
1
pkg/cdnbeta/.openapi-generator/VERSION
Normal file
1
pkg/cdnbeta/.openapi-generator/VERSION
Normal file
|
|
@ -0,0 +1 @@
|
|||
6.6.0
|
||||
3137
pkg/cdnbeta/api_default.go
Normal file
3137
pkg/cdnbeta/api_default.go
Normal file
File diff suppressed because it is too large
Load diff
801
pkg/cdnbeta/api_default_test.go
Normal file
801
pkg/cdnbeta/api_default_test.go
Normal file
|
|
@ -0,0 +1,801 @@
|
|||
/*
|
||||
CDN API
|
||||
|
||||
Testing DefaultApiService
|
||||
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
|
||||
|
||||
package cdnbeta
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stackitcloud/stackit-sdk-go/core/config"
|
||||
)
|
||||
|
||||
func Test_cdnbeta_DefaultApiService(t *testing.T) {
|
||||
|
||||
t.Run("Test DefaultApiService CreateDistribution", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := CreateDistributionResponse{}
|
||||
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 cdnbeta_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
|
||||
createDistributionPayload := CreateDistributionPayload{}
|
||||
|
||||
resp, reqErr := apiClient.CreateDistribution(context.Background(), projectId).CreateDistributionPayload(createDistributionPayload).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService DeleteCustomDomain", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}"
|
||||
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)
|
||||
domainValue := randString(72)
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"domain"+"}", url.PathEscape(ParameterValueToString(domainValue, "domain")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := DeleteCustomDomainResponse{}
|
||||
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 cdnbeta_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
|
||||
domain := domainValue
|
||||
|
||||
resp, reqErr := apiClient.DeleteCustomDomain(context.Background(), projectId, distributionId, domain).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService DeleteDistribution", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}"
|
||||
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 := DeleteDistributionResponse{}
|
||||
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 cdnbeta_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.DeleteDistribution(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 FindCachePaths", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache/paths"
|
||||
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 := FindCachePathsResponse{}
|
||||
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 cdnbeta_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
|
||||
var path string
|
||||
|
||||
resp, reqErr := apiClient.FindCachePaths(context.Background(), projectId, distributionId).Path(path).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService GetCacheInfo", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache"
|
||||
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 := GetCacheInfoResponse{}
|
||||
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 cdnbeta_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.GetCacheInfo(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 GetCustomDomain", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}"
|
||||
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)
|
||||
domainValue := randString(72)
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"domain"+"}", url.PathEscape(ParameterValueToString(domainValue, "domain")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := GetCustomDomainResponse{}
|
||||
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 cdnbeta_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
|
||||
domain := domainValue
|
||||
|
||||
resp, reqErr := apiClient.GetCustomDomain(context.Background(), projectId, distributionId, domain).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService GetDistribution", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}"
|
||||
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 := GetDistributionResponse{}
|
||||
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 cdnbeta_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.GetDistribution(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 GetLogs", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/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 cdnbeta_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 := "/v1beta2/projects/{projectId}/distributions/{distributionId}/statistics"
|
||||
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 := GetStatisticsResponse{}
|
||||
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 cdnbeta_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
|
||||
var from time.Time
|
||||
|
||||
resp, reqErr := apiClient.GetStatistics(context.Background(), projectId, distributionId).From(from).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService ListDistributions", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := ListDistributionsResponse{}
|
||||
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 cdnbeta_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
|
||||
|
||||
resp, reqErr := apiClient.ListDistributions(context.Background(), projectId).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService ListWafCollections", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/waf/collections"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := ListWafCollectionsResponse{}
|
||||
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 cdnbeta_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
|
||||
|
||||
resp, reqErr := apiClient.ListWafCollections(context.Background(), projectId).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Test DefaultApiService PatchDistribution", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}"
|
||||
projectIdValue := "projectId-value"
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1)
|
||||
distributionIdValue := "distributionId-value"
|
||||
_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 := PatchDistributionResponse{}
|
||||
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 cdnbeta_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.PatchDistribution(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 PurgeCache", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}/cache/purge"
|
||||
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 := map[string]interface{}{}
|
||||
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 cdnbeta_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.PurgeCache(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 PutCustomDomain", func(t *testing.T) {
|
||||
_apiUrlPath := "/v1beta2/projects/{projectId}/distributions/{distributionId}/customDomains/{domain}"
|
||||
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)
|
||||
domainValue := randString(72)
|
||||
_apiUrlPath = strings.Replace(_apiUrlPath, "{"+"domain"+"}", url.PathEscape(ParameterValueToString(domainValue, "domain")), -1)
|
||||
|
||||
testDefaultApiServeMux := http.NewServeMux()
|
||||
testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) {
|
||||
data := PutCustomDomainResponse{}
|
||||
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 cdnbeta_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
|
||||
domain := domainValue
|
||||
|
||||
resp, reqErr := apiClient.PutCustomDomain(context.Background(), projectId, distributionId, domain).Execute()
|
||||
|
||||
if reqErr != nil {
|
||||
t.Fatalf("error in call: %v", reqErr)
|
||||
}
|
||||
if IsNil(resp) {
|
||||
t.Fatalf("response not present")
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
628
pkg/cdnbeta/client.go
Normal file
628
pkg/cdnbeta/client.go
Normal file
|
|
@ -0,0 +1,628 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"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)/(?:vnd\.[^;]+\+)?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.
|
||||
defaultApi *DefaultApiService
|
||||
}
|
||||
|
||||
type service struct {
|
||||
client DefaultApi
|
||||
}
|
||||
|
||||
// NewAPIClient creates a new API client.
|
||||
// Optionally receives configuration options
|
||||
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
|
||||
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 {
|
||||
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{}, 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, collectionType)
|
||||
return
|
||||
}
|
||||
if t, ok := obj.(time.Time); ok {
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), 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)
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), 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(), collectionType)
|
||||
}
|
||||
return
|
||||
|
||||
case reflect.Interface:
|
||||
fallthrough
|
||||
case reflect.Ptr:
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), 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 !IsNil(postBody) {
|
||||
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, fmt.Errorf("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, fmt.Errorf("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 fmt.Errorf("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 fmt.Errorf("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
|
||||
}
|
||||
|
||||
// A wrapper for strict JSON decoding
|
||||
func newStrictDecoder(data []byte) *json.Decoder {
|
||||
dec := json.NewDecoder(bytes.NewBuffer(data))
|
||||
dec.DisallowUnknownFields()
|
||||
return dec
|
||||
}
|
||||
|
||||
// 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) {
|
||||
err = xml.NewEncoder(bodyBuf).Encode(body)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if bodyBuf.Len() == 0 {
|
||||
err = fmt.Errorf("invalid body type %s", 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)
|
||||
}
|
||||
38
pkg/cdnbeta/configuration.go
Normal file
38
pkg/cdnbeta/configuration.go
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
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/cdnbeta",
|
||||
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
|
||||
}
|
||||
214
pkg/cdnbeta/model_bucket_backend.go
Normal file
214
pkg/cdnbeta/model_bucket_backend.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the BucketBackend type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &BucketBackend{}
|
||||
|
||||
/*
|
||||
types and functions for bucketUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendGetBucketUrlAttributeType = *string
|
||||
|
||||
func getBucketBackendGetBucketUrlAttributeTypeOk(arg BucketBackendGetBucketUrlAttributeType) (ret BucketBackendGetBucketUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendGetBucketUrlAttributeType(arg *BucketBackendGetBucketUrlAttributeType, val BucketBackendGetBucketUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendGetBucketUrlArgType = string
|
||||
type BucketBackendGetBucketUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendGetRegionAttributeType = *string
|
||||
|
||||
func getBucketBackendGetRegionAttributeTypeOk(arg BucketBackendGetRegionAttributeType) (ret BucketBackendGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendGetRegionAttributeType(arg *BucketBackendGetRegionAttributeType, val BucketBackendGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendGetRegionArgType = string
|
||||
type BucketBackendGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendGetTypeAttributeType = *string
|
||||
|
||||
func getBucketBackendGetTypeAttributeTypeOk(arg BucketBackendGetTypeAttributeType) (ret BucketBackendGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendGetTypeAttributeType(arg *BucketBackendGetTypeAttributeType, val BucketBackendGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendGetTypeArgType = string
|
||||
type BucketBackendGetTypeRetType = string
|
||||
|
||||
// BucketBackend struct for BucketBackend
|
||||
type BucketBackend struct {
|
||||
// REQUIRED
|
||||
BucketUrl BucketBackendGetBucketUrlAttributeType `json:"bucketUrl" required:"true"`
|
||||
// REQUIRED
|
||||
Region BucketBackendGetRegionAttributeType `json:"region" required:"true"`
|
||||
// REQUIRED
|
||||
Type BucketBackendGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 BucketBackendGetBucketUrlArgType, region BucketBackendGetRegionArgType, types BucketBackendGetTypeArgType) *BucketBackend {
|
||||
this := BucketBackend{}
|
||||
setBucketBackendGetBucketUrlAttributeType(&this.BucketUrl, bucketUrl)
|
||||
setBucketBackendGetRegionAttributeType(&this.Region, region)
|
||||
setBucketBackendGetTypeAttributeType(&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() (ret BucketBackendGetBucketUrlRetType) {
|
||||
ret, _ = o.GetBucketUrlOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetBucketUrlOk returns a tuple with the BucketUrl field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketBackend) GetBucketUrlOk() (ret BucketBackendGetBucketUrlRetType, ok bool) {
|
||||
return getBucketBackendGetBucketUrlAttributeTypeOk(o.BucketUrl)
|
||||
}
|
||||
|
||||
// SetBucketUrl sets field value
|
||||
func (o *BucketBackend) SetBucketUrl(v BucketBackendGetBucketUrlRetType) {
|
||||
setBucketBackendGetBucketUrlAttributeType(&o.BucketUrl, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value
|
||||
func (o *BucketBackend) GetRegion() (ret BucketBackendGetRegionRetType) {
|
||||
ret, _ = o.GetRegionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetRegionOk returns a tuple with the Region field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketBackend) GetRegionOk() (ret BucketBackendGetRegionRetType, ok bool) {
|
||||
return getBucketBackendGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// SetRegion sets field value
|
||||
func (o *BucketBackend) SetRegion(v BucketBackendGetRegionRetType) {
|
||||
setBucketBackendGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *BucketBackend) GetType() (ret BucketBackendGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketBackend) GetTypeOk() (ret BucketBackendGetTypeRetType, ok bool) {
|
||||
return getBucketBackendGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *BucketBackend) SetType(v BucketBackendGetTypeRetType) {
|
||||
setBucketBackendGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o BucketBackend) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getBucketBackendGetBucketUrlAttributeTypeOk(o.BucketUrl); ok {
|
||||
toSerialize["BucketUrl"] = val
|
||||
}
|
||||
if val, ok := getBucketBackendGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getBucketBackendGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
257
pkg/cdnbeta/model_bucket_backend_create.go
Normal file
257
pkg/cdnbeta/model_bucket_backend_create.go
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the BucketBackendCreate type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &BucketBackendCreate{}
|
||||
|
||||
/*
|
||||
types and functions for bucketUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendCreateGetBucketUrlAttributeType = *string
|
||||
|
||||
func getBucketBackendCreateGetBucketUrlAttributeTypeOk(arg BucketBackendCreateGetBucketUrlAttributeType) (ret BucketBackendCreateGetBucketUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendCreateGetBucketUrlAttributeType(arg *BucketBackendCreateGetBucketUrlAttributeType, val BucketBackendCreateGetBucketUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendCreateGetBucketUrlArgType = string
|
||||
type BucketBackendCreateGetBucketUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for credentials
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type BucketBackendCreateGetCredentialsAttributeType = *BucketCredentials
|
||||
type BucketBackendCreateGetCredentialsArgType = BucketCredentials
|
||||
type BucketBackendCreateGetCredentialsRetType = BucketCredentials
|
||||
|
||||
func getBucketBackendCreateGetCredentialsAttributeTypeOk(arg BucketBackendCreateGetCredentialsAttributeType) (ret BucketBackendCreateGetCredentialsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendCreateGetCredentialsAttributeType(arg *BucketBackendCreateGetCredentialsAttributeType, val BucketBackendCreateGetCredentialsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendCreateGetRegionAttributeType = *string
|
||||
|
||||
func getBucketBackendCreateGetRegionAttributeTypeOk(arg BucketBackendCreateGetRegionAttributeType) (ret BucketBackendCreateGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendCreateGetRegionAttributeType(arg *BucketBackendCreateGetRegionAttributeType, val BucketBackendCreateGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendCreateGetRegionArgType = string
|
||||
type BucketBackendCreateGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendCreateGetTypeAttributeType = *string
|
||||
|
||||
func getBucketBackendCreateGetTypeAttributeTypeOk(arg BucketBackendCreateGetTypeAttributeType) (ret BucketBackendCreateGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendCreateGetTypeAttributeType(arg *BucketBackendCreateGetTypeAttributeType, val BucketBackendCreateGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendCreateGetTypeArgType = string
|
||||
type BucketBackendCreateGetTypeRetType = string
|
||||
|
||||
// BucketBackendCreate struct for BucketBackendCreate
|
||||
type BucketBackendCreate struct {
|
||||
// REQUIRED
|
||||
BucketUrl BucketBackendCreateGetBucketUrlAttributeType `json:"bucketUrl" required:"true"`
|
||||
// REQUIRED
|
||||
Credentials BucketBackendCreateGetCredentialsAttributeType `json:"credentials" required:"true"`
|
||||
// REQUIRED
|
||||
Region BucketBackendCreateGetRegionAttributeType `json:"region" required:"true"`
|
||||
// REQUIRED
|
||||
Type BucketBackendCreateGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 BucketBackendCreateGetBucketUrlArgType, credentials BucketBackendCreateGetCredentialsArgType, region BucketBackendCreateGetRegionArgType, types BucketBackendCreateGetTypeArgType) *BucketBackendCreate {
|
||||
this := BucketBackendCreate{}
|
||||
setBucketBackendCreateGetBucketUrlAttributeType(&this.BucketUrl, bucketUrl)
|
||||
setBucketBackendCreateGetCredentialsAttributeType(&this.Credentials, credentials)
|
||||
setBucketBackendCreateGetRegionAttributeType(&this.Region, region)
|
||||
setBucketBackendCreateGetTypeAttributeType(&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() (ret BucketBackendCreateGetBucketUrlRetType) {
|
||||
ret, _ = o.GetBucketUrlOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetBucketUrlOk returns a tuple with the BucketUrl field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketBackendCreate) GetBucketUrlOk() (ret BucketBackendCreateGetBucketUrlRetType, ok bool) {
|
||||
return getBucketBackendCreateGetBucketUrlAttributeTypeOk(o.BucketUrl)
|
||||
}
|
||||
|
||||
// SetBucketUrl sets field value
|
||||
func (o *BucketBackendCreate) SetBucketUrl(v BucketBackendCreateGetBucketUrlRetType) {
|
||||
setBucketBackendCreateGetBucketUrlAttributeType(&o.BucketUrl, v)
|
||||
}
|
||||
|
||||
// GetCredentials returns the Credentials field value
|
||||
func (o *BucketBackendCreate) GetCredentials() (ret BucketBackendCreateGetCredentialsRetType) {
|
||||
ret, _ = o.GetCredentialsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCredentialsOk returns a tuple with the Credentials field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketBackendCreate) GetCredentialsOk() (ret BucketBackendCreateGetCredentialsRetType, ok bool) {
|
||||
return getBucketBackendCreateGetCredentialsAttributeTypeOk(o.Credentials)
|
||||
}
|
||||
|
||||
// SetCredentials sets field value
|
||||
func (o *BucketBackendCreate) SetCredentials(v BucketBackendCreateGetCredentialsRetType) {
|
||||
setBucketBackendCreateGetCredentialsAttributeType(&o.Credentials, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value
|
||||
func (o *BucketBackendCreate) GetRegion() (ret BucketBackendCreateGetRegionRetType) {
|
||||
ret, _ = o.GetRegionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetRegionOk returns a tuple with the Region field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketBackendCreate) GetRegionOk() (ret BucketBackendCreateGetRegionRetType, ok bool) {
|
||||
return getBucketBackendCreateGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// SetRegion sets field value
|
||||
func (o *BucketBackendCreate) SetRegion(v BucketBackendCreateGetRegionRetType) {
|
||||
setBucketBackendCreateGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *BucketBackendCreate) GetType() (ret BucketBackendCreateGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketBackendCreate) GetTypeOk() (ret BucketBackendCreateGetTypeRetType, ok bool) {
|
||||
return getBucketBackendCreateGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *BucketBackendCreate) SetType(v BucketBackendCreateGetTypeRetType) {
|
||||
setBucketBackendCreateGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o BucketBackendCreate) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getBucketBackendCreateGetBucketUrlAttributeTypeOk(o.BucketUrl); ok {
|
||||
toSerialize["BucketUrl"] = val
|
||||
}
|
||||
if val, ok := getBucketBackendCreateGetCredentialsAttributeTypeOk(o.Credentials); ok {
|
||||
toSerialize["Credentials"] = val
|
||||
}
|
||||
if val, ok := getBucketBackendCreateGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getBucketBackendCreateGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_bucket_backend_create_test.go
Normal file
11
pkg/cdnbeta/model_bucket_backend_create_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
269
pkg/cdnbeta/model_bucket_backend_patch.go
Normal file
269
pkg/cdnbeta/model_bucket_backend_patch.go
Normal file
|
|
@ -0,0 +1,269 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the BucketBackendPatch type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &BucketBackendPatch{}
|
||||
|
||||
/*
|
||||
types and functions for bucketUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendPatchGetBucketUrlAttributeType = *string
|
||||
|
||||
func getBucketBackendPatchGetBucketUrlAttributeTypeOk(arg BucketBackendPatchGetBucketUrlAttributeType) (ret BucketBackendPatchGetBucketUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendPatchGetBucketUrlAttributeType(arg *BucketBackendPatchGetBucketUrlAttributeType, val BucketBackendPatchGetBucketUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendPatchGetBucketUrlArgType = string
|
||||
type BucketBackendPatchGetBucketUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for credentials
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type BucketBackendPatchGetCredentialsAttributeType = *BucketCredentials
|
||||
type BucketBackendPatchGetCredentialsArgType = BucketCredentials
|
||||
type BucketBackendPatchGetCredentialsRetType = BucketCredentials
|
||||
|
||||
func getBucketBackendPatchGetCredentialsAttributeTypeOk(arg BucketBackendPatchGetCredentialsAttributeType) (ret BucketBackendPatchGetCredentialsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendPatchGetCredentialsAttributeType(arg *BucketBackendPatchGetCredentialsAttributeType, val BucketBackendPatchGetCredentialsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for region
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendPatchGetRegionAttributeType = *string
|
||||
|
||||
func getBucketBackendPatchGetRegionAttributeTypeOk(arg BucketBackendPatchGetRegionAttributeType) (ret BucketBackendPatchGetRegionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendPatchGetRegionAttributeType(arg *BucketBackendPatchGetRegionAttributeType, val BucketBackendPatchGetRegionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendPatchGetRegionArgType = string
|
||||
type BucketBackendPatchGetRegionRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketBackendPatchGetTypeAttributeType = *string
|
||||
|
||||
func getBucketBackendPatchGetTypeAttributeTypeOk(arg BucketBackendPatchGetTypeAttributeType) (ret BucketBackendPatchGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketBackendPatchGetTypeAttributeType(arg *BucketBackendPatchGetTypeAttributeType, val BucketBackendPatchGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketBackendPatchGetTypeArgType = string
|
||||
type BucketBackendPatchGetTypeRetType = string
|
||||
|
||||
// BucketBackendPatch struct for BucketBackendPatch
|
||||
type BucketBackendPatch struct {
|
||||
BucketUrl BucketBackendPatchGetBucketUrlAttributeType `json:"bucketUrl,omitempty"`
|
||||
Credentials BucketBackendPatchGetCredentialsAttributeType `json:"credentials,omitempty"`
|
||||
Region BucketBackendPatchGetRegionAttributeType `json:"region,omitempty"`
|
||||
// REQUIRED
|
||||
Type BucketBackendPatchGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 BucketBackendPatchGetTypeArgType) *BucketBackendPatch {
|
||||
this := BucketBackendPatch{}
|
||||
setBucketBackendPatchGetTypeAttributeType(&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() (res BucketBackendPatchGetBucketUrlRetType) {
|
||||
res, _ = o.GetBucketUrlOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret BucketBackendPatchGetBucketUrlRetType, ok bool) {
|
||||
return getBucketBackendPatchGetBucketUrlAttributeTypeOk(o.BucketUrl)
|
||||
}
|
||||
|
||||
// HasBucketUrl returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *BucketBackendPatch) SetBucketUrl(v BucketBackendPatchGetBucketUrlRetType) {
|
||||
setBucketBackendPatchGetBucketUrlAttributeType(&o.BucketUrl, v)
|
||||
}
|
||||
|
||||
// GetCredentials returns the Credentials field value if set, zero value otherwise.
|
||||
func (o *BucketBackendPatch) GetCredentials() (res BucketBackendPatchGetCredentialsRetType) {
|
||||
res, _ = o.GetCredentialsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret BucketBackendPatchGetCredentialsRetType, ok bool) {
|
||||
return getBucketBackendPatchGetCredentialsAttributeTypeOk(o.Credentials)
|
||||
}
|
||||
|
||||
// HasCredentials returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *BucketBackendPatch) SetCredentials(v BucketBackendPatchGetCredentialsRetType) {
|
||||
setBucketBackendPatchGetCredentialsAttributeType(&o.Credentials, v)
|
||||
}
|
||||
|
||||
// GetRegion returns the Region field value if set, zero value otherwise.
|
||||
func (o *BucketBackendPatch) GetRegion() (res BucketBackendPatchGetRegionRetType) {
|
||||
res, _ = o.GetRegionOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret BucketBackendPatchGetRegionRetType, ok bool) {
|
||||
return getBucketBackendPatchGetRegionAttributeTypeOk(o.Region)
|
||||
}
|
||||
|
||||
// HasRegion returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *BucketBackendPatch) SetRegion(v BucketBackendPatchGetRegionRetType) {
|
||||
setBucketBackendPatchGetRegionAttributeType(&o.Region, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *BucketBackendPatch) GetType() (ret BucketBackendPatchGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketBackendPatch) GetTypeOk() (ret BucketBackendPatchGetTypeRetType, ok bool) {
|
||||
return getBucketBackendPatchGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *BucketBackendPatch) SetType(v BucketBackendPatchGetTypeRetType) {
|
||||
setBucketBackendPatchGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o BucketBackendPatch) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getBucketBackendPatchGetBucketUrlAttributeTypeOk(o.BucketUrl); ok {
|
||||
toSerialize["BucketUrl"] = val
|
||||
}
|
||||
if val, ok := getBucketBackendPatchGetCredentialsAttributeTypeOk(o.Credentials); ok {
|
||||
toSerialize["Credentials"] = val
|
||||
}
|
||||
if val, ok := getBucketBackendPatchGetRegionAttributeTypeOk(o.Region); ok {
|
||||
toSerialize["Region"] = val
|
||||
}
|
||||
if val, ok := getBucketBackendPatchGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_bucket_backend_patch_test.go
Normal file
11
pkg/cdnbeta/model_bucket_backend_patch_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
11
pkg/cdnbeta/model_bucket_backend_test.go
Normal file
11
pkg/cdnbeta/model_bucket_backend_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
170
pkg/cdnbeta/model_bucket_credentials.go
Normal file
170
pkg/cdnbeta/model_bucket_credentials.go
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the BucketCredentials type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &BucketCredentials{}
|
||||
|
||||
/*
|
||||
types and functions for accessKeyId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketCredentialsGetAccessKeyIdAttributeType = *string
|
||||
|
||||
func getBucketCredentialsGetAccessKeyIdAttributeTypeOk(arg BucketCredentialsGetAccessKeyIdAttributeType) (ret BucketCredentialsGetAccessKeyIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketCredentialsGetAccessKeyIdAttributeType(arg *BucketCredentialsGetAccessKeyIdAttributeType, val BucketCredentialsGetAccessKeyIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketCredentialsGetAccessKeyIdArgType = string
|
||||
type BucketCredentialsGetAccessKeyIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for secretAccessKey
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type BucketCredentialsGetSecretAccessKeyAttributeType = *string
|
||||
|
||||
func getBucketCredentialsGetSecretAccessKeyAttributeTypeOk(arg BucketCredentialsGetSecretAccessKeyAttributeType) (ret BucketCredentialsGetSecretAccessKeyRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setBucketCredentialsGetSecretAccessKeyAttributeType(arg *BucketCredentialsGetSecretAccessKeyAttributeType, val BucketCredentialsGetSecretAccessKeyRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type BucketCredentialsGetSecretAccessKeyArgType = string
|
||||
type BucketCredentialsGetSecretAccessKeyRetType = string
|
||||
|
||||
// BucketCredentials struct for BucketCredentials
|
||||
type BucketCredentials struct {
|
||||
// REQUIRED
|
||||
AccessKeyId BucketCredentialsGetAccessKeyIdAttributeType `json:"accessKeyId" required:"true"`
|
||||
// REQUIRED
|
||||
SecretAccessKey BucketCredentialsGetSecretAccessKeyAttributeType `json:"secretAccessKey" required:"true"`
|
||||
}
|
||||
|
||||
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 BucketCredentialsGetAccessKeyIdArgType, secretAccessKey BucketCredentialsGetSecretAccessKeyArgType) *BucketCredentials {
|
||||
this := BucketCredentials{}
|
||||
setBucketCredentialsGetAccessKeyIdAttributeType(&this.AccessKeyId, accessKeyId)
|
||||
setBucketCredentialsGetSecretAccessKeyAttributeType(&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() (ret BucketCredentialsGetAccessKeyIdRetType) {
|
||||
ret, _ = o.GetAccessKeyIdOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketCredentials) GetAccessKeyIdOk() (ret BucketCredentialsGetAccessKeyIdRetType, ok bool) {
|
||||
return getBucketCredentialsGetAccessKeyIdAttributeTypeOk(o.AccessKeyId)
|
||||
}
|
||||
|
||||
// SetAccessKeyId sets field value
|
||||
func (o *BucketCredentials) SetAccessKeyId(v BucketCredentialsGetAccessKeyIdRetType) {
|
||||
setBucketCredentialsGetAccessKeyIdAttributeType(&o.AccessKeyId, v)
|
||||
}
|
||||
|
||||
// GetSecretAccessKey returns the SecretAccessKey field value
|
||||
func (o *BucketCredentials) GetSecretAccessKey() (ret BucketCredentialsGetSecretAccessKeyRetType) {
|
||||
ret, _ = o.GetSecretAccessKeyOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *BucketCredentials) GetSecretAccessKeyOk() (ret BucketCredentialsGetSecretAccessKeyRetType, ok bool) {
|
||||
return getBucketCredentialsGetSecretAccessKeyAttributeTypeOk(o.SecretAccessKey)
|
||||
}
|
||||
|
||||
// SetSecretAccessKey sets field value
|
||||
func (o *BucketCredentials) SetSecretAccessKey(v BucketCredentialsGetSecretAccessKeyRetType) {
|
||||
setBucketCredentialsGetSecretAccessKeyAttributeType(&o.SecretAccessKey, v)
|
||||
}
|
||||
|
||||
func (o BucketCredentials) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getBucketCredentialsGetAccessKeyIdAttributeTypeOk(o.AccessKeyId); ok {
|
||||
toSerialize["AccessKeyId"] = val
|
||||
}
|
||||
if val, ok := getBucketCredentialsGetSecretAccessKeyAttributeTypeOk(o.SecretAccessKey); ok {
|
||||
toSerialize["SecretAccessKey"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_bucket_credentials_test.go
Normal file
11
pkg/cdnbeta/model_bucket_credentials_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
516
pkg/cdnbeta/model_config.go
Normal file
516
pkg/cdnbeta/model_config.go
Normal file
|
|
@ -0,0 +1,516 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the Config type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Config{}
|
||||
|
||||
/*
|
||||
types and functions for backend
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type ConfigGetBackendAttributeType = *ConfigBackend
|
||||
type ConfigGetBackendArgType = ConfigBackend
|
||||
type ConfigGetBackendRetType = ConfigBackend
|
||||
|
||||
func getConfigGetBackendAttributeTypeOk(arg ConfigGetBackendAttributeType) (ret ConfigGetBackendRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigGetBackendAttributeType(arg *ConfigGetBackendAttributeType, val ConfigGetBackendRetType) {
|
||||
*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 defaultCacheDuration
|
||||
*/
|
||||
|
||||
// isNullableString
|
||||
type ConfigGetDefaultCacheDurationAttributeType = *NullableString
|
||||
|
||||
func getConfigGetDefaultCacheDurationAttributeTypeOk(arg ConfigGetDefaultCacheDurationAttributeType) (ret ConfigGetDefaultCacheDurationRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return nil, false
|
||||
}
|
||||
return arg.Get(), true
|
||||
}
|
||||
|
||||
func setConfigGetDefaultCacheDurationAttributeType(arg *ConfigGetDefaultCacheDurationAttributeType, val ConfigGetDefaultCacheDurationRetType) {
|
||||
if IsNil(*arg) {
|
||||
*arg = NewNullableString(val)
|
||||
} else {
|
||||
(*arg).Set(val)
|
||||
}
|
||||
}
|
||||
|
||||
type ConfigGetDefaultCacheDurationArgType = *string
|
||||
type ConfigGetDefaultCacheDurationRetType = *string
|
||||
|
||||
/*
|
||||
types and functions for logSink
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type ConfigGetLogSinkAttributeType = *ConfigLogSink
|
||||
type ConfigGetLogSinkArgType = ConfigLogSink
|
||||
type ConfigGetLogSinkRetType = ConfigLogSink
|
||||
|
||||
func getConfigGetLogSinkAttributeTypeOk(arg ConfigGetLogSinkAttributeType) (ret ConfigGetLogSinkRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigGetLogSinkAttributeType(arg *ConfigGetLogSinkAttributeType, val ConfigGetLogSinkRetType) {
|
||||
*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 optimizer
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type ConfigGetOptimizerAttributeType = *Optimizer
|
||||
type ConfigGetOptimizerArgType = Optimizer
|
||||
type ConfigGetOptimizerRetType = Optimizer
|
||||
|
||||
func getConfigGetOptimizerAttributeTypeOk(arg ConfigGetOptimizerAttributeType) (ret ConfigGetOptimizerRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigGetOptimizerAttributeType(arg *ConfigGetOptimizerAttributeType, val ConfigGetOptimizerRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for regions
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type ConfigGetRegionsAttributeType = *[]Region
|
||||
type ConfigGetRegionsArgType = []Region
|
||||
type ConfigGetRegionsRetType = []Region
|
||||
|
||||
func getConfigGetRegionsAttributeTypeOk(arg ConfigGetRegionsAttributeType) (ret ConfigGetRegionsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigGetRegionsAttributeType(arg *ConfigGetRegionsAttributeType, val ConfigGetRegionsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for waf
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type ConfigGetWafAttributeType = *WafConfig
|
||||
type ConfigGetWafArgType = WafConfig
|
||||
type ConfigGetWafRetType = WafConfig
|
||||
|
||||
func getConfigGetWafAttributeTypeOk(arg ConfigGetWafAttributeType) (ret ConfigGetWafRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigGetWafAttributeType(arg *ConfigGetWafAttributeType, val ConfigGetWafRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// Config struct for Config
|
||||
type Config struct {
|
||||
// REQUIRED
|
||||
Backend ConfigGetBackendAttributeType `json:"backend" required:"true"`
|
||||
// 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" required:"true"`
|
||||
// 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" required:"true"`
|
||||
// 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 ConfigGetDefaultCacheDurationAttributeType `json:"defaultCacheDuration,omitempty"`
|
||||
LogSink ConfigGetLogSinkAttributeType `json:"logSink,omitempty"`
|
||||
// Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use.
|
||||
MonthlyLimitBytes ConfigGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,omitempty"`
|
||||
Optimizer ConfigGetOptimizerAttributeType `json:"optimizer,omitempty"`
|
||||
// REQUIRED
|
||||
Regions ConfigGetRegionsAttributeType `json:"regions" required:"true"`
|
||||
// REQUIRED
|
||||
Waf ConfigGetWafAttributeType `json:"waf" required:"true"`
|
||||
}
|
||||
|
||||
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 ConfigGetBackendArgType, blockedCountries ConfigGetBlockedCountriesArgType, blockedIps ConfigGetBlockedIpsArgType, regions ConfigGetRegionsArgType, waf ConfigGetWafArgType) *Config {
|
||||
this := Config{}
|
||||
setConfigGetBackendAttributeType(&this.Backend, backend)
|
||||
setConfigGetBlockedCountriesAttributeType(&this.BlockedCountries, blockedCountries)
|
||||
setConfigGetBlockedIpsAttributeType(&this.BlockedIps, blockedIps)
|
||||
setConfigGetRegionsAttributeType(&this.Regions, regions)
|
||||
setConfigGetWafAttributeType(&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() (ret ConfigGetBackendRetType) {
|
||||
ret, _ = o.GetBackendOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetBackendOk returns a tuple with the Backend field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Config) GetBackendOk() (ret ConfigGetBackendRetType, ok bool) {
|
||||
return getConfigGetBackendAttributeTypeOk(o.Backend)
|
||||
}
|
||||
|
||||
// SetBackend sets field value
|
||||
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)
|
||||
}
|
||||
|
||||
// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *Config) GetDefaultCacheDuration() (res ConfigGetDefaultCacheDurationRetType) {
|
||||
res, _ = o.GetDefaultCacheDurationOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigGetDefaultCacheDurationRetType, ok bool) {
|
||||
return getConfigGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration)
|
||||
}
|
||||
|
||||
// HasDefaultCacheDuration returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *Config) SetDefaultCacheDuration(v ConfigGetDefaultCacheDurationRetType) {
|
||||
setConfigGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v)
|
||||
}
|
||||
|
||||
// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil
|
||||
func (o *Config) SetDefaultCacheDurationNil() {
|
||||
o.DefaultCacheDuration = nil
|
||||
}
|
||||
|
||||
// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil
|
||||
func (o *Config) UnsetDefaultCacheDuration() {
|
||||
o.DefaultCacheDuration = nil
|
||||
}
|
||||
|
||||
// GetLogSink returns the LogSink field value if set, zero value otherwise.
|
||||
func (o *Config) GetLogSink() (res ConfigGetLogSinkRetType) {
|
||||
res, _ = o.GetLogSinkOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigGetLogSinkRetType, ok bool) {
|
||||
return getConfigGetLogSinkAttributeTypeOk(o.LogSink)
|
||||
}
|
||||
|
||||
// HasLogSink returns a boolean if a field has been set.
|
||||
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.
|
||||
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).
|
||||
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
|
||||
}
|
||||
|
||||
// GetOptimizer returns the Optimizer field value if set, zero value otherwise.
|
||||
func (o *Config) GetOptimizer() (res ConfigGetOptimizerRetType) {
|
||||
res, _ = o.GetOptimizerOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigGetOptimizerRetType, ok bool) {
|
||||
return getConfigGetOptimizerAttributeTypeOk(o.Optimizer)
|
||||
}
|
||||
|
||||
// HasOptimizer returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *Config) SetOptimizer(v ConfigGetOptimizerRetType) {
|
||||
setConfigGetOptimizerAttributeType(&o.Optimizer, v)
|
||||
}
|
||||
|
||||
// GetRegions returns the Regions field value
|
||||
func (o *Config) GetRegions() (ret ConfigGetRegionsRetType) {
|
||||
ret, _ = o.GetRegionsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetRegionsOk returns a tuple with the Regions field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Config) GetRegionsOk() (ret ConfigGetRegionsRetType, ok bool) {
|
||||
return getConfigGetRegionsAttributeTypeOk(o.Regions)
|
||||
}
|
||||
|
||||
// SetRegions sets field value
|
||||
func (o *Config) SetRegions(v ConfigGetRegionsRetType) {
|
||||
setConfigGetRegionsAttributeType(&o.Regions, v)
|
||||
}
|
||||
|
||||
// GetWaf returns the Waf field value
|
||||
func (o *Config) GetWaf() (ret ConfigGetWafRetType) {
|
||||
ret, _ = o.GetWafOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetWafOk returns a tuple with the Waf field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Config) GetWafOk() (ret ConfigGetWafRetType, ok bool) {
|
||||
return getConfigGetWafAttributeTypeOk(o.Waf)
|
||||
}
|
||||
|
||||
// SetWaf sets field value
|
||||
func (o *Config) SetWaf(v ConfigGetWafRetType) {
|
||||
setConfigGetWafAttributeType(&o.Waf, v)
|
||||
}
|
||||
|
||||
func (o Config) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
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 := getConfigGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok {
|
||||
toSerialize["DefaultCacheDuration"] = val
|
||||
}
|
||||
if val, ok := getConfigGetLogSinkAttributeTypeOk(o.LogSink); ok {
|
||||
toSerialize["LogSink"] = val
|
||||
}
|
||||
if val, ok := getConfigGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok {
|
||||
toSerialize["MonthlyLimitBytes"] = val
|
||||
}
|
||||
if val, ok := getConfigGetOptimizerAttributeTypeOk(o.Optimizer); ok {
|
||||
toSerialize["Optimizer"] = val
|
||||
}
|
||||
if val, ok := getConfigGetRegionsAttributeTypeOk(o.Regions); ok {
|
||||
toSerialize["Regions"] = val
|
||||
}
|
||||
if val, ok := getConfigGetWafAttributeTypeOk(o.Waf); ok {
|
||||
toSerialize["Waf"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
163
pkg/cdnbeta/model_config_backend.go
Normal file
163
pkg/cdnbeta/model_config_backend.go
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
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 'BucketBackend'
|
||||
if jsonDict["type"] == "BucketBackend" {
|
||||
// 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 'HttpBackend'
|
||||
if jsonDict["type"] == "HttpBackend" {
|
||||
// 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())
|
||||
}
|
||||
}
|
||||
|
||||
// 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 []byte("{}"), nil // no data in oneOf schemas => empty JSON object
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_config_backend_test.go
Normal file
11
pkg/cdnbeta/model_config_backend_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
123
pkg/cdnbeta/model_config_log_sink.go
Normal file
123
pkg/cdnbeta/model_config_log_sink.go
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ConfigLogSink - struct for ConfigLogSink
|
||||
type ConfigLogSink struct {
|
||||
LokiLogSink *LokiLogSink
|
||||
}
|
||||
|
||||
// LokiLogSinkAsConfigLogSink is a convenience function that returns LokiLogSink wrapped in ConfigLogSink
|
||||
func LokiLogSinkAsConfigLogSink(v *LokiLogSink) ConfigLogSink {
|
||||
return ConfigLogSink{
|
||||
LokiLogSink: v,
|
||||
}
|
||||
}
|
||||
|
||||
// Unmarshal JSON data into one of the pointers in the struct
|
||||
func (dst *ConfigLogSink) 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 'LokiLogSink'
|
||||
if jsonDict["type"] == "LokiLogSink" {
|
||||
// try to unmarshal JSON data into LokiLogSink
|
||||
err = json.Unmarshal(data, &dst.LokiLogSink)
|
||||
if err == nil {
|
||||
return nil // data stored in dst.LokiLogSink, return on the first match
|
||||
} else {
|
||||
dst.LokiLogSink = nil
|
||||
return fmt.Errorf("failed to unmarshal ConfigLogSink as LokiLogSink: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// check if the discriminator value is 'loki'
|
||||
if jsonDict["type"] == "loki" {
|
||||
// try to unmarshal JSON data into LokiLogSink
|
||||
err = json.Unmarshal(data, &dst.LokiLogSink)
|
||||
if err == nil {
|
||||
return nil // data stored in dst.LokiLogSink, return on the first match
|
||||
} else {
|
||||
dst.LokiLogSink = nil
|
||||
return fmt.Errorf("failed to unmarshal ConfigLogSink as LokiLogSink: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Marshal data from the first non-nil pointers in the struct to JSON
|
||||
func (src ConfigLogSink) MarshalJSON() ([]byte, error) {
|
||||
if src.LokiLogSink != nil {
|
||||
return json.Marshal(&src.LokiLogSink)
|
||||
}
|
||||
|
||||
return []byte("{}"), nil // no data in oneOf schemas => empty JSON object
|
||||
}
|
||||
|
||||
// Get the actual instance
|
||||
func (obj *ConfigLogSink) GetActualInstance() interface{} {
|
||||
if obj == nil {
|
||||
return nil
|
||||
}
|
||||
if obj.LokiLogSink != nil {
|
||||
return obj.LokiLogSink
|
||||
}
|
||||
|
||||
// all schemas are nil
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullableConfigLogSink struct {
|
||||
value *ConfigLogSink
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableConfigLogSink) Get() *ConfigLogSink {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableConfigLogSink) Set(val *ConfigLogSink) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableConfigLogSink) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableConfigLogSink) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableConfigLogSink(val *ConfigLogSink) *NullableConfigLogSink {
|
||||
return &NullableConfigLogSink{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableConfigLogSink) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableConfigLogSink) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/cdnbeta/model_config_log_sink_test.go
Normal file
11
pkg/cdnbeta/model_config_log_sink_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
545
pkg/cdnbeta/model_config_patch.go
Normal file
545
pkg/cdnbeta/model_config_patch.go
Normal file
|
|
@ -0,0 +1,545 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ConfigPatch type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ConfigPatch{}
|
||||
|
||||
/*
|
||||
types and functions for backend
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type ConfigPatchGetBackendAttributeType = *ConfigPatchBackend
|
||||
type ConfigPatchGetBackendArgType = ConfigPatchBackend
|
||||
type ConfigPatchGetBackendRetType = ConfigPatchBackend
|
||||
|
||||
func getConfigPatchGetBackendAttributeTypeOk(arg ConfigPatchGetBackendAttributeType) (ret ConfigPatchGetBackendRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigPatchGetBackendAttributeType(arg *ConfigPatchGetBackendAttributeType, val ConfigPatchGetBackendRetType) {
|
||||
*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 defaultCacheDuration
|
||||
*/
|
||||
|
||||
// isNullableString
|
||||
type ConfigPatchGetDefaultCacheDurationAttributeType = *NullableString
|
||||
|
||||
func getConfigPatchGetDefaultCacheDurationAttributeTypeOk(arg ConfigPatchGetDefaultCacheDurationAttributeType) (ret ConfigPatchGetDefaultCacheDurationRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return nil, false
|
||||
}
|
||||
return arg.Get(), true
|
||||
}
|
||||
|
||||
func setConfigPatchGetDefaultCacheDurationAttributeType(arg *ConfigPatchGetDefaultCacheDurationAttributeType, val ConfigPatchGetDefaultCacheDurationRetType) {
|
||||
if IsNil(*arg) {
|
||||
*arg = NewNullableString(val)
|
||||
} else {
|
||||
(*arg).Set(val)
|
||||
}
|
||||
}
|
||||
|
||||
type ConfigPatchGetDefaultCacheDurationArgType = *string
|
||||
type ConfigPatchGetDefaultCacheDurationRetType = *string
|
||||
|
||||
/*
|
||||
types and functions for logSink
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type ConfigPatchGetLogSinkAttributeType = *NullableConfigPatchLogSink
|
||||
type ConfigPatchGetLogSinkArgType = *NullableConfigPatchLogSink
|
||||
type ConfigPatchGetLogSinkRetType = *NullableConfigPatchLogSink
|
||||
|
||||
func getConfigPatchGetLogSinkAttributeTypeOk(arg ConfigPatchGetLogSinkAttributeType) (ret ConfigPatchGetLogSinkRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return nil, false
|
||||
}
|
||||
return arg, true
|
||||
}
|
||||
|
||||
func setConfigPatchGetLogSinkAttributeType(arg *ConfigPatchGetLogSinkAttributeType, val ConfigPatchGetLogSinkRetType) {
|
||||
*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 optimizer
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type ConfigPatchGetOptimizerAttributeType = *OptimizerPatch
|
||||
type ConfigPatchGetOptimizerArgType = OptimizerPatch
|
||||
type ConfigPatchGetOptimizerRetType = OptimizerPatch
|
||||
|
||||
func getConfigPatchGetOptimizerAttributeTypeOk(arg ConfigPatchGetOptimizerAttributeType) (ret ConfigPatchGetOptimizerRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigPatchGetOptimizerAttributeType(arg *ConfigPatchGetOptimizerAttributeType, val ConfigPatchGetOptimizerRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for regions
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type ConfigPatchGetRegionsAttributeType = *[]Region
|
||||
type ConfigPatchGetRegionsArgType = []Region
|
||||
type ConfigPatchGetRegionsRetType = []Region
|
||||
|
||||
func getConfigPatchGetRegionsAttributeTypeOk(arg ConfigPatchGetRegionsAttributeType) (ret ConfigPatchGetRegionsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigPatchGetRegionsAttributeType(arg *ConfigPatchGetRegionsAttributeType, val ConfigPatchGetRegionsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for waf
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type ConfigPatchGetWafAttributeType = *WafConfigPatch
|
||||
type ConfigPatchGetWafArgType = WafConfigPatch
|
||||
type ConfigPatchGetWafRetType = WafConfigPatch
|
||||
|
||||
func getConfigPatchGetWafAttributeTypeOk(arg ConfigPatchGetWafAttributeType) (ret ConfigPatchGetWafRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setConfigPatchGetWafAttributeType(arg *ConfigPatchGetWafAttributeType, val ConfigPatchGetWafRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// ConfigPatch struct for ConfigPatch
|
||||
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.
|
||||
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 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 ConfigPatchGetDefaultCacheDurationAttributeType `json:"defaultCacheDuration,omitempty"`
|
||||
LogSink ConfigPatchGetLogSinkAttributeType `json:"logSink,omitempty"`
|
||||
// Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use.
|
||||
MonthlyLimitBytes ConfigPatchGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,omitempty"`
|
||||
Optimizer ConfigPatchGetOptimizerAttributeType `json:"optimizer,omitempty"`
|
||||
Regions ConfigPatchGetRegionsAttributeType `json:"regions,omitempty"`
|
||||
Waf ConfigPatchGetWafAttributeType `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() (res ConfigPatchGetBackendRetType) {
|
||||
res, _ = o.GetBackendOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigPatchGetBackendRetType, ok bool) {
|
||||
return getConfigPatchGetBackendAttributeTypeOk(o.Backend)
|
||||
}
|
||||
|
||||
// HasBackend returns a boolean if a field has been set.
|
||||
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.
|
||||
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)
|
||||
}
|
||||
|
||||
// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *ConfigPatch) GetDefaultCacheDuration() (res ConfigPatchGetDefaultCacheDurationRetType) {
|
||||
res, _ = o.GetDefaultCacheDurationOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigPatchGetDefaultCacheDurationRetType, ok bool) {
|
||||
return getConfigPatchGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration)
|
||||
}
|
||||
|
||||
// HasDefaultCacheDuration returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *ConfigPatch) SetDefaultCacheDuration(v ConfigPatchGetDefaultCacheDurationRetType) {
|
||||
setConfigPatchGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v)
|
||||
}
|
||||
|
||||
// SetDefaultCacheDurationNil sets the value for DefaultCacheDuration to be an explicit nil
|
||||
func (o *ConfigPatch) SetDefaultCacheDurationNil() {
|
||||
o.DefaultCacheDuration = nil
|
||||
}
|
||||
|
||||
// UnsetDefaultCacheDuration ensures that no value is present for DefaultCacheDuration, not even an explicit nil
|
||||
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).
|
||||
func (o *ConfigPatch) GetLogSink() (res ConfigPatchGetLogSinkRetType) {
|
||||
res, _ = o.GetLogSinkOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigPatchGetLogSinkRetType, ok bool) {
|
||||
return getConfigPatchGetLogSinkAttributeTypeOk(o.LogSink)
|
||||
}
|
||||
|
||||
// HasLogSink returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *ConfigPatch) SetLogSink(v ConfigPatchGetLogSinkRetType) {
|
||||
setConfigPatchGetLogSinkAttributeType(&o.LogSink, v)
|
||||
}
|
||||
|
||||
// SetLogSinkNil sets the value for LogSink to be an explicit nil
|
||||
func (o *ConfigPatch) SetLogSinkNil() {
|
||||
o.LogSink = nil
|
||||
}
|
||||
|
||||
// UnsetLogSink ensures that no value is present for LogSink, not even an explicit nil
|
||||
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).
|
||||
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
|
||||
}
|
||||
|
||||
// GetOptimizer returns the Optimizer field value if set, zero value otherwise.
|
||||
func (o *ConfigPatch) GetOptimizer() (res ConfigPatchGetOptimizerRetType) {
|
||||
res, _ = o.GetOptimizerOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigPatchGetOptimizerRetType, ok bool) {
|
||||
return getConfigPatchGetOptimizerAttributeTypeOk(o.Optimizer)
|
||||
}
|
||||
|
||||
// HasOptimizer returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *ConfigPatch) SetOptimizer(v ConfigPatchGetOptimizerRetType) {
|
||||
setConfigPatchGetOptimizerAttributeType(&o.Optimizer, v)
|
||||
}
|
||||
|
||||
// GetRegions returns the Regions field value if set, zero value otherwise.
|
||||
func (o *ConfigPatch) GetRegions() (res ConfigPatchGetRegionsRetType) {
|
||||
res, _ = o.GetRegionsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigPatchGetRegionsRetType, ok bool) {
|
||||
return getConfigPatchGetRegionsAttributeTypeOk(o.Regions)
|
||||
}
|
||||
|
||||
// HasRegions returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *ConfigPatch) SetRegions(v ConfigPatchGetRegionsRetType) {
|
||||
setConfigPatchGetRegionsAttributeType(&o.Regions, v)
|
||||
}
|
||||
|
||||
// GetWaf returns the Waf field value if set, zero value otherwise.
|
||||
func (o *ConfigPatch) GetWaf() (res ConfigPatchGetWafRetType) {
|
||||
res, _ = o.GetWafOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret ConfigPatchGetWafRetType, ok bool) {
|
||||
return getConfigPatchGetWafAttributeTypeOk(o.Waf)
|
||||
}
|
||||
|
||||
// HasWaf returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *ConfigPatch) SetWaf(v ConfigPatchGetWafRetType) {
|
||||
setConfigPatchGetWafAttributeType(&o.Waf, v)
|
||||
}
|
||||
|
||||
func (o ConfigPatch) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
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 := getConfigPatchGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok {
|
||||
toSerialize["DefaultCacheDuration"] = val
|
||||
}
|
||||
if val, ok := getConfigPatchGetLogSinkAttributeTypeOk(o.LogSink); ok {
|
||||
toSerialize["LogSink"] = val
|
||||
}
|
||||
if val, ok := getConfigPatchGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok {
|
||||
toSerialize["MonthlyLimitBytes"] = val
|
||||
}
|
||||
if val, ok := getConfigPatchGetOptimizerAttributeTypeOk(o.Optimizer); ok {
|
||||
toSerialize["Optimizer"] = val
|
||||
}
|
||||
if val, ok := getConfigPatchGetRegionsAttributeTypeOk(o.Regions); ok {
|
||||
toSerialize["Regions"] = val
|
||||
}
|
||||
if val, ok := getConfigPatchGetWafAttributeTypeOk(o.Waf); ok {
|
||||
toSerialize["Waf"] = val
|
||||
}
|
||||
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)
|
||||
}
|
||||
163
pkg/cdnbeta/model_config_patch_backend.go
Normal file
163
pkg/cdnbeta/model_config_patch_backend.go
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
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 'BucketBackendPatch'
|
||||
if jsonDict["type"] == "BucketBackendPatch" {
|
||||
// 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 'HttpBackendPatch'
|
||||
if jsonDict["type"] == "HttpBackendPatch" {
|
||||
// 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())
|
||||
}
|
||||
}
|
||||
|
||||
// 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 []byte("{}"), nil // no data in oneOf schemas => empty JSON object
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_config_patch_backend_test.go
Normal file
11
pkg/cdnbeta/model_config_patch_backend_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
128
pkg/cdnbeta/model_config_patch_log_sink.go
Normal file
128
pkg/cdnbeta/model_config_patch_log_sink.go
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// ConfigPatchLogSink - struct for ConfigPatchLogSink
|
||||
type ConfigPatchLogSink struct {
|
||||
LokiLogSinkPatch *LokiLogSinkPatch
|
||||
}
|
||||
|
||||
// LokiLogSinkPatchAsConfigPatchLogSink is a convenience function that returns LokiLogSinkPatch wrapped in ConfigPatchLogSink
|
||||
func LokiLogSinkPatchAsConfigPatchLogSink(v *LokiLogSinkPatch) ConfigPatchLogSink {
|
||||
return ConfigPatchLogSink{
|
||||
LokiLogSinkPatch: v,
|
||||
}
|
||||
}
|
||||
|
||||
// Unmarshal JSON data into one of the pointers in the struct
|
||||
func (dst *ConfigPatchLogSink) UnmarshalJSON(data []byte) error {
|
||||
var err error
|
||||
// this object is nullable so check if the payload is null or empty string
|
||||
if string(data) == "" || string(data) == "{}" {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 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 'LokiLogSinkPatch'
|
||||
if jsonDict["type"] == "LokiLogSinkPatch" {
|
||||
// try to unmarshal JSON data into LokiLogSinkPatch
|
||||
err = json.Unmarshal(data, &dst.LokiLogSinkPatch)
|
||||
if err == nil {
|
||||
return nil // data stored in dst.LokiLogSinkPatch, return on the first match
|
||||
} else {
|
||||
dst.LokiLogSinkPatch = nil
|
||||
return fmt.Errorf("failed to unmarshal ConfigPatchLogSink as LokiLogSinkPatch: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// check if the discriminator value is 'loki'
|
||||
if jsonDict["type"] == "loki" {
|
||||
// try to unmarshal JSON data into LokiLogSinkPatch
|
||||
err = json.Unmarshal(data, &dst.LokiLogSinkPatch)
|
||||
if err == nil {
|
||||
return nil // data stored in dst.LokiLogSinkPatch, return on the first match
|
||||
} else {
|
||||
dst.LokiLogSinkPatch = nil
|
||||
return fmt.Errorf("failed to unmarshal ConfigPatchLogSink as LokiLogSinkPatch: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Marshal data from the first non-nil pointers in the struct to JSON
|
||||
func (src ConfigPatchLogSink) MarshalJSON() ([]byte, error) {
|
||||
if src.LokiLogSinkPatch != nil {
|
||||
return json.Marshal(&src.LokiLogSinkPatch)
|
||||
}
|
||||
|
||||
return []byte("{}"), nil // no data in oneOf schemas => empty JSON object
|
||||
}
|
||||
|
||||
// Get the actual instance
|
||||
func (obj *ConfigPatchLogSink) GetActualInstance() interface{} {
|
||||
if obj == nil {
|
||||
return nil
|
||||
}
|
||||
if obj.LokiLogSinkPatch != nil {
|
||||
return obj.LokiLogSinkPatch
|
||||
}
|
||||
|
||||
// all schemas are nil
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullableConfigPatchLogSink struct {
|
||||
value *ConfigPatchLogSink
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableConfigPatchLogSink) Get() *ConfigPatchLogSink {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableConfigPatchLogSink) Set(val *ConfigPatchLogSink) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableConfigPatchLogSink) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableConfigPatchLogSink) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableConfigPatchLogSink(val *ConfigPatchLogSink) *NullableConfigPatchLogSink {
|
||||
return &NullableConfigPatchLogSink{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableConfigPatchLogSink) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableConfigPatchLogSink) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
11
pkg/cdnbeta/model_config_patch_log_sink_test.go
Normal file
11
pkg/cdnbeta/model_config_patch_log_sink_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
11
pkg/cdnbeta/model_config_patch_test.go
Normal file
11
pkg/cdnbeta/model_config_patch_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
11
pkg/cdnbeta/model_config_test.go
Normal file
11
pkg/cdnbeta/model_config_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
552
pkg/cdnbeta/model_create_distribution_payload.go
Normal file
552
pkg/cdnbeta/model_create_distribution_payload.go
Normal file
|
|
@ -0,0 +1,552 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateDistributionPayload type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateDistributionPayload{}
|
||||
|
||||
/*
|
||||
types and functions for backend
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type CreateDistributionPayloadGetBackendAttributeType = *CreateDistributionPayloadBackend
|
||||
type CreateDistributionPayloadGetBackendArgType = CreateDistributionPayloadBackend
|
||||
type CreateDistributionPayloadGetBackendRetType = CreateDistributionPayloadBackend
|
||||
|
||||
func getCreateDistributionPayloadGetBackendAttributeTypeOk(arg CreateDistributionPayloadGetBackendAttributeType) (ret CreateDistributionPayloadGetBackendRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateDistributionPayloadGetBackendAttributeType(arg *CreateDistributionPayloadGetBackendAttributeType, val CreateDistributionPayloadGetBackendRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
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 defaultCacheDuration
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateDistributionPayloadGetDefaultCacheDurationAttributeType = *string
|
||||
|
||||
func getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(arg CreateDistributionPayloadGetDefaultCacheDurationAttributeType) (ret CreateDistributionPayloadGetDefaultCacheDurationRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateDistributionPayloadGetDefaultCacheDurationAttributeType(arg *CreateDistributionPayloadGetDefaultCacheDurationAttributeType, val CreateDistributionPayloadGetDefaultCacheDurationRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateDistributionPayloadGetDefaultCacheDurationArgType = string
|
||||
type CreateDistributionPayloadGetDefaultCacheDurationRetType = string
|
||||
|
||||
/*
|
||||
types and functions for intentId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CreateDistributionPayloadGetIntentIdAttributeType = *string
|
||||
|
||||
func getCreateDistributionPayloadGetIntentIdAttributeTypeOk(arg CreateDistributionPayloadGetIntentIdAttributeType) (ret CreateDistributionPayloadGetIntentIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateDistributionPayloadGetIntentIdAttributeType(arg *CreateDistributionPayloadGetIntentIdAttributeType, val CreateDistributionPayloadGetIntentIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CreateDistributionPayloadGetIntentIdArgType = string
|
||||
type CreateDistributionPayloadGetIntentIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for logSink
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type CreateDistributionPayloadGetLogSinkAttributeType = *CreateDistributionPayloadLogSink
|
||||
type CreateDistributionPayloadGetLogSinkArgType = CreateDistributionPayloadLogSink
|
||||
type CreateDistributionPayloadGetLogSinkRetType = CreateDistributionPayloadLogSink
|
||||
|
||||
func getCreateDistributionPayloadGetLogSinkAttributeTypeOk(arg CreateDistributionPayloadGetLogSinkAttributeType) (ret CreateDistributionPayloadGetLogSinkRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateDistributionPayloadGetLogSinkAttributeType(arg *CreateDistributionPayloadGetLogSinkAttributeType, val CreateDistributionPayloadGetLogSinkRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
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 optimizer
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type CreateDistributionPayloadGetOptimizerAttributeType = *Optimizer
|
||||
type CreateDistributionPayloadGetOptimizerArgType = Optimizer
|
||||
type CreateDistributionPayloadGetOptimizerRetType = Optimizer
|
||||
|
||||
func getCreateDistributionPayloadGetOptimizerAttributeTypeOk(arg CreateDistributionPayloadGetOptimizerAttributeType) (ret CreateDistributionPayloadGetOptimizerRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateDistributionPayloadGetOptimizerAttributeType(arg *CreateDistributionPayloadGetOptimizerAttributeType, val CreateDistributionPayloadGetOptimizerRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for regions
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type CreateDistributionPayloadGetRegionsAttributeType = *[]Region
|
||||
type CreateDistributionPayloadGetRegionsArgType = []Region
|
||||
type CreateDistributionPayloadGetRegionsRetType = []Region
|
||||
|
||||
func getCreateDistributionPayloadGetRegionsAttributeTypeOk(arg CreateDistributionPayloadGetRegionsAttributeType) (ret CreateDistributionPayloadGetRegionsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateDistributionPayloadGetRegionsAttributeType(arg *CreateDistributionPayloadGetRegionsAttributeType, val CreateDistributionPayloadGetRegionsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for waf
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type CreateDistributionPayloadGetWafAttributeType = *WafConfig
|
||||
type CreateDistributionPayloadGetWafArgType = WafConfig
|
||||
type CreateDistributionPayloadGetWafRetType = WafConfig
|
||||
|
||||
func getCreateDistributionPayloadGetWafAttributeTypeOk(arg CreateDistributionPayloadGetWafAttributeType) (ret CreateDistributionPayloadGetWafRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateDistributionPayloadGetWafAttributeType(arg *CreateDistributionPayloadGetWafAttributeType, val CreateDistributionPayloadGetWafRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// CreateDistributionPayload struct for CreateDistributionPayload
|
||||
type CreateDistributionPayload struct {
|
||||
// REQUIRED
|
||||
Backend CreateDistributionPayloadGetBackendAttributeType `json:"backend" required:"true"`
|
||||
// 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"`
|
||||
// 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 CreateDistributionPayloadGetDefaultCacheDurationAttributeType `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 CreateDistributionPayloadGetIntentIdAttributeType `json:"intentId,omitempty"`
|
||||
LogSink CreateDistributionPayloadGetLogSinkAttributeType `json:"logSink,omitempty"`
|
||||
// Sets the monthly limit of bandwidth in bytes that the pullzone is allowed to use.
|
||||
MonthlyLimitBytes CreateDistributionPayloadGetMonthlyLimitBytesAttributeType `json:"monthlyLimitBytes,omitempty"`
|
||||
Optimizer CreateDistributionPayloadGetOptimizerAttributeType `json:"optimizer,omitempty"`
|
||||
// Define in which regions you would like your content to be cached.
|
||||
// REQUIRED
|
||||
Regions CreateDistributionPayloadGetRegionsAttributeType `json:"regions" required:"true"`
|
||||
Waf CreateDistributionPayloadGetWafAttributeType `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 CreateDistributionPayloadGetBackendArgType, regions CreateDistributionPayloadGetRegionsArgType) *CreateDistributionPayload {
|
||||
this := CreateDistributionPayload{}
|
||||
setCreateDistributionPayloadGetBackendAttributeType(&this.Backend, backend)
|
||||
setCreateDistributionPayloadGetRegionsAttributeType(&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() (ret CreateDistributionPayloadGetBackendRetType) {
|
||||
ret, _ = o.GetBackendOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetBackendOk returns a tuple with the Backend field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateDistributionPayload) GetBackendOk() (ret CreateDistributionPayloadGetBackendRetType, ok bool) {
|
||||
return getCreateDistributionPayloadGetBackendAttributeTypeOk(o.Backend)
|
||||
}
|
||||
|
||||
// SetBackend sets field value
|
||||
func (o *CreateDistributionPayload) SetBackend(v CreateDistributionPayloadGetBackendRetType) {
|
||||
setCreateDistributionPayloadGetBackendAttributeType(&o.Backend, v)
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
// GetDefaultCacheDuration returns the DefaultCacheDuration field value if set, zero value otherwise.
|
||||
func (o *CreateDistributionPayload) GetDefaultCacheDuration() (res CreateDistributionPayloadGetDefaultCacheDurationRetType) {
|
||||
res, _ = o.GetDefaultCacheDurationOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret CreateDistributionPayloadGetDefaultCacheDurationRetType, ok bool) {
|
||||
return getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration)
|
||||
}
|
||||
|
||||
// HasDefaultCacheDuration returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *CreateDistributionPayload) SetDefaultCacheDuration(v CreateDistributionPayloadGetDefaultCacheDurationRetType) {
|
||||
setCreateDistributionPayloadGetDefaultCacheDurationAttributeType(&o.DefaultCacheDuration, v)
|
||||
}
|
||||
|
||||
// GetIntentId returns the IntentId field value if set, zero value otherwise.
|
||||
func (o *CreateDistributionPayload) GetIntentId() (res CreateDistributionPayloadGetIntentIdRetType) {
|
||||
res, _ = o.GetIntentIdOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret CreateDistributionPayloadGetIntentIdRetType, ok bool) {
|
||||
return getCreateDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId)
|
||||
}
|
||||
|
||||
// HasIntentId returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *CreateDistributionPayload) SetIntentId(v CreateDistributionPayloadGetIntentIdRetType) {
|
||||
setCreateDistributionPayloadGetIntentIdAttributeType(&o.IntentId, v)
|
||||
}
|
||||
|
||||
// GetLogSink returns the LogSink field value if set, zero value otherwise.
|
||||
func (o *CreateDistributionPayload) GetLogSink() (res CreateDistributionPayloadGetLogSinkRetType) {
|
||||
res, _ = o.GetLogSinkOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret CreateDistributionPayloadGetLogSinkRetType, ok bool) {
|
||||
return getCreateDistributionPayloadGetLogSinkAttributeTypeOk(o.LogSink)
|
||||
}
|
||||
|
||||
// HasLogSink returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *CreateDistributionPayload) SetLogSink(v CreateDistributionPayloadGetLogSinkRetType) {
|
||||
setCreateDistributionPayloadGetLogSinkAttributeType(&o.LogSink, 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)
|
||||
}
|
||||
|
||||
// GetOptimizer returns the Optimizer field value if set, zero value otherwise.
|
||||
func (o *CreateDistributionPayload) GetOptimizer() (res CreateDistributionPayloadGetOptimizerRetType) {
|
||||
res, _ = o.GetOptimizerOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret CreateDistributionPayloadGetOptimizerRetType, ok bool) {
|
||||
return getCreateDistributionPayloadGetOptimizerAttributeTypeOk(o.Optimizer)
|
||||
}
|
||||
|
||||
// HasOptimizer returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *CreateDistributionPayload) SetOptimizer(v CreateDistributionPayloadGetOptimizerRetType) {
|
||||
setCreateDistributionPayloadGetOptimizerAttributeType(&o.Optimizer, v)
|
||||
}
|
||||
|
||||
// GetRegions returns the Regions field value
|
||||
func (o *CreateDistributionPayload) GetRegions() (ret CreateDistributionPayloadGetRegionsRetType) {
|
||||
ret, _ = o.GetRegionsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetRegionsOk returns a tuple with the Regions field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateDistributionPayload) GetRegionsOk() (ret CreateDistributionPayloadGetRegionsRetType, ok bool) {
|
||||
return getCreateDistributionPayloadGetRegionsAttributeTypeOk(o.Regions)
|
||||
}
|
||||
|
||||
// SetRegions sets field value
|
||||
func (o *CreateDistributionPayload) SetRegions(v CreateDistributionPayloadGetRegionsRetType) {
|
||||
setCreateDistributionPayloadGetRegionsAttributeType(&o.Regions, v)
|
||||
}
|
||||
|
||||
// GetWaf returns the Waf field value if set, zero value otherwise.
|
||||
func (o *CreateDistributionPayload) GetWaf() (res CreateDistributionPayloadGetWafRetType) {
|
||||
res, _ = o.GetWafOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret CreateDistributionPayloadGetWafRetType, ok bool) {
|
||||
return getCreateDistributionPayloadGetWafAttributeTypeOk(o.Waf)
|
||||
}
|
||||
|
||||
// HasWaf returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *CreateDistributionPayload) SetWaf(v CreateDistributionPayloadGetWafRetType) {
|
||||
setCreateDistributionPayloadGetWafAttributeType(&o.Waf, v)
|
||||
}
|
||||
|
||||
func (o CreateDistributionPayload) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateDistributionPayloadGetBackendAttributeTypeOk(o.Backend); ok {
|
||||
toSerialize["Backend"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetBlockedCountriesAttributeTypeOk(o.BlockedCountries); ok {
|
||||
toSerialize["BlockedCountries"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetBlockedIpsAttributeTypeOk(o.BlockedIps); ok {
|
||||
toSerialize["BlockedIps"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetDefaultCacheDurationAttributeTypeOk(o.DefaultCacheDuration); ok {
|
||||
toSerialize["DefaultCacheDuration"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetIntentIdAttributeTypeOk(o.IntentId); ok {
|
||||
toSerialize["IntentId"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetLogSinkAttributeTypeOk(o.LogSink); ok {
|
||||
toSerialize["LogSink"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetMonthlyLimitBytesAttributeTypeOk(o.MonthlyLimitBytes); ok {
|
||||
toSerialize["MonthlyLimitBytes"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetOptimizerAttributeTypeOk(o.Optimizer); ok {
|
||||
toSerialize["Optimizer"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetRegionsAttributeTypeOk(o.Regions); ok {
|
||||
toSerialize["Regions"] = val
|
||||
}
|
||||
if val, ok := getCreateDistributionPayloadGetWafAttributeTypeOk(o.Waf); ok {
|
||||
toSerialize["Waf"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
163
pkg/cdnbeta/model_create_distribution_payload_backend.go
Normal file
163
pkg/cdnbeta/model_create_distribution_payload_backend.go
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
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 'BucketBackendCreate'
|
||||
if jsonDict["type"] == "BucketBackendCreate" {
|
||||
// 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 'HttpBackendCreate'
|
||||
if jsonDict["type"] == "HttpBackendCreate" {
|
||||
// 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())
|
||||
}
|
||||
}
|
||||
|
||||
// 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 []byte("{}"), nil // no data in oneOf schemas => empty JSON object
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
123
pkg/cdnbeta/model_create_distribution_payload_log_sink.go
Normal file
123
pkg/cdnbeta/model_create_distribution_payload_log_sink.go
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// CreateDistributionPayloadLogSink - struct for CreateDistributionPayloadLogSink
|
||||
type CreateDistributionPayloadLogSink struct {
|
||||
LokiLogSinkCreate *LokiLogSinkCreate
|
||||
}
|
||||
|
||||
// LokiLogSinkCreateAsCreateDistributionPayloadLogSink is a convenience function that returns LokiLogSinkCreate wrapped in CreateDistributionPayloadLogSink
|
||||
func LokiLogSinkCreateAsCreateDistributionPayloadLogSink(v *LokiLogSinkCreate) CreateDistributionPayloadLogSink {
|
||||
return CreateDistributionPayloadLogSink{
|
||||
LokiLogSinkCreate: v,
|
||||
}
|
||||
}
|
||||
|
||||
// Unmarshal JSON data into one of the pointers in the struct
|
||||
func (dst *CreateDistributionPayloadLogSink) 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 'LokiLogSinkCreate'
|
||||
if jsonDict["type"] == "LokiLogSinkCreate" {
|
||||
// try to unmarshal JSON data into LokiLogSinkCreate
|
||||
err = json.Unmarshal(data, &dst.LokiLogSinkCreate)
|
||||
if err == nil {
|
||||
return nil // data stored in dst.LokiLogSinkCreate, return on the first match
|
||||
} else {
|
||||
dst.LokiLogSinkCreate = nil
|
||||
return fmt.Errorf("failed to unmarshal CreateDistributionPayloadLogSink as LokiLogSinkCreate: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// check if the discriminator value is 'loki'
|
||||
if jsonDict["type"] == "loki" {
|
||||
// try to unmarshal JSON data into LokiLogSinkCreate
|
||||
err = json.Unmarshal(data, &dst.LokiLogSinkCreate)
|
||||
if err == nil {
|
||||
return nil // data stored in dst.LokiLogSinkCreate, return on the first match
|
||||
} else {
|
||||
dst.LokiLogSinkCreate = nil
|
||||
return fmt.Errorf("failed to unmarshal CreateDistributionPayloadLogSink as LokiLogSinkCreate: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Marshal data from the first non-nil pointers in the struct to JSON
|
||||
func (src CreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) {
|
||||
if src.LokiLogSinkCreate != nil {
|
||||
return json.Marshal(&src.LokiLogSinkCreate)
|
||||
}
|
||||
|
||||
return []byte("{}"), nil // no data in oneOf schemas => empty JSON object
|
||||
}
|
||||
|
||||
// Get the actual instance
|
||||
func (obj *CreateDistributionPayloadLogSink) GetActualInstance() interface{} {
|
||||
if obj == nil {
|
||||
return nil
|
||||
}
|
||||
if obj.LokiLogSinkCreate != nil {
|
||||
return obj.LokiLogSinkCreate
|
||||
}
|
||||
|
||||
// all schemas are nil
|
||||
return nil
|
||||
}
|
||||
|
||||
type NullableCreateDistributionPayloadLogSink struct {
|
||||
value *CreateDistributionPayloadLogSink
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCreateDistributionPayloadLogSink) Get() *CreateDistributionPayloadLogSink {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCreateDistributionPayloadLogSink) Set(val *CreateDistributionPayloadLogSink) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCreateDistributionPayloadLogSink) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCreateDistributionPayloadLogSink) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCreateDistributionPayloadLogSink(val *CreateDistributionPayloadLogSink) *NullableCreateDistributionPayloadLogSink {
|
||||
return &NullableCreateDistributionPayloadLogSink{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCreateDistributionPayloadLogSink) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCreateDistributionPayloadLogSink) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
11
pkg/cdnbeta/model_create_distribution_payload_test.go
Normal file
11
pkg/cdnbeta/model_create_distribution_payload_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
125
pkg/cdnbeta/model_create_distribution_response.go
Normal file
125
pkg/cdnbeta/model_create_distribution_response.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CreateDistributionResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CreateDistributionResponse{}
|
||||
|
||||
/*
|
||||
types and functions for distribution
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type CreateDistributionResponseGetDistributionAttributeType = *Distribution
|
||||
type CreateDistributionResponseGetDistributionArgType = Distribution
|
||||
type CreateDistributionResponseGetDistributionRetType = Distribution
|
||||
|
||||
func getCreateDistributionResponseGetDistributionAttributeTypeOk(arg CreateDistributionResponseGetDistributionAttributeType) (ret CreateDistributionResponseGetDistributionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCreateDistributionResponseGetDistributionAttributeType(arg *CreateDistributionResponseGetDistributionAttributeType, val CreateDistributionResponseGetDistributionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// CreateDistributionResponse struct for CreateDistributionResponse
|
||||
type CreateDistributionResponse struct {
|
||||
// REQUIRED
|
||||
Distribution CreateDistributionResponseGetDistributionAttributeType `json:"distribution" required:"true"`
|
||||
}
|
||||
|
||||
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 CreateDistributionResponseGetDistributionArgType) *CreateDistributionResponse {
|
||||
this := CreateDistributionResponse{}
|
||||
setCreateDistributionResponseGetDistributionAttributeType(&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() (ret CreateDistributionResponseGetDistributionRetType) {
|
||||
ret, _ = o.GetDistributionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDistributionOk returns a tuple with the Distribution field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CreateDistributionResponse) GetDistributionOk() (ret CreateDistributionResponseGetDistributionRetType, ok bool) {
|
||||
return getCreateDistributionResponseGetDistributionAttributeTypeOk(o.Distribution)
|
||||
}
|
||||
|
||||
// SetDistribution sets field value
|
||||
func (o *CreateDistributionResponse) SetDistribution(v CreateDistributionResponseGetDistributionRetType) {
|
||||
setCreateDistributionResponseGetDistributionAttributeType(&o.Distribution, v)
|
||||
}
|
||||
|
||||
func (o CreateDistributionResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCreateDistributionResponseGetDistributionAttributeTypeOk(o.Distribution); ok {
|
||||
toSerialize["Distribution"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_create_distribution_response_test.go
Normal file
11
pkg/cdnbeta/model_create_distribution_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
218
pkg/cdnbeta/model_custom_domain.go
Normal file
218
pkg/cdnbeta/model_custom_domain.go
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CustomDomain type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CustomDomain{}
|
||||
|
||||
/*
|
||||
types and functions for errors
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type CustomDomainGetErrorsAttributeType = *[]StatusError
|
||||
type CustomDomainGetErrorsArgType = []StatusError
|
||||
type CustomDomainGetErrorsRetType = []StatusError
|
||||
|
||||
func getCustomDomainGetErrorsAttributeTypeOk(arg CustomDomainGetErrorsAttributeType) (ret CustomDomainGetErrorsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCustomDomainGetErrorsAttributeType(arg *CustomDomainGetErrorsAttributeType, val CustomDomainGetErrorsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type CustomDomainGetNameAttributeType = *string
|
||||
|
||||
func getCustomDomainGetNameAttributeTypeOk(arg CustomDomainGetNameAttributeType) (ret CustomDomainGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCustomDomainGetNameAttributeType(arg *CustomDomainGetNameAttributeType, val CustomDomainGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type CustomDomainGetNameArgType = string
|
||||
type CustomDomainGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for status
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type CustomDomainGetStatusAttributeType = *DomainStatus
|
||||
type CustomDomainGetStatusArgType = DomainStatus
|
||||
type CustomDomainGetStatusRetType = DomainStatus
|
||||
|
||||
func getCustomDomainGetStatusAttributeTypeOk(arg CustomDomainGetStatusAttributeType) (ret CustomDomainGetStatusRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setCustomDomainGetStatusAttributeType(arg *CustomDomainGetStatusAttributeType, val CustomDomainGetStatusRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// CustomDomain Definition of a custom domain
|
||||
type CustomDomain struct {
|
||||
// This object is present if the custom domain has errors.
|
||||
Errors CustomDomainGetErrorsAttributeType `json:"errors,omitempty"`
|
||||
// The domain. Can be used as input for the GetCustomDomain endpoint
|
||||
// REQUIRED
|
||||
Name CustomDomainGetNameAttributeType `json:"name" required:"true"`
|
||||
// REQUIRED
|
||||
Status CustomDomainGetStatusAttributeType `json:"status" required:"true"`
|
||||
}
|
||||
|
||||
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 CustomDomainGetNameArgType, status CustomDomainGetStatusArgType) *CustomDomain {
|
||||
this := CustomDomain{}
|
||||
setCustomDomainGetNameAttributeType(&this.Name, name)
|
||||
setCustomDomainGetStatusAttributeType(&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() (res CustomDomainGetErrorsRetType) {
|
||||
res, _ = o.GetErrorsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret CustomDomainGetErrorsRetType, ok bool) {
|
||||
return getCustomDomainGetErrorsAttributeTypeOk(o.Errors)
|
||||
}
|
||||
|
||||
// HasErrors returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *CustomDomain) SetErrors(v CustomDomainGetErrorsRetType) {
|
||||
setCustomDomainGetErrorsAttributeType(&o.Errors, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value
|
||||
func (o *CustomDomain) GetName() (ret CustomDomainGetNameRetType) {
|
||||
ret, _ = o.GetNameOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetNameOk returns a tuple with the Name field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CustomDomain) GetNameOk() (ret CustomDomainGetNameRetType, ok bool) {
|
||||
return getCustomDomainGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// SetName sets field value
|
||||
func (o *CustomDomain) SetName(v CustomDomainGetNameRetType) {
|
||||
setCustomDomainGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetStatus returns the Status field value
|
||||
func (o *CustomDomain) GetStatus() (ret CustomDomainGetStatusRetType) {
|
||||
ret, _ = o.GetStatusOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetStatusOk returns a tuple with the Status field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CustomDomain) GetStatusOk() (ret CustomDomainGetStatusRetType, ok bool) {
|
||||
return getCustomDomainGetStatusAttributeTypeOk(o.Status)
|
||||
}
|
||||
|
||||
// SetStatus sets field value
|
||||
func (o *CustomDomain) SetStatus(v CustomDomainGetStatusRetType) {
|
||||
setCustomDomainGetStatusAttributeType(&o.Status, v)
|
||||
}
|
||||
|
||||
func (o CustomDomain) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getCustomDomainGetErrorsAttributeTypeOk(o.Errors); ok {
|
||||
toSerialize["Errors"] = val
|
||||
}
|
||||
if val, ok := getCustomDomainGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getCustomDomainGetStatusAttributeTypeOk(o.Status); ok {
|
||||
toSerialize["Status"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_custom_domain_test.go
Normal file
11
pkg/cdnbeta/model_custom_domain_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
127
pkg/cdnbeta/model_delete_custom_domain_response.go
Normal file
127
pkg/cdnbeta/model_delete_custom_domain_response.go
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the DeleteCustomDomainResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DeleteCustomDomainResponse{}
|
||||
|
||||
/*
|
||||
types and functions for customDomain
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DeleteCustomDomainResponseGetCustomDomainAttributeType = *CustomDomain
|
||||
type DeleteCustomDomainResponseGetCustomDomainArgType = CustomDomain
|
||||
type DeleteCustomDomainResponseGetCustomDomainRetType = CustomDomain
|
||||
|
||||
func getDeleteCustomDomainResponseGetCustomDomainAttributeTypeOk(arg DeleteCustomDomainResponseGetCustomDomainAttributeType) (ret DeleteCustomDomainResponseGetCustomDomainRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
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.
|
||||
type DeleteCustomDomainResponse struct {
|
||||
CustomDomain DeleteCustomDomainResponseGetCustomDomainAttributeType `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() (res DeleteCustomDomainResponseGetCustomDomainRetType) {
|
||||
res, _ = o.GetCustomDomainOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret DeleteCustomDomainResponseGetCustomDomainRetType, ok bool) {
|
||||
return getDeleteCustomDomainResponseGetCustomDomainAttributeTypeOk(o.CustomDomain)
|
||||
}
|
||||
|
||||
// HasCustomDomain returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *DeleteCustomDomainResponse) SetCustomDomain(v DeleteCustomDomainResponseGetCustomDomainRetType) {
|
||||
setDeleteCustomDomainResponseGetCustomDomainAttributeType(&o.CustomDomain, v)
|
||||
}
|
||||
|
||||
func (o DeleteCustomDomainResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDeleteCustomDomainResponseGetCustomDomainAttributeTypeOk(o.CustomDomain); ok {
|
||||
toSerialize["CustomDomain"] = val
|
||||
}
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_delete_custom_domain_response_test.go
Normal file
11
pkg/cdnbeta/model_delete_custom_domain_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
127
pkg/cdnbeta/model_delete_distribution_response.go
Normal file
127
pkg/cdnbeta/model_delete_distribution_response.go
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the DeleteDistributionResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DeleteDistributionResponse{}
|
||||
|
||||
/*
|
||||
types and functions for distribution
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DeleteDistributionResponseGetDistributionAttributeType = *Distribution
|
||||
type DeleteDistributionResponseGetDistributionArgType = Distribution
|
||||
type DeleteDistributionResponseGetDistributionRetType = Distribution
|
||||
|
||||
func getDeleteDistributionResponseGetDistributionAttributeTypeOk(arg DeleteDistributionResponseGetDistributionAttributeType) (ret DeleteDistributionResponseGetDistributionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDeleteDistributionResponseGetDistributionAttributeType(arg *DeleteDistributionResponseGetDistributionAttributeType, val DeleteDistributionResponseGetDistributionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// DeleteDistributionResponse struct for DeleteDistributionResponse
|
||||
type DeleteDistributionResponse struct {
|
||||
Distribution DeleteDistributionResponseGetDistributionAttributeType `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() (res DeleteDistributionResponseGetDistributionRetType) {
|
||||
res, _ = o.GetDistributionOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret DeleteDistributionResponseGetDistributionRetType, ok bool) {
|
||||
return getDeleteDistributionResponseGetDistributionAttributeTypeOk(o.Distribution)
|
||||
}
|
||||
|
||||
// HasDistribution returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *DeleteDistributionResponse) SetDistribution(v DeleteDistributionResponseGetDistributionRetType) {
|
||||
setDeleteDistributionResponseGetDistributionAttributeType(&o.Distribution, v)
|
||||
}
|
||||
|
||||
func (o DeleteDistributionResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDeleteDistributionResponseGetDistributionAttributeTypeOk(o.Distribution); ok {
|
||||
toSerialize["Distribution"] = val
|
||||
}
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_delete_distribution_response_test.go
Normal file
11
pkg/cdnbeta/model_delete_distribution_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
595
pkg/cdnbeta/model_distribution.go
Normal file
595
pkg/cdnbeta/model_distribution.go
Normal file
|
|
@ -0,0 +1,595 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the Distribution type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Distribution{}
|
||||
|
||||
/*
|
||||
types and functions for config
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionGetConfigAttributeType = *Config
|
||||
type DistributionGetConfigArgType = Config
|
||||
type DistributionGetConfigRetType = Config
|
||||
|
||||
func getDistributionGetConfigAttributeTypeOk(arg DistributionGetConfigAttributeType) (ret DistributionGetConfigRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetConfigAttributeType(arg *DistributionGetConfigAttributeType, val DistributionGetConfigRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for createdAt
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type DistributionGetCreatedAtAttributeType = *time.Time
|
||||
type DistributionGetCreatedAtArgType = time.Time
|
||||
type DistributionGetCreatedAtRetType = time.Time
|
||||
|
||||
func getDistributionGetCreatedAtAttributeTypeOk(arg DistributionGetCreatedAtAttributeType) (ret DistributionGetCreatedAtRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetCreatedAtAttributeType(arg *DistributionGetCreatedAtAttributeType, val DistributionGetCreatedAtRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for domains
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type DistributionGetDomainsAttributeType = *[]Domain
|
||||
type DistributionGetDomainsArgType = []Domain
|
||||
type DistributionGetDomainsRetType = []Domain
|
||||
|
||||
func getDistributionGetDomainsAttributeTypeOk(arg DistributionGetDomainsAttributeType) (ret DistributionGetDomainsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetDomainsAttributeType(arg *DistributionGetDomainsAttributeType, val DistributionGetDomainsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for errors
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type DistributionGetErrorsAttributeType = *[]StatusError
|
||||
type DistributionGetErrorsArgType = []StatusError
|
||||
type DistributionGetErrorsRetType = []StatusError
|
||||
|
||||
func getDistributionGetErrorsAttributeTypeOk(arg DistributionGetErrorsAttributeType) (ret DistributionGetErrorsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetErrorsAttributeType(arg *DistributionGetErrorsAttributeType, val DistributionGetErrorsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for id
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type DistributionGetIdAttributeType = *string
|
||||
|
||||
func getDistributionGetIdAttributeTypeOk(arg DistributionGetIdAttributeType) (ret DistributionGetIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetIdAttributeType(arg *DistributionGetIdAttributeType, val DistributionGetIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type DistributionGetIdArgType = string
|
||||
type DistributionGetIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for projectId
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type DistributionGetProjectIdAttributeType = *string
|
||||
|
||||
func getDistributionGetProjectIdAttributeTypeOk(arg DistributionGetProjectIdAttributeType) (ret DistributionGetProjectIdRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetProjectIdAttributeType(arg *DistributionGetProjectIdAttributeType, val DistributionGetProjectIdRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type DistributionGetProjectIdArgType = string
|
||||
type DistributionGetProjectIdRetType = string
|
||||
|
||||
/*
|
||||
types and functions for status
|
||||
*/
|
||||
|
||||
// isEnum
|
||||
|
||||
// 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
|
||||
type DistributionStatus string
|
||||
|
||||
// List of Status
|
||||
const (
|
||||
DISTRIBUTIONSTATUS_CREATING DistributionStatus = "CREATING"
|
||||
DISTRIBUTIONSTATUS_ACTIVE DistributionStatus = "ACTIVE"
|
||||
DISTRIBUTIONSTATUS_UPDATING DistributionStatus = "UPDATING"
|
||||
DISTRIBUTIONSTATUS_DELETING DistributionStatus = "DELETING"
|
||||
DISTRIBUTIONSTATUS_ERROR DistributionStatus = "ERROR"
|
||||
)
|
||||
|
||||
// All allowed values of Distribution enum
|
||||
var AllowedDistributionStatusEnumValues = []DistributionStatus{
|
||||
"CREATING",
|
||||
"ACTIVE",
|
||||
"UPDATING",
|
||||
"DELETING",
|
||||
"ERROR",
|
||||
}
|
||||
|
||||
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
|
||||
type TmpJson DistributionStatus
|
||||
var value TmpJson
|
||||
err := json.Unmarshal(src, &value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Allow unmarshalling zero value for testing purposes
|
||||
var zeroValue TmpJson
|
||||
if value == zeroValue {
|
||||
return nil
|
||||
}
|
||||
enumTypeValue := DistributionStatus(value)
|
||||
for _, existing := range AllowedDistributionStatusEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid Distribution", value)
|
||||
}
|
||||
|
||||
// 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
|
||||
func NewDistributionStatusFromValue(v DistributionStatus) (*DistributionStatus, error) {
|
||||
ev := DistributionStatus(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for DistributionStatus: valid values are %v", v, AllowedDistributionStatusEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v DistributionStatus) IsValid() bool {
|
||||
for _, existing := range AllowedDistributionStatusEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to StatusStatus value
|
||||
func (v DistributionStatus) Ptr() *DistributionStatus {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableDistributionStatus struct {
|
||||
value *DistributionStatus
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDistributionStatus) Get() *DistributionStatus {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDistributionStatus) Set(val *DistributionStatus) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDistributionStatus) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDistributionStatus) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDistributionStatus(val *DistributionStatus) *NullableDistributionStatus {
|
||||
return &NullableDistributionStatus{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDistributionStatus) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDistributionStatus) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
type DistributionGetStatusAttributeType = *DistributionStatus
|
||||
type DistributionGetStatusArgType = DistributionStatus
|
||||
type DistributionGetStatusRetType = DistributionStatus
|
||||
|
||||
func getDistributionGetStatusAttributeTypeOk(arg DistributionGetStatusAttributeType) (ret DistributionGetStatusRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetStatusAttributeType(arg *DistributionGetStatusAttributeType, val DistributionGetStatusRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for updatedAt
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type DistributionGetUpdatedAtAttributeType = *time.Time
|
||||
type DistributionGetUpdatedAtArgType = time.Time
|
||||
type DistributionGetUpdatedAtRetType = time.Time
|
||||
|
||||
func getDistributionGetUpdatedAtAttributeTypeOk(arg DistributionGetUpdatedAtAttributeType) (ret DistributionGetUpdatedAtRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetUpdatedAtAttributeType(arg *DistributionGetUpdatedAtAttributeType, val DistributionGetUpdatedAtRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for waf
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionGetWafAttributeType = *DistributionWaf
|
||||
type DistributionGetWafArgType = DistributionWaf
|
||||
type DistributionGetWafRetType = DistributionWaf
|
||||
|
||||
func getDistributionGetWafAttributeTypeOk(arg DistributionGetWafAttributeType) (ret DistributionGetWafRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionGetWafAttributeType(arg *DistributionGetWafAttributeType, val DistributionGetWafRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// Distribution struct for Distribution
|
||||
type Distribution struct {
|
||||
// REQUIRED
|
||||
Config DistributionGetConfigAttributeType `json:"config" required:"true"`
|
||||
// RFC3339 string defining when the distribution was created
|
||||
// REQUIRED
|
||||
CreatedAt DistributionGetCreatedAtAttributeType `json:"createdAt" required:"true"`
|
||||
// REQUIRED
|
||||
Domains DistributionGetDomainsAttributeType `json:"domains" required:"true"`
|
||||
// This object may be present if, and only if the distribution has encountered an error state.
|
||||
Errors DistributionGetErrorsAttributeType `json:"errors,omitempty"`
|
||||
// REQUIRED
|
||||
Id DistributionGetIdAttributeType `json:"id" required:"true"`
|
||||
// REQUIRED
|
||||
ProjectId DistributionGetProjectIdAttributeType `json:"projectId" required:"true"`
|
||||
// - `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" required:"true"`
|
||||
// RFC3339 string which returns the last time the distribution configuration was modified.
|
||||
// REQUIRED
|
||||
UpdatedAt DistributionGetUpdatedAtAttributeType `json:"updatedAt" required:"true"`
|
||||
Waf DistributionGetWafAttributeType `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 DistributionGetConfigArgType, createdAt DistributionGetCreatedAtArgType, domains DistributionGetDomainsArgType, id DistributionGetIdArgType, projectId DistributionGetProjectIdArgType, status DistributionGetStatusArgType, updatedAt DistributionGetUpdatedAtArgType) *Distribution {
|
||||
this := Distribution{}
|
||||
setDistributionGetConfigAttributeType(&this.Config, config)
|
||||
setDistributionGetCreatedAtAttributeType(&this.CreatedAt, createdAt)
|
||||
setDistributionGetDomainsAttributeType(&this.Domains, domains)
|
||||
setDistributionGetIdAttributeType(&this.Id, id)
|
||||
setDistributionGetProjectIdAttributeType(&this.ProjectId, projectId)
|
||||
setDistributionGetStatusAttributeType(&this.Status, status)
|
||||
setDistributionGetUpdatedAtAttributeType(&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() (ret DistributionGetConfigRetType) {
|
||||
ret, _ = o.GetConfigOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetConfigOk returns a tuple with the Config field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Distribution) GetConfigOk() (ret DistributionGetConfigRetType, ok bool) {
|
||||
return getDistributionGetConfigAttributeTypeOk(o.Config)
|
||||
}
|
||||
|
||||
// SetConfig sets field value
|
||||
func (o *Distribution) SetConfig(v DistributionGetConfigRetType) {
|
||||
setDistributionGetConfigAttributeType(&o.Config, v)
|
||||
}
|
||||
|
||||
// GetCreatedAt returns the CreatedAt field value
|
||||
func (o *Distribution) GetCreatedAt() (ret DistributionGetCreatedAtRetType) {
|
||||
ret, _ = o.GetCreatedAtOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCreatedAtOk returns a tuple with the CreatedAt field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Distribution) GetCreatedAtOk() (ret DistributionGetCreatedAtRetType, ok bool) {
|
||||
return getDistributionGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets field value
|
||||
func (o *Distribution) SetCreatedAt(v DistributionGetCreatedAtRetType) {
|
||||
setDistributionGetCreatedAtAttributeType(&o.CreatedAt, v)
|
||||
}
|
||||
|
||||
// GetDomains returns the Domains field value
|
||||
func (o *Distribution) GetDomains() (ret DistributionGetDomainsRetType) {
|
||||
ret, _ = o.GetDomainsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDomainsOk returns a tuple with the Domains field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Distribution) GetDomainsOk() (ret DistributionGetDomainsRetType, ok bool) {
|
||||
return getDistributionGetDomainsAttributeTypeOk(o.Domains)
|
||||
}
|
||||
|
||||
// SetDomains sets field value
|
||||
func (o *Distribution) SetDomains(v DistributionGetDomainsRetType) {
|
||||
setDistributionGetDomainsAttributeType(&o.Domains, v)
|
||||
}
|
||||
|
||||
// GetErrors returns the Errors field value if set, zero value otherwise.
|
||||
func (o *Distribution) GetErrors() (res DistributionGetErrorsRetType) {
|
||||
res, _ = o.GetErrorsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret DistributionGetErrorsRetType, ok bool) {
|
||||
return getDistributionGetErrorsAttributeTypeOk(o.Errors)
|
||||
}
|
||||
|
||||
// HasErrors returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *Distribution) SetErrors(v DistributionGetErrorsRetType) {
|
||||
setDistributionGetErrorsAttributeType(&o.Errors, v)
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *Distribution) GetId() (ret DistributionGetIdRetType) {
|
||||
ret, _ = o.GetIdOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Distribution) GetIdOk() (ret DistributionGetIdRetType, ok bool) {
|
||||
return getDistributionGetIdAttributeTypeOk(o.Id)
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *Distribution) SetId(v DistributionGetIdRetType) {
|
||||
setDistributionGetIdAttributeType(&o.Id, v)
|
||||
}
|
||||
|
||||
// GetProjectId returns the ProjectId field value
|
||||
func (o *Distribution) GetProjectId() (ret DistributionGetProjectIdRetType) {
|
||||
ret, _ = o.GetProjectIdOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetProjectIdOk returns a tuple with the ProjectId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Distribution) GetProjectIdOk() (ret DistributionGetProjectIdRetType, ok bool) {
|
||||
return getDistributionGetProjectIdAttributeTypeOk(o.ProjectId)
|
||||
}
|
||||
|
||||
// SetProjectId sets field value
|
||||
func (o *Distribution) SetProjectId(v DistributionGetProjectIdRetType) {
|
||||
setDistributionGetProjectIdAttributeType(&o.ProjectId, v)
|
||||
}
|
||||
|
||||
// GetStatus returns the Status field value
|
||||
func (o *Distribution) GetStatus() (ret DistributionGetStatusRetType) {
|
||||
ret, _ = o.GetStatusOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetStatusOk returns a tuple with the Status field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Distribution) GetStatusOk() (ret DistributionGetStatusRetType, ok bool) {
|
||||
return getDistributionGetStatusAttributeTypeOk(o.Status)
|
||||
}
|
||||
|
||||
// SetStatus sets field value
|
||||
func (o *Distribution) SetStatus(v DistributionGetStatusRetType) {
|
||||
setDistributionGetStatusAttributeType(&o.Status, v)
|
||||
}
|
||||
|
||||
// GetUpdatedAt returns the UpdatedAt field value
|
||||
func (o *Distribution) GetUpdatedAt() (ret DistributionGetUpdatedAtRetType) {
|
||||
ret, _ = o.GetUpdatedAtOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Distribution) GetUpdatedAtOk() (ret DistributionGetUpdatedAtRetType, ok bool) {
|
||||
return getDistributionGetUpdatedAtAttributeTypeOk(o.UpdatedAt)
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets field value
|
||||
func (o *Distribution) SetUpdatedAt(v DistributionGetUpdatedAtRetType) {
|
||||
setDistributionGetUpdatedAtAttributeType(&o.UpdatedAt, v)
|
||||
}
|
||||
|
||||
// GetWaf returns the Waf field value if set, zero value otherwise.
|
||||
func (o *Distribution) GetWaf() (res DistributionGetWafRetType) {
|
||||
res, _ = o.GetWafOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret DistributionGetWafRetType, ok bool) {
|
||||
return getDistributionGetWafAttributeTypeOk(o.Waf)
|
||||
}
|
||||
|
||||
// HasWaf returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *Distribution) SetWaf(v DistributionGetWafRetType) {
|
||||
setDistributionGetWafAttributeType(&o.Waf, v)
|
||||
}
|
||||
|
||||
func (o Distribution) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDistributionGetConfigAttributeTypeOk(o.Config); ok {
|
||||
toSerialize["Config"] = val
|
||||
}
|
||||
if val, ok := getDistributionGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
||||
toSerialize["CreatedAt"] = val
|
||||
}
|
||||
if val, ok := getDistributionGetDomainsAttributeTypeOk(o.Domains); ok {
|
||||
toSerialize["Domains"] = val
|
||||
}
|
||||
if val, ok := getDistributionGetErrorsAttributeTypeOk(o.Errors); ok {
|
||||
toSerialize["Errors"] = val
|
||||
}
|
||||
if val, ok := getDistributionGetIdAttributeTypeOk(o.Id); ok {
|
||||
toSerialize["Id"] = val
|
||||
}
|
||||
if val, ok := getDistributionGetProjectIdAttributeTypeOk(o.ProjectId); ok {
|
||||
toSerialize["ProjectId"] = val
|
||||
}
|
||||
if val, ok := getDistributionGetStatusAttributeTypeOk(o.Status); ok {
|
||||
toSerialize["Status"] = val
|
||||
}
|
||||
if val, ok := getDistributionGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok {
|
||||
toSerialize["UpdatedAt"] = val
|
||||
}
|
||||
if val, ok := getDistributionGetWafAttributeTypeOk(o.Waf); ok {
|
||||
toSerialize["Waf"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
477
pkg/cdnbeta/model_distribution_logs_record.go
Normal file
477
pkg/cdnbeta/model_distribution_logs_record.go
Normal file
|
|
@ -0,0 +1,477 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
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:"true"`
|
||||
// REQUIRED
|
||||
DataCenterRegion DistributionLogsRecordGetDataCenterRegionAttributeType `json:"dataCenterRegion" required:"true"`
|
||||
// REQUIRED
|
||||
DistributionId DistributionLogsRecordGetDistributionIdAttributeType `json:"distributionId" required:"true"`
|
||||
// REQUIRED
|
||||
Host DistributionLogsRecordGetHostAttributeType `json:"host" required:"true"`
|
||||
// REQUIRED
|
||||
Path DistributionLogsRecordGetPathAttributeType `json:"path" required:"true"`
|
||||
// ISO 3166-1 A2 compliant country code
|
||||
// REQUIRED
|
||||
RequestCountryCode DistributionLogsRecordGetRequestCountryCodeAttributeType `json:"requestCountryCode" required:"true"`
|
||||
// REQUIRED
|
||||
Size DistributionLogsRecordGetSizeAttributeType `json:"size" required:"true"`
|
||||
// Can be cast to int32 without loss of precision.
|
||||
// REQUIRED
|
||||
StatusCode DistributionLogsRecordGetStatusCodeAttributeType `json:"statusCode" required:"true"`
|
||||
// REQUIRED
|
||||
Timestamp DistributionLogsRecordGetTimestampAttributeType `json:"timestamp" required:"true"`
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_distribution_logs_record_test.go
Normal file
11
pkg/cdnbeta/model_distribution_logs_record_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
346
pkg/cdnbeta/model_distribution_statistics_record.go
Normal file
346
pkg/cdnbeta/model_distribution_statistics_record.go
Normal file
|
|
@ -0,0 +1,346 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the DistributionStatisticsRecord type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DistributionStatisticsRecord{}
|
||||
|
||||
/*
|
||||
types and functions for cachedRequests
|
||||
*/
|
||||
|
||||
// isLong
|
||||
type DistributionStatisticsRecordGetCachedRequestsAttributeType = *int64
|
||||
type DistributionStatisticsRecordGetCachedRequestsArgType = int64
|
||||
type DistributionStatisticsRecordGetCachedRequestsRetType = int64
|
||||
|
||||
func getDistributionStatisticsRecordGetCachedRequestsAttributeTypeOk(arg DistributionStatisticsRecordGetCachedRequestsAttributeType) (ret DistributionStatisticsRecordGetCachedRequestsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordGetCachedRequestsAttributeType(arg *DistributionStatisticsRecordGetCachedRequestsAttributeType, val DistributionStatisticsRecordGetCachedRequestsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for totalRequests
|
||||
*/
|
||||
|
||||
// isLong
|
||||
type DistributionStatisticsRecordGetTotalRequestsAttributeType = *int64
|
||||
type DistributionStatisticsRecordGetTotalRequestsArgType = int64
|
||||
type DistributionStatisticsRecordGetTotalRequestsRetType = int64
|
||||
|
||||
func getDistributionStatisticsRecordGetTotalRequestsAttributeTypeOk(arg DistributionStatisticsRecordGetTotalRequestsAttributeType) (ret DistributionStatisticsRecordGetTotalRequestsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordGetTotalRequestsAttributeType(arg *DistributionStatisticsRecordGetTotalRequestsAttributeType, val DistributionStatisticsRecordGetTotalRequestsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for totalTrafficBytes
|
||||
*/
|
||||
|
||||
// isLong
|
||||
type DistributionStatisticsRecordGetTotalTrafficBytesAttributeType = *int64
|
||||
type DistributionStatisticsRecordGetTotalTrafficBytesArgType = int64
|
||||
type DistributionStatisticsRecordGetTotalTrafficBytesRetType = int64
|
||||
|
||||
func getDistributionStatisticsRecordGetTotalTrafficBytesAttributeTypeOk(arg DistributionStatisticsRecordGetTotalTrafficBytesAttributeType) (ret DistributionStatisticsRecordGetTotalTrafficBytesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordGetTotalTrafficBytesAttributeType(arg *DistributionStatisticsRecordGetTotalTrafficBytesAttributeType, val DistributionStatisticsRecordGetTotalTrafficBytesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for end
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type DistributionStatisticsRecordGetEndAttributeType = *time.Time
|
||||
type DistributionStatisticsRecordGetEndArgType = time.Time
|
||||
type DistributionStatisticsRecordGetEndRetType = time.Time
|
||||
|
||||
func getDistributionStatisticsRecordGetEndAttributeTypeOk(arg DistributionStatisticsRecordGetEndAttributeType) (ret DistributionStatisticsRecordGetEndRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordGetEndAttributeType(arg *DistributionStatisticsRecordGetEndAttributeType, val DistributionStatisticsRecordGetEndRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for regions
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionStatisticsRecordGetRegionsAttributeType = *DistributionStatisticsRecordRegions
|
||||
type DistributionStatisticsRecordGetRegionsArgType = DistributionStatisticsRecordRegions
|
||||
type DistributionStatisticsRecordGetRegionsRetType = DistributionStatisticsRecordRegions
|
||||
|
||||
func getDistributionStatisticsRecordGetRegionsAttributeTypeOk(arg DistributionStatisticsRecordGetRegionsAttributeType) (ret DistributionStatisticsRecordGetRegionsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordGetRegionsAttributeType(arg *DistributionStatisticsRecordGetRegionsAttributeType, val DistributionStatisticsRecordGetRegionsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for start
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type DistributionStatisticsRecordGetStartAttributeType = *time.Time
|
||||
type DistributionStatisticsRecordGetStartArgType = time.Time
|
||||
type DistributionStatisticsRecordGetStartRetType = time.Time
|
||||
|
||||
func getDistributionStatisticsRecordGetStartAttributeTypeOk(arg DistributionStatisticsRecordGetStartAttributeType) (ret DistributionStatisticsRecordGetStartRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordGetStartAttributeType(arg *DistributionStatisticsRecordGetStartAttributeType, val DistributionStatisticsRecordGetStartRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// DistributionStatisticsRecord Aggregated statistics of a distribution during a time interval
|
||||
type DistributionStatisticsRecord struct {
|
||||
// Number of cached requests that were served
|
||||
// REQUIRED
|
||||
CachedRequests DistributionStatisticsRecordGetCachedRequestsAttributeType `json:"cachedRequests" required:"true"`
|
||||
// Total number of requests that were served
|
||||
// REQUIRED
|
||||
TotalRequests DistributionStatisticsRecordGetTotalRequestsAttributeType `json:"totalRequests" required:"true"`
|
||||
// Total traffic in bytes that occurred during the time interval
|
||||
// REQUIRED
|
||||
TotalTrafficBytes DistributionStatisticsRecordGetTotalTrafficBytesAttributeType `json:"totalTrafficBytes" required:"true"`
|
||||
// Exclusive end of the time interval the statistics refer to
|
||||
// REQUIRED
|
||||
End DistributionStatisticsRecordGetEndAttributeType `json:"end" required:"true"`
|
||||
// REQUIRED
|
||||
Regions DistributionStatisticsRecordGetRegionsAttributeType `json:"regions" required:"true"`
|
||||
// Start of the time interval the statistics refer to
|
||||
// REQUIRED
|
||||
Start DistributionStatisticsRecordGetStartAttributeType `json:"start" required:"true"`
|
||||
}
|
||||
|
||||
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 DistributionStatisticsRecordGetCachedRequestsArgType, totalRequests DistributionStatisticsRecordGetTotalRequestsArgType, totalTrafficBytes DistributionStatisticsRecordGetTotalTrafficBytesArgType, end DistributionStatisticsRecordGetEndArgType, regions DistributionStatisticsRecordGetRegionsArgType, start DistributionStatisticsRecordGetStartArgType) *DistributionStatisticsRecord {
|
||||
this := DistributionStatisticsRecord{}
|
||||
setDistributionStatisticsRecordGetCachedRequestsAttributeType(&this.CachedRequests, cachedRequests)
|
||||
setDistributionStatisticsRecordGetTotalRequestsAttributeType(&this.TotalRequests, totalRequests)
|
||||
setDistributionStatisticsRecordGetTotalTrafficBytesAttributeType(&this.TotalTrafficBytes, totalTrafficBytes)
|
||||
setDistributionStatisticsRecordGetEndAttributeType(&this.End, end)
|
||||
setDistributionStatisticsRecordGetRegionsAttributeType(&this.Regions, regions)
|
||||
setDistributionStatisticsRecordGetStartAttributeType(&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() (ret DistributionStatisticsRecordGetCachedRequestsRetType) {
|
||||
ret, _ = o.GetCachedRequestsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCachedRequestsOk returns a tuple with the CachedRequests field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecord) GetCachedRequestsOk() (ret DistributionStatisticsRecordGetCachedRequestsRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordGetCachedRequestsAttributeTypeOk(o.CachedRequests)
|
||||
}
|
||||
|
||||
// SetCachedRequests sets field value
|
||||
func (o *DistributionStatisticsRecord) SetCachedRequests(v DistributionStatisticsRecordGetCachedRequestsRetType) {
|
||||
setDistributionStatisticsRecordGetCachedRequestsAttributeType(&o.CachedRequests, v)
|
||||
}
|
||||
|
||||
// GetTotalRequests returns the TotalRequests field value
|
||||
func (o *DistributionStatisticsRecord) GetTotalRequests() (ret DistributionStatisticsRecordGetTotalRequestsRetType) {
|
||||
ret, _ = o.GetTotalRequestsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTotalRequestsOk returns a tuple with the TotalRequests field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecord) GetTotalRequestsOk() (ret DistributionStatisticsRecordGetTotalRequestsRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordGetTotalRequestsAttributeTypeOk(o.TotalRequests)
|
||||
}
|
||||
|
||||
// SetTotalRequests sets field value
|
||||
func (o *DistributionStatisticsRecord) SetTotalRequests(v DistributionStatisticsRecordGetTotalRequestsRetType) {
|
||||
setDistributionStatisticsRecordGetTotalRequestsAttributeType(&o.TotalRequests, v)
|
||||
}
|
||||
|
||||
// GetTotalTrafficBytes returns the TotalTrafficBytes field value
|
||||
func (o *DistributionStatisticsRecord) GetTotalTrafficBytes() (ret DistributionStatisticsRecordGetTotalTrafficBytesRetType) {
|
||||
ret, _ = o.GetTotalTrafficBytesOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecord) GetTotalTrafficBytesOk() (ret DistributionStatisticsRecordGetTotalTrafficBytesRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordGetTotalTrafficBytesAttributeTypeOk(o.TotalTrafficBytes)
|
||||
}
|
||||
|
||||
// SetTotalTrafficBytes sets field value
|
||||
func (o *DistributionStatisticsRecord) SetTotalTrafficBytes(v DistributionStatisticsRecordGetTotalTrafficBytesRetType) {
|
||||
setDistributionStatisticsRecordGetTotalTrafficBytesAttributeType(&o.TotalTrafficBytes, v)
|
||||
}
|
||||
|
||||
// GetEnd returns the End field value
|
||||
func (o *DistributionStatisticsRecord) GetEnd() (ret DistributionStatisticsRecordGetEndRetType) {
|
||||
ret, _ = o.GetEndOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetEndOk returns a tuple with the End field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecord) GetEndOk() (ret DistributionStatisticsRecordGetEndRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordGetEndAttributeTypeOk(o.End)
|
||||
}
|
||||
|
||||
// SetEnd sets field value
|
||||
func (o *DistributionStatisticsRecord) SetEnd(v DistributionStatisticsRecordGetEndRetType) {
|
||||
setDistributionStatisticsRecordGetEndAttributeType(&o.End, v)
|
||||
}
|
||||
|
||||
// GetRegions returns the Regions field value
|
||||
func (o *DistributionStatisticsRecord) GetRegions() (ret DistributionStatisticsRecordGetRegionsRetType) {
|
||||
ret, _ = o.GetRegionsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetRegionsOk returns a tuple with the Regions field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecord) GetRegionsOk() (ret DistributionStatisticsRecordGetRegionsRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordGetRegionsAttributeTypeOk(o.Regions)
|
||||
}
|
||||
|
||||
// SetRegions sets field value
|
||||
func (o *DistributionStatisticsRecord) SetRegions(v DistributionStatisticsRecordGetRegionsRetType) {
|
||||
setDistributionStatisticsRecordGetRegionsAttributeType(&o.Regions, v)
|
||||
}
|
||||
|
||||
// GetStart returns the Start field value
|
||||
func (o *DistributionStatisticsRecord) GetStart() (ret DistributionStatisticsRecordGetStartRetType) {
|
||||
ret, _ = o.GetStartOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetStartOk returns a tuple with the Start field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecord) GetStartOk() (ret DistributionStatisticsRecordGetStartRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordGetStartAttributeTypeOk(o.Start)
|
||||
}
|
||||
|
||||
// SetStart sets field value
|
||||
func (o *DistributionStatisticsRecord) SetStart(v DistributionStatisticsRecordGetStartRetType) {
|
||||
setDistributionStatisticsRecordGetStartAttributeType(&o.Start, v)
|
||||
}
|
||||
|
||||
func (o DistributionStatisticsRecord) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDistributionStatisticsRecordGetCachedRequestsAttributeTypeOk(o.CachedRequests); ok {
|
||||
toSerialize["CachedRequests"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordGetTotalRequestsAttributeTypeOk(o.TotalRequests); ok {
|
||||
toSerialize["TotalRequests"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordGetTotalTrafficBytesAttributeTypeOk(o.TotalTrafficBytes); ok {
|
||||
toSerialize["TotalTrafficBytes"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordGetEndAttributeTypeOk(o.End); ok {
|
||||
toSerialize["End"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordGetRegionsAttributeTypeOk(o.Regions); ok {
|
||||
toSerialize["Regions"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordGetStartAttributeTypeOk(o.Start); ok {
|
||||
toSerialize["Start"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
214
pkg/cdnbeta/model_distribution_statistics_record_all_of.go
Normal file
214
pkg/cdnbeta/model_distribution_statistics_record_all_of.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the DistributionStatisticsRecordAllOf type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DistributionStatisticsRecordAllOf{}
|
||||
|
||||
/*
|
||||
types and functions for end
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type DistributionStatisticsRecordAllOfGetEndAttributeType = *time.Time
|
||||
type DistributionStatisticsRecordAllOfGetEndArgType = time.Time
|
||||
type DistributionStatisticsRecordAllOfGetEndRetType = time.Time
|
||||
|
||||
func getDistributionStatisticsRecordAllOfGetEndAttributeTypeOk(arg DistributionStatisticsRecordAllOfGetEndAttributeType) (ret DistributionStatisticsRecordAllOfGetEndRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordAllOfGetEndAttributeType(arg *DistributionStatisticsRecordAllOfGetEndAttributeType, val DistributionStatisticsRecordAllOfGetEndRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for regions
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionStatisticsRecordAllOfGetRegionsAttributeType = *DistributionStatisticsRecordRegions
|
||||
type DistributionStatisticsRecordAllOfGetRegionsArgType = DistributionStatisticsRecordRegions
|
||||
type DistributionStatisticsRecordAllOfGetRegionsRetType = DistributionStatisticsRecordRegions
|
||||
|
||||
func getDistributionStatisticsRecordAllOfGetRegionsAttributeTypeOk(arg DistributionStatisticsRecordAllOfGetRegionsAttributeType) (ret DistributionStatisticsRecordAllOfGetRegionsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordAllOfGetRegionsAttributeType(arg *DistributionStatisticsRecordAllOfGetRegionsAttributeType, val DistributionStatisticsRecordAllOfGetRegionsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for start
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type DistributionStatisticsRecordAllOfGetStartAttributeType = *time.Time
|
||||
type DistributionStatisticsRecordAllOfGetStartArgType = time.Time
|
||||
type DistributionStatisticsRecordAllOfGetStartRetType = time.Time
|
||||
|
||||
func getDistributionStatisticsRecordAllOfGetStartAttributeTypeOk(arg DistributionStatisticsRecordAllOfGetStartAttributeType) (ret DistributionStatisticsRecordAllOfGetStartRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordAllOfGetStartAttributeType(arg *DistributionStatisticsRecordAllOfGetStartAttributeType, val DistributionStatisticsRecordAllOfGetStartRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// DistributionStatisticsRecordAllOf struct for DistributionStatisticsRecordAllOf
|
||||
type DistributionStatisticsRecordAllOf struct {
|
||||
// Exclusive end of the time interval the statistics refer to
|
||||
// REQUIRED
|
||||
End DistributionStatisticsRecordAllOfGetEndAttributeType `json:"end" required:"true"`
|
||||
// REQUIRED
|
||||
Regions DistributionStatisticsRecordAllOfGetRegionsAttributeType `json:"regions" required:"true"`
|
||||
// Start of the time interval the statistics refer to
|
||||
// REQUIRED
|
||||
Start DistributionStatisticsRecordAllOfGetStartAttributeType `json:"start" required:"true"`
|
||||
}
|
||||
|
||||
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
|
||||
func NewDistributionStatisticsRecordAllOf(end DistributionStatisticsRecordAllOfGetEndArgType, regions DistributionStatisticsRecordAllOfGetRegionsArgType, start DistributionStatisticsRecordAllOfGetStartArgType) *DistributionStatisticsRecordAllOf {
|
||||
this := DistributionStatisticsRecordAllOf{}
|
||||
setDistributionStatisticsRecordAllOfGetEndAttributeType(&this.End, end)
|
||||
setDistributionStatisticsRecordAllOfGetRegionsAttributeType(&this.Regions, regions)
|
||||
setDistributionStatisticsRecordAllOfGetStartAttributeType(&this.Start, start)
|
||||
return &this
|
||||
}
|
||||
|
||||
// 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
|
||||
func NewDistributionStatisticsRecordAllOfWithDefaults() *DistributionStatisticsRecordAllOf {
|
||||
this := DistributionStatisticsRecordAllOf{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetEnd returns the End field value
|
||||
func (o *DistributionStatisticsRecordAllOf) GetEnd() (ret DistributionStatisticsRecordAllOfGetEndRetType) {
|
||||
ret, _ = o.GetEndOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetEndOk returns a tuple with the End field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordAllOf) GetEndOk() (ret DistributionStatisticsRecordAllOfGetEndRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordAllOfGetEndAttributeTypeOk(o.End)
|
||||
}
|
||||
|
||||
// SetEnd sets field value
|
||||
func (o *DistributionStatisticsRecordAllOf) SetEnd(v DistributionStatisticsRecordAllOfGetEndRetType) {
|
||||
setDistributionStatisticsRecordAllOfGetEndAttributeType(&o.End, v)
|
||||
}
|
||||
|
||||
// GetRegions returns the Regions field value
|
||||
func (o *DistributionStatisticsRecordAllOf) GetRegions() (ret DistributionStatisticsRecordAllOfGetRegionsRetType) {
|
||||
ret, _ = o.GetRegionsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetRegionsOk returns a tuple with the Regions field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordAllOf) GetRegionsOk() (ret DistributionStatisticsRecordAllOfGetRegionsRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordAllOfGetRegionsAttributeTypeOk(o.Regions)
|
||||
}
|
||||
|
||||
// SetRegions sets field value
|
||||
func (o *DistributionStatisticsRecordAllOf) SetRegions(v DistributionStatisticsRecordAllOfGetRegionsRetType) {
|
||||
setDistributionStatisticsRecordAllOfGetRegionsAttributeType(&o.Regions, v)
|
||||
}
|
||||
|
||||
// GetStart returns the Start field value
|
||||
func (o *DistributionStatisticsRecordAllOf) GetStart() (ret DistributionStatisticsRecordAllOfGetStartRetType) {
|
||||
ret, _ = o.GetStartOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetStartOk returns a tuple with the Start field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordAllOf) GetStartOk() (ret DistributionStatisticsRecordAllOfGetStartRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordAllOfGetStartAttributeTypeOk(o.Start)
|
||||
}
|
||||
|
||||
// SetStart sets field value
|
||||
func (o *DistributionStatisticsRecordAllOf) SetStart(v DistributionStatisticsRecordAllOfGetStartRetType) {
|
||||
setDistributionStatisticsRecordAllOfGetStartAttributeType(&o.Start, v)
|
||||
}
|
||||
|
||||
func (o DistributionStatisticsRecordAllOf) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDistributionStatisticsRecordAllOfGetEndAttributeTypeOk(o.End); ok {
|
||||
toSerialize["End"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordAllOfGetRegionsAttributeTypeOk(o.Regions); ok {
|
||||
toSerialize["Regions"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordAllOfGetStartAttributeTypeOk(o.Start); ok {
|
||||
toSerialize["Start"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableDistributionStatisticsRecordAllOf struct {
|
||||
value *DistributionStatisticsRecordAllOf
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDistributionStatisticsRecordAllOf) Get() *DistributionStatisticsRecordAllOf {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDistributionStatisticsRecordAllOf) Set(val *DistributionStatisticsRecordAllOf) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDistributionStatisticsRecordAllOf) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDistributionStatisticsRecordAllOf) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDistributionStatisticsRecordAllOf(val *DistributionStatisticsRecordAllOf) *NullableDistributionStatisticsRecordAllOf {
|
||||
return &NullableDistributionStatisticsRecordAllOf{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDistributionStatisticsRecordAllOf) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDistributionStatisticsRecordAllOf) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
214
pkg/cdnbeta/model_distribution_statistics_record_entry.go
Normal file
214
pkg/cdnbeta/model_distribution_statistics_record_entry.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the DistributionStatisticsRecordEntry type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DistributionStatisticsRecordEntry{}
|
||||
|
||||
/*
|
||||
types and functions for cachedRequests
|
||||
*/
|
||||
|
||||
// isLong
|
||||
type DistributionStatisticsRecordEntryGetCachedRequestsAttributeType = *int64
|
||||
type DistributionStatisticsRecordEntryGetCachedRequestsArgType = int64
|
||||
type DistributionStatisticsRecordEntryGetCachedRequestsRetType = int64
|
||||
|
||||
func getDistributionStatisticsRecordEntryGetCachedRequestsAttributeTypeOk(arg DistributionStatisticsRecordEntryGetCachedRequestsAttributeType) (ret DistributionStatisticsRecordEntryGetCachedRequestsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordEntryGetCachedRequestsAttributeType(arg *DistributionStatisticsRecordEntryGetCachedRequestsAttributeType, val DistributionStatisticsRecordEntryGetCachedRequestsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for totalRequests
|
||||
*/
|
||||
|
||||
// isLong
|
||||
type DistributionStatisticsRecordEntryGetTotalRequestsAttributeType = *int64
|
||||
type DistributionStatisticsRecordEntryGetTotalRequestsArgType = int64
|
||||
type DistributionStatisticsRecordEntryGetTotalRequestsRetType = int64
|
||||
|
||||
func getDistributionStatisticsRecordEntryGetTotalRequestsAttributeTypeOk(arg DistributionStatisticsRecordEntryGetTotalRequestsAttributeType) (ret DistributionStatisticsRecordEntryGetTotalRequestsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordEntryGetTotalRequestsAttributeType(arg *DistributionStatisticsRecordEntryGetTotalRequestsAttributeType, val DistributionStatisticsRecordEntryGetTotalRequestsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for totalTrafficBytes
|
||||
*/
|
||||
|
||||
// isLong
|
||||
type DistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType = *int64
|
||||
type DistributionStatisticsRecordEntryGetTotalTrafficBytesArgType = int64
|
||||
type DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType = int64
|
||||
|
||||
func getDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeTypeOk(arg DistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType) (ret DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType(arg *DistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType, val DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// DistributionStatisticsRecordEntry struct for DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordEntry struct {
|
||||
// Number of cached requests that were served
|
||||
// REQUIRED
|
||||
CachedRequests DistributionStatisticsRecordEntryGetCachedRequestsAttributeType `json:"cachedRequests" required:"true"`
|
||||
// Total number of requests that were served
|
||||
// REQUIRED
|
||||
TotalRequests DistributionStatisticsRecordEntryGetTotalRequestsAttributeType `json:"totalRequests" required:"true"`
|
||||
// Total traffic in bytes that occurred during the time interval
|
||||
// REQUIRED
|
||||
TotalTrafficBytes DistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType `json:"totalTrafficBytes" required:"true"`
|
||||
}
|
||||
|
||||
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 DistributionStatisticsRecordEntryGetCachedRequestsArgType, totalRequests DistributionStatisticsRecordEntryGetTotalRequestsArgType, totalTrafficBytes DistributionStatisticsRecordEntryGetTotalTrafficBytesArgType) *DistributionStatisticsRecordEntry {
|
||||
this := DistributionStatisticsRecordEntry{}
|
||||
setDistributionStatisticsRecordEntryGetCachedRequestsAttributeType(&this.CachedRequests, cachedRequests)
|
||||
setDistributionStatisticsRecordEntryGetTotalRequestsAttributeType(&this.TotalRequests, totalRequests)
|
||||
setDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType(&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() (ret DistributionStatisticsRecordEntryGetCachedRequestsRetType) {
|
||||
ret, _ = o.GetCachedRequestsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCachedRequestsOk returns a tuple with the CachedRequests field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordEntry) GetCachedRequestsOk() (ret DistributionStatisticsRecordEntryGetCachedRequestsRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordEntryGetCachedRequestsAttributeTypeOk(o.CachedRequests)
|
||||
}
|
||||
|
||||
// SetCachedRequests sets field value
|
||||
func (o *DistributionStatisticsRecordEntry) SetCachedRequests(v DistributionStatisticsRecordEntryGetCachedRequestsRetType) {
|
||||
setDistributionStatisticsRecordEntryGetCachedRequestsAttributeType(&o.CachedRequests, v)
|
||||
}
|
||||
|
||||
// GetTotalRequests returns the TotalRequests field value
|
||||
func (o *DistributionStatisticsRecordEntry) GetTotalRequests() (ret DistributionStatisticsRecordEntryGetTotalRequestsRetType) {
|
||||
ret, _ = o.GetTotalRequestsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTotalRequestsOk returns a tuple with the TotalRequests field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordEntry) GetTotalRequestsOk() (ret DistributionStatisticsRecordEntryGetTotalRequestsRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordEntryGetTotalRequestsAttributeTypeOk(o.TotalRequests)
|
||||
}
|
||||
|
||||
// SetTotalRequests sets field value
|
||||
func (o *DistributionStatisticsRecordEntry) SetTotalRequests(v DistributionStatisticsRecordEntryGetTotalRequestsRetType) {
|
||||
setDistributionStatisticsRecordEntryGetTotalRequestsAttributeType(&o.TotalRequests, v)
|
||||
}
|
||||
|
||||
// GetTotalTrafficBytes returns the TotalTrafficBytes field value
|
||||
func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytes() (ret DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType) {
|
||||
ret, _ = o.GetTotalTrafficBytesOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTotalTrafficBytesOk returns a tuple with the TotalTrafficBytes field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordEntry) GetTotalTrafficBytesOk() (ret DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeTypeOk(o.TotalTrafficBytes)
|
||||
}
|
||||
|
||||
// SetTotalTrafficBytes sets field value
|
||||
func (o *DistributionStatisticsRecordEntry) SetTotalTrafficBytes(v DistributionStatisticsRecordEntryGetTotalTrafficBytesRetType) {
|
||||
setDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeType(&o.TotalTrafficBytes, v)
|
||||
}
|
||||
|
||||
func (o DistributionStatisticsRecordEntry) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDistributionStatisticsRecordEntryGetCachedRequestsAttributeTypeOk(o.CachedRequests); ok {
|
||||
toSerialize["CachedRequests"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordEntryGetTotalRequestsAttributeTypeOk(o.TotalRequests); ok {
|
||||
toSerialize["TotalRequests"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordEntryGetTotalTrafficBytesAttributeTypeOk(o.TotalTrafficBytes); ok {
|
||||
toSerialize["TotalTrafficBytes"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
297
pkg/cdnbeta/model_distribution_statistics_record_regions.go
Normal file
297
pkg/cdnbeta/model_distribution_statistics_record_regions.go
Normal file
|
|
@ -0,0 +1,297 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the DistributionStatisticsRecordRegions type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DistributionStatisticsRecordRegions{}
|
||||
|
||||
/*
|
||||
types and functions for AF
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionStatisticsRecordRegionsGetAFAttributeType = *DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetAFArgType = DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetAFRetType = DistributionStatisticsRecordEntry
|
||||
|
||||
func getDistributionStatisticsRecordRegionsGetAFAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetAFAttributeType) (ret DistributionStatisticsRecordRegionsGetAFRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordRegionsGetAFAttributeType(arg *DistributionStatisticsRecordRegionsGetAFAttributeType, val DistributionStatisticsRecordRegionsGetAFRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for ASIA
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionStatisticsRecordRegionsGetASIAAttributeType = *DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetASIAArgType = DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetASIARetType = DistributionStatisticsRecordEntry
|
||||
|
||||
func getDistributionStatisticsRecordRegionsGetASIAAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetASIAAttributeType) (ret DistributionStatisticsRecordRegionsGetASIARetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordRegionsGetASIAAttributeType(arg *DistributionStatisticsRecordRegionsGetASIAAttributeType, val DistributionStatisticsRecordRegionsGetASIARetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for EU
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionStatisticsRecordRegionsGetEUAttributeType = *DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetEUArgType = DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetEURetType = DistributionStatisticsRecordEntry
|
||||
|
||||
func getDistributionStatisticsRecordRegionsGetEUAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetEUAttributeType) (ret DistributionStatisticsRecordRegionsGetEURetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordRegionsGetEUAttributeType(arg *DistributionStatisticsRecordRegionsGetEUAttributeType, val DistributionStatisticsRecordRegionsGetEURetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for SA
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionStatisticsRecordRegionsGetSAAttributeType = *DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetSAArgType = DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetSARetType = DistributionStatisticsRecordEntry
|
||||
|
||||
func getDistributionStatisticsRecordRegionsGetSAAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetSAAttributeType) (ret DistributionStatisticsRecordRegionsGetSARetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionStatisticsRecordRegionsGetSAAttributeType(arg *DistributionStatisticsRecordRegionsGetSAAttributeType, val DistributionStatisticsRecordRegionsGetSARetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for US
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type DistributionStatisticsRecordRegionsGetUSAttributeType = *DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetUSArgType = DistributionStatisticsRecordEntry
|
||||
type DistributionStatisticsRecordRegionsGetUSRetType = DistributionStatisticsRecordEntry
|
||||
|
||||
func getDistributionStatisticsRecordRegionsGetUSAttributeTypeOk(arg DistributionStatisticsRecordRegionsGetUSAttributeType) (ret DistributionStatisticsRecordRegionsGetUSRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
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
|
||||
type DistributionStatisticsRecordRegions struct {
|
||||
// REQUIRED
|
||||
AF DistributionStatisticsRecordRegionsGetAFAttributeType `json:"AF" required:"true"`
|
||||
// REQUIRED
|
||||
ASIA DistributionStatisticsRecordRegionsGetASIAAttributeType `json:"ASIA" required:"true"`
|
||||
// REQUIRED
|
||||
EU DistributionStatisticsRecordRegionsGetEUAttributeType `json:"EU" required:"true"`
|
||||
// REQUIRED
|
||||
SA DistributionStatisticsRecordRegionsGetSAAttributeType `json:"SA" required:"true"`
|
||||
// REQUIRED
|
||||
US DistributionStatisticsRecordRegionsGetUSAttributeType `json:"US" required:"true"`
|
||||
}
|
||||
|
||||
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 DistributionStatisticsRecordRegionsGetAFArgType, aSIA DistributionStatisticsRecordRegionsGetASIAArgType, eU DistributionStatisticsRecordRegionsGetEUArgType, sA DistributionStatisticsRecordRegionsGetSAArgType, uS DistributionStatisticsRecordRegionsGetUSArgType) *DistributionStatisticsRecordRegions {
|
||||
this := DistributionStatisticsRecordRegions{}
|
||||
setDistributionStatisticsRecordRegionsGetAFAttributeType(&this.AF, aF)
|
||||
setDistributionStatisticsRecordRegionsGetASIAAttributeType(&this.ASIA, aSIA)
|
||||
setDistributionStatisticsRecordRegionsGetEUAttributeType(&this.EU, eU)
|
||||
setDistributionStatisticsRecordRegionsGetSAAttributeType(&this.SA, sA)
|
||||
setDistributionStatisticsRecordRegionsGetUSAttributeType(&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() (ret DistributionStatisticsRecordRegionsGetAFRetType) {
|
||||
ret, _ = o.GetAFOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetAFOk returns a tuple with the AF field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordRegions) GetAFOk() (ret DistributionStatisticsRecordRegionsGetAFRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordRegionsGetAFAttributeTypeOk(o.AF)
|
||||
}
|
||||
|
||||
// SetAF sets field value
|
||||
func (o *DistributionStatisticsRecordRegions) SetAF(v DistributionStatisticsRecordRegionsGetAFRetType) {
|
||||
setDistributionStatisticsRecordRegionsGetAFAttributeType(&o.AF, v)
|
||||
}
|
||||
|
||||
// GetASIA returns the ASIA field value
|
||||
func (o *DistributionStatisticsRecordRegions) GetASIA() (ret DistributionStatisticsRecordRegionsGetASIARetType) {
|
||||
ret, _ = o.GetASIAOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetASIAOk returns a tuple with the ASIA field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordRegions) GetASIAOk() (ret DistributionStatisticsRecordRegionsGetASIARetType, ok bool) {
|
||||
return getDistributionStatisticsRecordRegionsGetASIAAttributeTypeOk(o.ASIA)
|
||||
}
|
||||
|
||||
// SetASIA sets field value
|
||||
func (o *DistributionStatisticsRecordRegions) SetASIA(v DistributionStatisticsRecordRegionsGetASIARetType) {
|
||||
setDistributionStatisticsRecordRegionsGetASIAAttributeType(&o.ASIA, v)
|
||||
}
|
||||
|
||||
// GetEU returns the EU field value
|
||||
func (o *DistributionStatisticsRecordRegions) GetEU() (ret DistributionStatisticsRecordRegionsGetEURetType) {
|
||||
ret, _ = o.GetEUOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetEUOk returns a tuple with the EU field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordRegions) GetEUOk() (ret DistributionStatisticsRecordRegionsGetEURetType, ok bool) {
|
||||
return getDistributionStatisticsRecordRegionsGetEUAttributeTypeOk(o.EU)
|
||||
}
|
||||
|
||||
// SetEU sets field value
|
||||
func (o *DistributionStatisticsRecordRegions) SetEU(v DistributionStatisticsRecordRegionsGetEURetType) {
|
||||
setDistributionStatisticsRecordRegionsGetEUAttributeType(&o.EU, v)
|
||||
}
|
||||
|
||||
// GetSA returns the SA field value
|
||||
func (o *DistributionStatisticsRecordRegions) GetSA() (ret DistributionStatisticsRecordRegionsGetSARetType) {
|
||||
ret, _ = o.GetSAOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetSAOk returns a tuple with the SA field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordRegions) GetSAOk() (ret DistributionStatisticsRecordRegionsGetSARetType, ok bool) {
|
||||
return getDistributionStatisticsRecordRegionsGetSAAttributeTypeOk(o.SA)
|
||||
}
|
||||
|
||||
// SetSA sets field value
|
||||
func (o *DistributionStatisticsRecordRegions) SetSA(v DistributionStatisticsRecordRegionsGetSARetType) {
|
||||
setDistributionStatisticsRecordRegionsGetSAAttributeType(&o.SA, v)
|
||||
}
|
||||
|
||||
// GetUS returns the US field value
|
||||
func (o *DistributionStatisticsRecordRegions) GetUS() (ret DistributionStatisticsRecordRegionsGetUSRetType) {
|
||||
ret, _ = o.GetUSOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetUSOk returns a tuple with the US field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionStatisticsRecordRegions) GetUSOk() (ret DistributionStatisticsRecordRegionsGetUSRetType, ok bool) {
|
||||
return getDistributionStatisticsRecordRegionsGetUSAttributeTypeOk(o.US)
|
||||
}
|
||||
|
||||
// SetUS sets field value
|
||||
func (o *DistributionStatisticsRecordRegions) SetUS(v DistributionStatisticsRecordRegionsGetUSRetType) {
|
||||
setDistributionStatisticsRecordRegionsGetUSAttributeType(&o.US, v)
|
||||
}
|
||||
|
||||
func (o DistributionStatisticsRecordRegions) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDistributionStatisticsRecordRegionsGetAFAttributeTypeOk(o.AF); ok {
|
||||
toSerialize["AF"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordRegionsGetASIAAttributeTypeOk(o.ASIA); ok {
|
||||
toSerialize["ASIA"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordRegionsGetEUAttributeTypeOk(o.EU); ok {
|
||||
toSerialize["EU"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordRegionsGetSAAttributeTypeOk(o.SA); ok {
|
||||
toSerialize["SA"] = val
|
||||
}
|
||||
if val, ok := getDistributionStatisticsRecordRegionsGetUSAttributeTypeOk(o.US); ok {
|
||||
toSerialize["US"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
11
pkg/cdnbeta/model_distribution_statistics_record_test.go
Normal file
11
pkg/cdnbeta/model_distribution_statistics_record_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
79
pkg/cdnbeta/model_distribution_test.go
Normal file
79
pkg/cdnbeta/model_distribution_test.go
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isEnum
|
||||
|
||||
func TestDistributionStatus_UnmarshalJSON(t *testing.T) {
|
||||
type args struct {
|
||||
src []byte
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: `success - possible enum value no. 1`,
|
||||
args: args{
|
||||
src: []byte(`"CREATING"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 2`,
|
||||
args: args{
|
||||
src: []byte(`"ACTIVE"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 3`,
|
||||
args: args{
|
||||
src: []byte(`"UPDATING"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 4`,
|
||||
args: args{
|
||||
src: []byte(`"DELETING"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 5`,
|
||||
args: args{
|
||||
src: []byte(`"ERROR"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "fail",
|
||||
args: args{
|
||||
src: []byte("\"FOOBAR\""),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := DistributionStatus("")
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
211
pkg/cdnbeta/model_distribution_waf.go
Normal file
211
pkg/cdnbeta/model_distribution_waf.go
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the DistributionWaf type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DistributionWaf{}
|
||||
|
||||
/*
|
||||
types and functions for disabledRules
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type DistributionWafGetDisabledRulesAttributeType = *[]WafStatusRuleBlock
|
||||
type DistributionWafGetDisabledRulesArgType = []WafStatusRuleBlock
|
||||
type DistributionWafGetDisabledRulesRetType = []WafStatusRuleBlock
|
||||
|
||||
func getDistributionWafGetDisabledRulesAttributeTypeOk(arg DistributionWafGetDisabledRulesAttributeType) (ret DistributionWafGetDisabledRulesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionWafGetDisabledRulesAttributeType(arg *DistributionWafGetDisabledRulesAttributeType, val DistributionWafGetDisabledRulesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for enabledRules
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type DistributionWafGetEnabledRulesAttributeType = *[]WafStatusRuleBlock
|
||||
type DistributionWafGetEnabledRulesArgType = []WafStatusRuleBlock
|
||||
type DistributionWafGetEnabledRulesRetType = []WafStatusRuleBlock
|
||||
|
||||
func getDistributionWafGetEnabledRulesAttributeTypeOk(arg DistributionWafGetEnabledRulesAttributeType) (ret DistributionWafGetEnabledRulesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDistributionWafGetEnabledRulesAttributeType(arg *DistributionWafGetEnabledRulesAttributeType, val DistributionWafGetEnabledRulesRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for logOnlyRules
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type DistributionWafGetLogOnlyRulesAttributeType = *[]WafStatusRuleBlock
|
||||
type DistributionWafGetLogOnlyRulesArgType = []WafStatusRuleBlock
|
||||
type DistributionWafGetLogOnlyRulesRetType = []WafStatusRuleBlock
|
||||
|
||||
func getDistributionWafGetLogOnlyRulesAttributeTypeOk(arg DistributionWafGetLogOnlyRulesAttributeType) (ret DistributionWafGetLogOnlyRulesRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
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!**
|
||||
type DistributionWaf struct {
|
||||
// REQUIRED
|
||||
DisabledRules DistributionWafGetDisabledRulesAttributeType `json:"disabledRules" required:"true"`
|
||||
// REQUIRED
|
||||
EnabledRules DistributionWafGetEnabledRulesAttributeType `json:"enabledRules" required:"true"`
|
||||
// REQUIRED
|
||||
LogOnlyRules DistributionWafGetLogOnlyRulesAttributeType `json:"logOnlyRules" required:"true"`
|
||||
}
|
||||
|
||||
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 DistributionWafGetDisabledRulesArgType, enabledRules DistributionWafGetEnabledRulesArgType, logOnlyRules DistributionWafGetLogOnlyRulesArgType) *DistributionWaf {
|
||||
this := DistributionWaf{}
|
||||
setDistributionWafGetDisabledRulesAttributeType(&this.DisabledRules, disabledRules)
|
||||
setDistributionWafGetEnabledRulesAttributeType(&this.EnabledRules, enabledRules)
|
||||
setDistributionWafGetLogOnlyRulesAttributeType(&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() (ret DistributionWafGetDisabledRulesRetType) {
|
||||
ret, _ = o.GetDisabledRulesOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDisabledRulesOk returns a tuple with the DisabledRules field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionWaf) GetDisabledRulesOk() (ret DistributionWafGetDisabledRulesRetType, ok bool) {
|
||||
return getDistributionWafGetDisabledRulesAttributeTypeOk(o.DisabledRules)
|
||||
}
|
||||
|
||||
// SetDisabledRules sets field value
|
||||
func (o *DistributionWaf) SetDisabledRules(v DistributionWafGetDisabledRulesRetType) {
|
||||
setDistributionWafGetDisabledRulesAttributeType(&o.DisabledRules, v)
|
||||
}
|
||||
|
||||
// GetEnabledRules returns the EnabledRules field value
|
||||
func (o *DistributionWaf) GetEnabledRules() (ret DistributionWafGetEnabledRulesRetType) {
|
||||
ret, _ = o.GetEnabledRulesOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetEnabledRulesOk returns a tuple with the EnabledRules field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionWaf) GetEnabledRulesOk() (ret DistributionWafGetEnabledRulesRetType, ok bool) {
|
||||
return getDistributionWafGetEnabledRulesAttributeTypeOk(o.EnabledRules)
|
||||
}
|
||||
|
||||
// SetEnabledRules sets field value
|
||||
func (o *DistributionWaf) SetEnabledRules(v DistributionWafGetEnabledRulesRetType) {
|
||||
setDistributionWafGetEnabledRulesAttributeType(&o.EnabledRules, v)
|
||||
}
|
||||
|
||||
// GetLogOnlyRules returns the LogOnlyRules field value
|
||||
func (o *DistributionWaf) GetLogOnlyRules() (ret DistributionWafGetLogOnlyRulesRetType) {
|
||||
ret, _ = o.GetLogOnlyRulesOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetLogOnlyRulesOk returns a tuple with the LogOnlyRules field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DistributionWaf) GetLogOnlyRulesOk() (ret DistributionWafGetLogOnlyRulesRetType, ok bool) {
|
||||
return getDistributionWafGetLogOnlyRulesAttributeTypeOk(o.LogOnlyRules)
|
||||
}
|
||||
|
||||
// SetLogOnlyRules sets field value
|
||||
func (o *DistributionWaf) SetLogOnlyRules(v DistributionWafGetLogOnlyRulesRetType) {
|
||||
setDistributionWafGetLogOnlyRulesAttributeType(&o.LogOnlyRules, v)
|
||||
}
|
||||
|
||||
func (o DistributionWaf) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDistributionWafGetDisabledRulesAttributeTypeOk(o.DisabledRules); ok {
|
||||
toSerialize["DisabledRules"] = val
|
||||
}
|
||||
if val, ok := getDistributionWafGetEnabledRulesAttributeTypeOk(o.EnabledRules); ok {
|
||||
toSerialize["EnabledRules"] = val
|
||||
}
|
||||
if val, ok := getDistributionWafGetLogOnlyRulesAttributeTypeOk(o.LogOnlyRules); ok {
|
||||
toSerialize["LogOnlyRules"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_distribution_waf_test.go
Normal file
11
pkg/cdnbeta/model_distribution_waf_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
367
pkg/cdnbeta/model_domain.go
Normal file
367
pkg/cdnbeta/model_domain.go
Normal file
|
|
@ -0,0 +1,367 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the Domain type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Domain{}
|
||||
|
||||
/*
|
||||
types and functions for errors
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type DomainGetErrorsAttributeType = *[]StatusError
|
||||
type DomainGetErrorsArgType = []StatusError
|
||||
type DomainGetErrorsRetType = []StatusError
|
||||
|
||||
func getDomainGetErrorsAttributeTypeOk(arg DomainGetErrorsAttributeType) (ret DomainGetErrorsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDomainGetErrorsAttributeType(arg *DomainGetErrorsAttributeType, val DomainGetErrorsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for name
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type DomainGetNameAttributeType = *string
|
||||
|
||||
func getDomainGetNameAttributeTypeOk(arg DomainGetNameAttributeType) (ret DomainGetNameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDomainGetNameAttributeType(arg *DomainGetNameAttributeType, val DomainGetNameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type DomainGetNameArgType = string
|
||||
type DomainGetNameRetType = string
|
||||
|
||||
/*
|
||||
types and functions for status
|
||||
*/
|
||||
|
||||
// isEnumRef
|
||||
type DomainGetStatusAttributeType = *DomainStatus
|
||||
type DomainGetStatusArgType = DomainStatus
|
||||
type DomainGetStatusRetType = DomainStatus
|
||||
|
||||
func getDomainGetStatusAttributeTypeOk(arg DomainGetStatusAttributeType) (ret DomainGetStatusRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDomainGetStatusAttributeType(arg *DomainGetStatusAttributeType, val DomainGetStatusRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isEnum
|
||||
|
||||
// DomainTypes Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint
|
||||
// value type for enums
|
||||
type DomainTypes string
|
||||
|
||||
// List of Type
|
||||
const (
|
||||
DOMAINTYPE_MANAGED DomainTypes = "managed"
|
||||
DOMAINTYPE_CUSTOM DomainTypes = "custom"
|
||||
)
|
||||
|
||||
// All allowed values of Domain enum
|
||||
var AllowedDomainTypesEnumValues = []DomainTypes{
|
||||
"managed",
|
||||
"custom",
|
||||
}
|
||||
|
||||
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
|
||||
type TmpJson DomainTypes
|
||||
var value TmpJson
|
||||
err := json.Unmarshal(src, &value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Allow unmarshalling zero value for testing purposes
|
||||
var zeroValue TmpJson
|
||||
if value == zeroValue {
|
||||
return nil
|
||||
}
|
||||
enumTypeValue := DomainTypes(value)
|
||||
for _, existing := range AllowedDomainTypesEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid Domain", value)
|
||||
}
|
||||
|
||||
// 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
|
||||
func NewDomainTypesFromValue(v DomainTypes) (*DomainTypes, error) {
|
||||
ev := DomainTypes(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for DomainTypes: valid values are %v", v, AllowedDomainTypesEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v DomainTypes) IsValid() bool {
|
||||
for _, existing := range AllowedDomainTypesEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to TypeTypes value
|
||||
func (v DomainTypes) Ptr() *DomainTypes {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableDomainTypes struct {
|
||||
value *DomainTypes
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDomainTypes) Get() *DomainTypes {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDomainTypes) Set(val *DomainTypes) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDomainTypes) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDomainTypes) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDomainTypes(val *DomainTypes) *NullableDomainTypes {
|
||||
return &NullableDomainTypes{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDomainTypes) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDomainTypes) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
type DomainGetTypeAttributeType = *DomainTypes
|
||||
type DomainGetTypeArgType = DomainTypes
|
||||
type DomainGetTypeRetType = DomainTypes
|
||||
|
||||
func getDomainGetTypeAttributeTypeOk(arg DomainGetTypeAttributeType) (ret DomainGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setDomainGetTypeAttributeType(arg *DomainGetTypeAttributeType, val DomainGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// 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 DomainGetErrorsAttributeType `json:"errors,omitempty"`
|
||||
// The domain. If this is a custom domain, you can call the GetCustomDomain Endpoint
|
||||
// REQUIRED
|
||||
Name DomainGetNameAttributeType `json:"name" required:"true"`
|
||||
// REQUIRED
|
||||
Status DomainGetStatusAttributeType `json:"status" required:"true"`
|
||||
// Specifies the type of this Domain. Custom Domain can be further queries using the GetCustomDomain Endpoint
|
||||
// REQUIRED
|
||||
Type DomainGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 DomainGetNameArgType, status DomainGetStatusArgType, types DomainGetTypeArgType) *Domain {
|
||||
this := Domain{}
|
||||
setDomainGetNameAttributeType(&this.Name, name)
|
||||
setDomainGetStatusAttributeType(&this.Status, status)
|
||||
setDomainGetTypeAttributeType(&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() (res DomainGetErrorsRetType) {
|
||||
res, _ = o.GetErrorsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret DomainGetErrorsRetType, ok bool) {
|
||||
return getDomainGetErrorsAttributeTypeOk(o.Errors)
|
||||
}
|
||||
|
||||
// HasErrors returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *Domain) SetErrors(v DomainGetErrorsRetType) {
|
||||
setDomainGetErrorsAttributeType(&o.Errors, v)
|
||||
}
|
||||
|
||||
// GetName returns the Name field value
|
||||
func (o *Domain) GetName() (ret DomainGetNameRetType) {
|
||||
ret, _ = o.GetNameOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetNameOk returns a tuple with the Name field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Domain) GetNameOk() (ret DomainGetNameRetType, ok bool) {
|
||||
return getDomainGetNameAttributeTypeOk(o.Name)
|
||||
}
|
||||
|
||||
// SetName sets field value
|
||||
func (o *Domain) SetName(v DomainGetNameRetType) {
|
||||
setDomainGetNameAttributeType(&o.Name, v)
|
||||
}
|
||||
|
||||
// GetStatus returns the Status field value
|
||||
func (o *Domain) GetStatus() (ret DomainGetStatusRetType) {
|
||||
ret, _ = o.GetStatusOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetStatusOk returns a tuple with the Status field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Domain) GetStatusOk() (ret DomainGetStatusRetType, ok bool) {
|
||||
return getDomainGetStatusAttributeTypeOk(o.Status)
|
||||
}
|
||||
|
||||
// SetStatus sets field value
|
||||
func (o *Domain) SetStatus(v DomainGetStatusRetType) {
|
||||
setDomainGetStatusAttributeType(&o.Status, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *Domain) GetType() (ret DomainGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Domain) GetTypeOk() (ret DomainGetTypeRetType, ok bool) {
|
||||
return getDomainGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *Domain) SetType(v DomainGetTypeRetType) {
|
||||
setDomainGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o Domain) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getDomainGetErrorsAttributeTypeOk(o.Errors); ok {
|
||||
toSerialize["Errors"] = val
|
||||
}
|
||||
if val, ok := getDomainGetNameAttributeTypeOk(o.Name); ok {
|
||||
toSerialize["Name"] = val
|
||||
}
|
||||
if val, ok := getDomainGetStatusAttributeTypeOk(o.Status); ok {
|
||||
toSerialize["Status"] = val
|
||||
}
|
||||
if val, ok := getDomainGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
121
pkg/cdnbeta/model_domain_status.go
Normal file
121
pkg/cdnbeta/model_domain_status.go
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
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
|
||||
}
|
||||
// Allow unmarshalling zero value for testing purposes
|
||||
var zeroValue string
|
||||
if value == zeroValue {
|
||||
return nil
|
||||
}
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_domain_status_test.go
Normal file
11
pkg/cdnbeta/model_domain_status_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
58
pkg/cdnbeta/model_domain_test.go
Normal file
58
pkg/cdnbeta/model_domain_test.go
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isEnum
|
||||
|
||||
func TestDomainTypes_UnmarshalJSON(t *testing.T) {
|
||||
type args struct {
|
||||
src []byte
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: `success - possible enum value no. 1`,
|
||||
args: args{
|
||||
src: []byte(`"managed"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 2`,
|
||||
args: args{
|
||||
src: []byte(`"custom"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "fail",
|
||||
args: args{
|
||||
src: []byte("\"FOOBAR\""),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := DomainTypes("")
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
375
pkg/cdnbeta/model_error_details.go
Normal file
375
pkg/cdnbeta/model_error_details.go
Normal file
|
|
@ -0,0 +1,375 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// 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 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
|
||||
*/
|
||||
|
||||
// isEnum
|
||||
|
||||
// ErrorDetailsKey the model 'ErrorDetails'
|
||||
// value type for enums
|
||||
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"
|
||||
)
|
||||
|
||||
// All allowed values of ErrorDetails enum
|
||||
var AllowedErrorDetailsKeyEnumValues = []ErrorDetailsKey{
|
||||
"UNKNOWN",
|
||||
"CUSTOM_DOMAIN_CNAME_MISSING",
|
||||
"INVALID_ARGUMENT",
|
||||
}
|
||||
|
||||
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
|
||||
type TmpJson ErrorDetailsKey
|
||||
var value TmpJson
|
||||
err := json.Unmarshal(src, &value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Allow unmarshalling zero value for testing purposes
|
||||
var zeroValue TmpJson
|
||||
if value == zeroValue {
|
||||
return nil
|
||||
}
|
||||
enumTypeValue := ErrorDetailsKey(value)
|
||||
for _, existing := range AllowedErrorDetailsKeyEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid ErrorDetails", value)
|
||||
}
|
||||
|
||||
// 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
|
||||
func NewErrorDetailsKeyFromValue(v ErrorDetailsKey) (*ErrorDetailsKey, error) {
|
||||
ev := ErrorDetailsKey(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for ErrorDetailsKey: valid values are %v", v, AllowedErrorDetailsKeyEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v ErrorDetailsKey) IsValid() bool {
|
||||
for _, existing := range AllowedErrorDetailsKeyEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to KeyKey value
|
||||
func (v ErrorDetailsKey) Ptr() *ErrorDetailsKey {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableErrorDetailsKey struct {
|
||||
value *ErrorDetailsKey
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableErrorDetailsKey) Get() *ErrorDetailsKey {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableErrorDetailsKey) Set(val *ErrorDetailsKey) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableErrorDetailsKey) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableErrorDetailsKey) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableErrorDetailsKey(val *ErrorDetailsKey) *NullableErrorDetailsKey {
|
||||
return &NullableErrorDetailsKey{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableErrorDetailsKey) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableErrorDetailsKey) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
type ErrorDetailsGetKeyAttributeType = *ErrorDetailsKey
|
||||
type ErrorDetailsGetKeyArgType = ErrorDetailsKey
|
||||
type ErrorDetailsGetKeyRetType = ErrorDetailsKey
|
||||
|
||||
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"`
|
||||
// English description of the error
|
||||
// REQUIRED
|
||||
En ErrorDetailsGetEnAttributeType `json:"en" required:"true"`
|
||||
// Optional field in the request this error detail refers to
|
||||
Field ErrorDetailsGetFieldAttributeType `json:"field,omitempty"`
|
||||
// REQUIRED
|
||||
Key ErrorDetailsGetKeyAttributeType `json:"key" required:"true"`
|
||||
}
|
||||
|
||||
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 ErrorDetailsGetEnArgType, key ErrorDetailsGetKeyArgType) *ErrorDetails {
|
||||
this := ErrorDetails{}
|
||||
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)
|
||||
}
|
||||
|
||||
// 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 := 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)
|
||||
}
|
||||
65
pkg/cdnbeta/model_error_details_test.go
Normal file
65
pkg/cdnbeta/model_error_details_test.go
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isEnum
|
||||
|
||||
func TestErrorDetailsKey_UnmarshalJSON(t *testing.T) {
|
||||
type args struct {
|
||||
src []byte
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: `success - possible enum value no. 1`,
|
||||
args: args{
|
||||
src: []byte(`"UNKNOWN"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 2`,
|
||||
args: args{
|
||||
src: []byte(`"CUSTOM_DOMAIN_CNAME_MISSING"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 3`,
|
||||
args: args{
|
||||
src: []byte(`"INVALID_ARGUMENT"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "fail",
|
||||
args: args{
|
||||
src: []byte("\"FOOBAR\""),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := ErrorDetailsKey("")
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
125
pkg/cdnbeta/model_find_cache_paths_response.go
Normal file
125
pkg/cdnbeta/model_find_cache_paths_response.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the FindCachePathsResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &FindCachePathsResponse{}
|
||||
|
||||
/*
|
||||
types and functions for response
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type FindCachePathsResponseGetResponseAttributeType = *[]FindCachePathsResponseEntry
|
||||
type FindCachePathsResponseGetResponseArgType = []FindCachePathsResponseEntry
|
||||
type FindCachePathsResponseGetResponseRetType = []FindCachePathsResponseEntry
|
||||
|
||||
func getFindCachePathsResponseGetResponseAttributeTypeOk(arg FindCachePathsResponseGetResponseAttributeType) (ret FindCachePathsResponseGetResponseRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setFindCachePathsResponseGetResponseAttributeType(arg *FindCachePathsResponseGetResponseAttributeType, val FindCachePathsResponseGetResponseRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// FindCachePathsResponse struct for FindCachePathsResponse
|
||||
type FindCachePathsResponse struct {
|
||||
// REQUIRED
|
||||
Response FindCachePathsResponseGetResponseAttributeType `json:"response" required:"true"`
|
||||
}
|
||||
|
||||
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 FindCachePathsResponseGetResponseArgType) *FindCachePathsResponse {
|
||||
this := FindCachePathsResponse{}
|
||||
setFindCachePathsResponseGetResponseAttributeType(&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() (ret FindCachePathsResponseGetResponseRetType) {
|
||||
ret, _ = o.GetResponseOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetResponseOk returns a tuple with the Response field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *FindCachePathsResponse) GetResponseOk() (ret FindCachePathsResponseGetResponseRetType, ok bool) {
|
||||
return getFindCachePathsResponseGetResponseAttributeTypeOk(o.Response)
|
||||
}
|
||||
|
||||
// SetResponse sets field value
|
||||
func (o *FindCachePathsResponse) SetResponse(v FindCachePathsResponseGetResponseRetType) {
|
||||
setFindCachePathsResponseGetResponseAttributeType(&o.Response, v)
|
||||
}
|
||||
|
||||
func (o FindCachePathsResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getFindCachePathsResponseGetResponseAttributeTypeOk(o.Response); ok {
|
||||
toSerialize["Response"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
127
pkg/cdnbeta/model_find_cache_paths_response_entry.go
Normal file
127
pkg/cdnbeta/model_find_cache_paths_response_entry.go
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the FindCachePathsResponseEntry type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &FindCachePathsResponseEntry{}
|
||||
|
||||
/*
|
||||
types and functions for path
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type FindCachePathsResponseEntryGetPathAttributeType = *string
|
||||
|
||||
func getFindCachePathsResponseEntryGetPathAttributeTypeOk(arg FindCachePathsResponseEntryGetPathAttributeType) (ret FindCachePathsResponseEntryGetPathRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setFindCachePathsResponseEntryGetPathAttributeType(arg *FindCachePathsResponseEntryGetPathAttributeType, val FindCachePathsResponseEntryGetPathRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type FindCachePathsResponseEntryGetPathArgType = string
|
||||
type FindCachePathsResponseEntryGetPathRetType = string
|
||||
|
||||
// FindCachePathsResponseEntry struct for FindCachePathsResponseEntry
|
||||
type FindCachePathsResponseEntry struct {
|
||||
// Defines one path that was previously used as part of a granular purge
|
||||
// REQUIRED
|
||||
Path FindCachePathsResponseEntryGetPathAttributeType `json:"path" required:"true"`
|
||||
}
|
||||
|
||||
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 FindCachePathsResponseEntryGetPathArgType) *FindCachePathsResponseEntry {
|
||||
this := FindCachePathsResponseEntry{}
|
||||
setFindCachePathsResponseEntryGetPathAttributeType(&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() (ret FindCachePathsResponseEntryGetPathRetType) {
|
||||
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 *FindCachePathsResponseEntry) GetPathOk() (ret FindCachePathsResponseEntryGetPathRetType, ok bool) {
|
||||
return getFindCachePathsResponseEntryGetPathAttributeTypeOk(o.Path)
|
||||
}
|
||||
|
||||
// SetPath sets field value
|
||||
func (o *FindCachePathsResponseEntry) SetPath(v FindCachePathsResponseEntryGetPathRetType) {
|
||||
setFindCachePathsResponseEntryGetPathAttributeType(&o.Path, v)
|
||||
}
|
||||
|
||||
func (o FindCachePathsResponseEntry) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getFindCachePathsResponseEntryGetPathAttributeTypeOk(o.Path); ok {
|
||||
toSerialize["Path"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_find_cache_paths_response_entry_test.go
Normal file
11
pkg/cdnbeta/model_find_cache_paths_response_entry_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
11
pkg/cdnbeta/model_find_cache_paths_response_test.go
Normal file
11
pkg/cdnbeta/model_find_cache_paths_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
174
pkg/cdnbeta/model_generic_json_response.go
Normal file
174
pkg/cdnbeta/model_generic_json_response.go
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GenericJsonResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GenericJsonResponse{}
|
||||
|
||||
/*
|
||||
types and functions for details
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type GenericJsonResponseGetDetailsAttributeType = *[]ErrorDetails
|
||||
type GenericJsonResponseGetDetailsArgType = []ErrorDetails
|
||||
type GenericJsonResponseGetDetailsRetType = []ErrorDetails
|
||||
|
||||
func getGenericJsonResponseGetDetailsAttributeTypeOk(arg GenericJsonResponseGetDetailsAttributeType) (ret GenericJsonResponseGetDetailsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGenericJsonResponseGetDetailsAttributeType(arg *GenericJsonResponseGetDetailsAttributeType, val GenericJsonResponseGetDetailsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for message
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GenericJsonResponseGetMessageAttributeType = *string
|
||||
|
||||
func getGenericJsonResponseGetMessageAttributeTypeOk(arg GenericJsonResponseGetMessageAttributeType) (ret GenericJsonResponseGetMessageRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGenericJsonResponseGetMessageAttributeType(arg *GenericJsonResponseGetMessageAttributeType, val GenericJsonResponseGetMessageRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GenericJsonResponseGetMessageArgType = string
|
||||
type GenericJsonResponseGetMessageRetType = string
|
||||
|
||||
// GenericJsonResponse struct for GenericJsonResponse
|
||||
type GenericJsonResponse struct {
|
||||
// Listing of issues with your request
|
||||
Details GenericJsonResponseGetDetailsAttributeType `json:"details,omitempty"`
|
||||
// REQUIRED
|
||||
Message GenericJsonResponseGetMessageAttributeType `json:"message" required:"true"`
|
||||
}
|
||||
|
||||
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 GenericJsonResponseGetMessageArgType) *GenericJsonResponse {
|
||||
this := GenericJsonResponse{}
|
||||
setGenericJsonResponseGetMessageAttributeType(&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() (res GenericJsonResponseGetDetailsRetType) {
|
||||
res, _ = o.GetDetailsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret GenericJsonResponseGetDetailsRetType, ok bool) {
|
||||
return getGenericJsonResponseGetDetailsAttributeTypeOk(o.Details)
|
||||
}
|
||||
|
||||
// HasDetails returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *GenericJsonResponse) SetDetails(v GenericJsonResponseGetDetailsRetType) {
|
||||
setGenericJsonResponseGetDetailsAttributeType(&o.Details, v)
|
||||
}
|
||||
|
||||
// GetMessage returns the Message field value
|
||||
func (o *GenericJsonResponse) GetMessage() (ret GenericJsonResponseGetMessageRetType) {
|
||||
ret, _ = o.GetMessageOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetMessageOk returns a tuple with the Message field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GenericJsonResponse) GetMessageOk() (ret GenericJsonResponseGetMessageRetType, ok bool) {
|
||||
return getGenericJsonResponseGetMessageAttributeTypeOk(o.Message)
|
||||
}
|
||||
|
||||
// SetMessage sets field value
|
||||
func (o *GenericJsonResponse) SetMessage(v GenericJsonResponseGetMessageRetType) {
|
||||
setGenericJsonResponseGetMessageAttributeType(&o.Message, v)
|
||||
}
|
||||
|
||||
func (o GenericJsonResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGenericJsonResponseGetDetailsAttributeTypeOk(o.Details); ok {
|
||||
toSerialize["Details"] = val
|
||||
}
|
||||
if val, ok := getGenericJsonResponseGetMessageAttributeTypeOk(o.Message); ok {
|
||||
toSerialize["Message"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_generic_json_response_test.go
Normal file
11
pkg/cdnbeta/model_generic_json_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
172
pkg/cdnbeta/model_get_cache_info_response.go
Normal file
172
pkg/cdnbeta/model_get_cache_info_response.go
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the GetCacheInfoResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetCacheInfoResponse{}
|
||||
|
||||
/*
|
||||
types and functions for history
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type GetCacheInfoResponseGetHistoryAttributeType = *[]GetCacheInfoResponseHistoryEntry
|
||||
type GetCacheInfoResponseGetHistoryArgType = []GetCacheInfoResponseHistoryEntry
|
||||
type GetCacheInfoResponseGetHistoryRetType = []GetCacheInfoResponseHistoryEntry
|
||||
|
||||
func getGetCacheInfoResponseGetHistoryAttributeTypeOk(arg GetCacheInfoResponseGetHistoryAttributeType) (ret GetCacheInfoResponseGetHistoryRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCacheInfoResponseGetHistoryAttributeType(arg *GetCacheInfoResponseGetHistoryAttributeType, val GetCacheInfoResponseGetHistoryRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for lastPurgeTime
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type GetCacheInfoResponseGetLastPurgeTimeAttributeType = *time.Time
|
||||
type GetCacheInfoResponseGetLastPurgeTimeArgType = *time.Time
|
||||
type GetCacheInfoResponseGetLastPurgeTimeRetType = *time.Time
|
||||
|
||||
func getGetCacheInfoResponseGetLastPurgeTimeAttributeTypeOk(arg GetCacheInfoResponseGetLastPurgeTimeAttributeType) (ret GetCacheInfoResponseGetLastPurgeTimeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return nil, false
|
||||
}
|
||||
return arg, true
|
||||
}
|
||||
|
||||
func setGetCacheInfoResponseGetLastPurgeTimeAttributeType(arg *GetCacheInfoResponseGetLastPurgeTimeAttributeType, val GetCacheInfoResponseGetLastPurgeTimeRetType) {
|
||||
*arg = val
|
||||
}
|
||||
|
||||
// GetCacheInfoResponse struct for GetCacheInfoResponse
|
||||
type GetCacheInfoResponse struct {
|
||||
// REQUIRED
|
||||
History GetCacheInfoResponseGetHistoryAttributeType `json:"history" required:"true"`
|
||||
// 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`
|
||||
// REQUIRED
|
||||
LastPurgeTime GetCacheInfoResponseGetLastPurgeTimeAttributeType `json:"lastPurgeTime" required:"true"`
|
||||
}
|
||||
|
||||
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 GetCacheInfoResponseGetHistoryArgType, lastPurgeTime GetCacheInfoResponseGetLastPurgeTimeArgType) *GetCacheInfoResponse {
|
||||
this := GetCacheInfoResponse{}
|
||||
setGetCacheInfoResponseGetHistoryAttributeType(&this.History, history)
|
||||
setGetCacheInfoResponseGetLastPurgeTimeAttributeType(&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() (ret GetCacheInfoResponseGetHistoryRetType) {
|
||||
ret, _ = o.GetHistoryOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetHistoryOk returns a tuple with the History field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCacheInfoResponse) GetHistoryOk() (ret GetCacheInfoResponseGetHistoryRetType, ok bool) {
|
||||
return getGetCacheInfoResponseGetHistoryAttributeTypeOk(o.History)
|
||||
}
|
||||
|
||||
// SetHistory sets field value
|
||||
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
|
||||
func (o *GetCacheInfoResponse) GetLastPurgeTime() (ret GetCacheInfoResponseGetLastPurgeTimeRetType) {
|
||||
ret, _ = o.GetLastPurgeTimeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// 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() (ret GetCacheInfoResponseGetLastPurgeTimeRetType, ok bool) {
|
||||
return getGetCacheInfoResponseGetLastPurgeTimeAttributeTypeOk(o.LastPurgeTime)
|
||||
}
|
||||
|
||||
// SetLastPurgeTime sets field value
|
||||
func (o *GetCacheInfoResponse) SetLastPurgeTime(v GetCacheInfoResponseGetLastPurgeTimeRetType) {
|
||||
setGetCacheInfoResponseGetLastPurgeTimeAttributeType(&o.LastPurgeTime, v)
|
||||
}
|
||||
|
||||
func (o GetCacheInfoResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetCacheInfoResponseGetHistoryAttributeTypeOk(o.History); ok {
|
||||
toSerialize["History"] = val
|
||||
}
|
||||
if val, ok := getGetCacheInfoResponseGetLastPurgeTimeAttributeTypeOk(o.LastPurgeTime); ok {
|
||||
toSerialize["LastPurgeTime"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
274
pkg/cdnbeta/model_get_cache_info_response_history_entry.go
Normal file
274
pkg/cdnbeta/model_get_cache_info_response_history_entry.go
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the GetCacheInfoResponseHistoryEntry type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetCacheInfoResponseHistoryEntry{}
|
||||
|
||||
/*
|
||||
types and functions for occurredAt
|
||||
*/
|
||||
|
||||
// isDateTime
|
||||
type GetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType = *time.Time
|
||||
type GetCacheInfoResponseHistoryEntryGetOccurredAtArgType = time.Time
|
||||
type GetCacheInfoResponseHistoryEntryGetOccurredAtRetType = time.Time
|
||||
|
||||
func getGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeTypeOk(arg GetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType) (ret GetCacheInfoResponseHistoryEntryGetOccurredAtRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType(arg *GetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType, val GetCacheInfoResponseHistoryEntryGetOccurredAtRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isEnum
|
||||
|
||||
// GetCacheInfoResponseHistoryEntryTypes the model 'GetCacheInfoResponseHistoryEntry'
|
||||
// value type for enums
|
||||
type GetCacheInfoResponseHistoryEntryTypes string
|
||||
|
||||
// List of Type
|
||||
const (
|
||||
GETCACHEINFORESPONSEHISTORYENTRYTYPE_FULL GetCacheInfoResponseHistoryEntryTypes = "full"
|
||||
GETCACHEINFORESPONSEHISTORYENTRYTYPE_GRANULAR GetCacheInfoResponseHistoryEntryTypes = "granular"
|
||||
)
|
||||
|
||||
// All allowed values of GetCacheInfoResponseHistoryEntry enum
|
||||
var AllowedGetCacheInfoResponseHistoryEntryTypesEnumValues = []GetCacheInfoResponseHistoryEntryTypes{
|
||||
"full",
|
||||
"granular",
|
||||
}
|
||||
|
||||
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
|
||||
type TmpJson GetCacheInfoResponseHistoryEntryTypes
|
||||
var value TmpJson
|
||||
err := json.Unmarshal(src, &value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Allow unmarshalling zero value for testing purposes
|
||||
var zeroValue TmpJson
|
||||
if value == zeroValue {
|
||||
return nil
|
||||
}
|
||||
enumTypeValue := GetCacheInfoResponseHistoryEntryTypes(value)
|
||||
for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypesEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid GetCacheInfoResponseHistoryEntry", value)
|
||||
}
|
||||
|
||||
// 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
|
||||
func NewGetCacheInfoResponseHistoryEntryTypesFromValue(v GetCacheInfoResponseHistoryEntryTypes) (*GetCacheInfoResponseHistoryEntryTypes, error) {
|
||||
ev := GetCacheInfoResponseHistoryEntryTypes(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for GetCacheInfoResponseHistoryEntryTypes: valid values are %v", v, AllowedGetCacheInfoResponseHistoryEntryTypesEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v GetCacheInfoResponseHistoryEntryTypes) IsValid() bool {
|
||||
for _, existing := range AllowedGetCacheInfoResponseHistoryEntryTypesEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to TypeTypes value
|
||||
func (v GetCacheInfoResponseHistoryEntryTypes) Ptr() *GetCacheInfoResponseHistoryEntryTypes {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableGetCacheInfoResponseHistoryEntryTypes struct {
|
||||
value *GetCacheInfoResponseHistoryEntryTypes
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableGetCacheInfoResponseHistoryEntryTypes) Get() *GetCacheInfoResponseHistoryEntryTypes {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableGetCacheInfoResponseHistoryEntryTypes) Set(val *GetCacheInfoResponseHistoryEntryTypes) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableGetCacheInfoResponseHistoryEntryTypes) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableGetCacheInfoResponseHistoryEntryTypes) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableGetCacheInfoResponseHistoryEntryTypes(val *GetCacheInfoResponseHistoryEntryTypes) *NullableGetCacheInfoResponseHistoryEntryTypes {
|
||||
return &NullableGetCacheInfoResponseHistoryEntryTypes{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableGetCacheInfoResponseHistoryEntryTypes) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableGetCacheInfoResponseHistoryEntryTypes) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
type GetCacheInfoResponseHistoryEntryGetTypeAttributeType = *GetCacheInfoResponseHistoryEntryTypes
|
||||
type GetCacheInfoResponseHistoryEntryGetTypeArgType = GetCacheInfoResponseHistoryEntryTypes
|
||||
type GetCacheInfoResponseHistoryEntryGetTypeRetType = GetCacheInfoResponseHistoryEntryTypes
|
||||
|
||||
func getGetCacheInfoResponseHistoryEntryGetTypeAttributeTypeOk(arg GetCacheInfoResponseHistoryEntryGetTypeAttributeType) (ret GetCacheInfoResponseHistoryEntryGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCacheInfoResponseHistoryEntryGetTypeAttributeType(arg *GetCacheInfoResponseHistoryEntryGetTypeAttributeType, val GetCacheInfoResponseHistoryEntryGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// GetCacheInfoResponseHistoryEntry struct for GetCacheInfoResponseHistoryEntry
|
||||
type GetCacheInfoResponseHistoryEntry struct {
|
||||
// REQUIRED
|
||||
OccurredAt GetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType `json:"occurredAt" required:"true"`
|
||||
// REQUIRED
|
||||
Type GetCacheInfoResponseHistoryEntryGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 GetCacheInfoResponseHistoryEntryGetOccurredAtArgType, types GetCacheInfoResponseHistoryEntryGetTypeArgType) *GetCacheInfoResponseHistoryEntry {
|
||||
this := GetCacheInfoResponseHistoryEntry{}
|
||||
setGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType(&this.OccurredAt, occurredAt)
|
||||
setGetCacheInfoResponseHistoryEntryGetTypeAttributeType(&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() (ret GetCacheInfoResponseHistoryEntryGetOccurredAtRetType) {
|
||||
ret, _ = o.GetOccurredAtOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetOccurredAtOk returns a tuple with the OccurredAt field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCacheInfoResponseHistoryEntry) GetOccurredAtOk() (ret GetCacheInfoResponseHistoryEntryGetOccurredAtRetType, ok bool) {
|
||||
return getGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeTypeOk(o.OccurredAt)
|
||||
}
|
||||
|
||||
// SetOccurredAt sets field value
|
||||
func (o *GetCacheInfoResponseHistoryEntry) SetOccurredAt(v GetCacheInfoResponseHistoryEntryGetOccurredAtRetType) {
|
||||
setGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeType(&o.OccurredAt, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *GetCacheInfoResponseHistoryEntry) GetType() (ret GetCacheInfoResponseHistoryEntryGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCacheInfoResponseHistoryEntry) GetTypeOk() (ret GetCacheInfoResponseHistoryEntryGetTypeRetType, ok bool) {
|
||||
return getGetCacheInfoResponseHistoryEntryGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *GetCacheInfoResponseHistoryEntry) SetType(v GetCacheInfoResponseHistoryEntryGetTypeRetType) {
|
||||
setGetCacheInfoResponseHistoryEntryGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o GetCacheInfoResponseHistoryEntry) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetCacheInfoResponseHistoryEntryGetOccurredAtAttributeTypeOk(o.OccurredAt); ok {
|
||||
toSerialize["OccurredAt"] = val
|
||||
}
|
||||
if val, ok := getGetCacheInfoResponseHistoryEntryGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// isEnum
|
||||
|
||||
func TestGetCacheInfoResponseHistoryEntryTypes_UnmarshalJSON(t *testing.T) {
|
||||
type args struct {
|
||||
src []byte
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: `success - possible enum value no. 1`,
|
||||
args: args{
|
||||
src: []byte(`"full"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: `success - possible enum value no. 2`,
|
||||
args: args{
|
||||
src: []byte(`"granular"`),
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "fail",
|
||||
args: args{
|
||||
src: []byte("\"FOOBAR\""),
|
||||
},
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
v := GetCacheInfoResponseHistoryEntryTypes("")
|
||||
if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr {
|
||||
t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
11
pkg/cdnbeta/model_get_cache_info_response_test.go
Normal file
11
pkg/cdnbeta/model_get_cache_info_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
171
pkg/cdnbeta/model_get_custom_domain_custom_certificate.go
Normal file
171
pkg/cdnbeta/model_get_custom_domain_custom_certificate.go
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GetCustomDomainCustomCertificate type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetCustomDomainCustomCertificate{}
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetCustomDomainCustomCertificateGetTypeAttributeType = *string
|
||||
|
||||
func getGetCustomDomainCustomCertificateGetTypeAttributeTypeOk(arg GetCustomDomainCustomCertificateGetTypeAttributeType) (ret GetCustomDomainCustomCertificateGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCustomDomainCustomCertificateGetTypeAttributeType(arg *GetCustomDomainCustomCertificateGetTypeAttributeType, val GetCustomDomainCustomCertificateGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetCustomDomainCustomCertificateGetTypeArgType = string
|
||||
type GetCustomDomainCustomCertificateGetTypeRetType = string
|
||||
|
||||
/*
|
||||
types and functions for version
|
||||
*/
|
||||
|
||||
// isInteger
|
||||
type GetCustomDomainCustomCertificateGetVersionAttributeType = *int64
|
||||
type GetCustomDomainCustomCertificateGetVersionArgType = int64
|
||||
type GetCustomDomainCustomCertificateGetVersionRetType = int64
|
||||
|
||||
func getGetCustomDomainCustomCertificateGetVersionAttributeTypeOk(arg GetCustomDomainCustomCertificateGetVersionAttributeType) (ret GetCustomDomainCustomCertificateGetVersionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCustomDomainCustomCertificateGetVersionAttributeType(arg *GetCustomDomainCustomCertificateGetVersionAttributeType, val GetCustomDomainCustomCertificateGetVersionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// GetCustomDomainCustomCertificate Returned if a custom certificate is used. Response does not contain the certificate or key.
|
||||
type GetCustomDomainCustomCertificate struct {
|
||||
// REQUIRED
|
||||
Type GetCustomDomainCustomCertificateGetTypeAttributeType `json:"type" required:"true"`
|
||||
// Whenever a new custom certificate is added the version is increased by 1.
|
||||
// Can be cast to int32 without loss of precision.
|
||||
// REQUIRED
|
||||
Version GetCustomDomainCustomCertificateGetVersionAttributeType `json:"version" required:"true"`
|
||||
}
|
||||
|
||||
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 GetCustomDomainCustomCertificateGetTypeArgType, version GetCustomDomainCustomCertificateGetVersionArgType) *GetCustomDomainCustomCertificate {
|
||||
this := GetCustomDomainCustomCertificate{}
|
||||
setGetCustomDomainCustomCertificateGetTypeAttributeType(&this.Type, types)
|
||||
setGetCustomDomainCustomCertificateGetVersionAttributeType(&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() (ret GetCustomDomainCustomCertificateGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCustomDomainCustomCertificate) GetTypeOk() (ret GetCustomDomainCustomCertificateGetTypeRetType, ok bool) {
|
||||
return getGetCustomDomainCustomCertificateGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *GetCustomDomainCustomCertificate) SetType(v GetCustomDomainCustomCertificateGetTypeRetType) {
|
||||
setGetCustomDomainCustomCertificateGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
// GetVersion returns the Version field value
|
||||
func (o *GetCustomDomainCustomCertificate) GetVersion() (ret GetCustomDomainCustomCertificateGetVersionRetType) {
|
||||
ret, _ = o.GetVersionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetVersionOk returns a tuple with the Version field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCustomDomainCustomCertificate) GetVersionOk() (ret GetCustomDomainCustomCertificateGetVersionRetType, ok bool) {
|
||||
return getGetCustomDomainCustomCertificateGetVersionAttributeTypeOk(o.Version)
|
||||
}
|
||||
|
||||
// SetVersion sets field value
|
||||
func (o *GetCustomDomainCustomCertificate) SetVersion(v GetCustomDomainCustomCertificateGetVersionRetType) {
|
||||
setGetCustomDomainCustomCertificateGetVersionAttributeType(&o.Version, v)
|
||||
}
|
||||
|
||||
func (o GetCustomDomainCustomCertificate) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetCustomDomainCustomCertificateGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
if val, ok := getGetCustomDomainCustomCertificateGetVersionAttributeTypeOk(o.Version); ok {
|
||||
toSerialize["Version"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
126
pkg/cdnbeta/model_get_custom_domain_managed_certificate.go
Normal file
126
pkg/cdnbeta/model_get_custom_domain_managed_certificate.go
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GetCustomDomainManagedCertificate type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetCustomDomainManagedCertificate{}
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type GetCustomDomainManagedCertificateGetTypeAttributeType = *string
|
||||
|
||||
func getGetCustomDomainManagedCertificateGetTypeAttributeTypeOk(arg GetCustomDomainManagedCertificateGetTypeAttributeType) (ret GetCustomDomainManagedCertificateGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCustomDomainManagedCertificateGetTypeAttributeType(arg *GetCustomDomainManagedCertificateGetTypeAttributeType, val GetCustomDomainManagedCertificateGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type GetCustomDomainManagedCertificateGetTypeArgType = string
|
||||
type GetCustomDomainManagedCertificateGetTypeRetType = string
|
||||
|
||||
// GetCustomDomainManagedCertificate This is returned when no custom certificate is used. We provision and manage a Let's Encrypt Certificate for you
|
||||
type GetCustomDomainManagedCertificate struct {
|
||||
// REQUIRED
|
||||
Type GetCustomDomainManagedCertificateGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 GetCustomDomainManagedCertificateGetTypeArgType) *GetCustomDomainManagedCertificate {
|
||||
this := GetCustomDomainManagedCertificate{}
|
||||
setGetCustomDomainManagedCertificateGetTypeAttributeType(&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() (ret GetCustomDomainManagedCertificateGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCustomDomainManagedCertificate) GetTypeOk() (ret GetCustomDomainManagedCertificateGetTypeRetType, ok bool) {
|
||||
return getGetCustomDomainManagedCertificateGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *GetCustomDomainManagedCertificate) SetType(v GetCustomDomainManagedCertificateGetTypeRetType) {
|
||||
setGetCustomDomainManagedCertificateGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o GetCustomDomainManagedCertificate) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetCustomDomainManagedCertificateGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
168
pkg/cdnbeta/model_get_custom_domain_response.go
Normal file
168
pkg/cdnbeta/model_get_custom_domain_response.go
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GetCustomDomainResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetCustomDomainResponse{}
|
||||
|
||||
/*
|
||||
types and functions for certificate
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type GetCustomDomainResponseGetCertificateAttributeType = *GetCustomDomainResponseCertificate
|
||||
type GetCustomDomainResponseGetCertificateArgType = GetCustomDomainResponseCertificate
|
||||
type GetCustomDomainResponseGetCertificateRetType = GetCustomDomainResponseCertificate
|
||||
|
||||
func getGetCustomDomainResponseGetCertificateAttributeTypeOk(arg GetCustomDomainResponseGetCertificateAttributeType) (ret GetCustomDomainResponseGetCertificateRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCustomDomainResponseGetCertificateAttributeType(arg *GetCustomDomainResponseGetCertificateAttributeType, val GetCustomDomainResponseGetCertificateRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for customDomain
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type GetCustomDomainResponseGetCustomDomainAttributeType = *CustomDomain
|
||||
type GetCustomDomainResponseGetCustomDomainArgType = CustomDomain
|
||||
type GetCustomDomainResponseGetCustomDomainRetType = CustomDomain
|
||||
|
||||
func getGetCustomDomainResponseGetCustomDomainAttributeTypeOk(arg GetCustomDomainResponseGetCustomDomainAttributeType) (ret GetCustomDomainResponseGetCustomDomainRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetCustomDomainResponseGetCustomDomainAttributeType(arg *GetCustomDomainResponseGetCustomDomainAttributeType, val GetCustomDomainResponseGetCustomDomainRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// GetCustomDomainResponse struct for GetCustomDomainResponse
|
||||
type GetCustomDomainResponse struct {
|
||||
// REQUIRED
|
||||
Certificate GetCustomDomainResponseGetCertificateAttributeType `json:"certificate" required:"true"`
|
||||
// REQUIRED
|
||||
CustomDomain GetCustomDomainResponseGetCustomDomainAttributeType `json:"customDomain" required:"true"`
|
||||
}
|
||||
|
||||
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 GetCustomDomainResponseGetCertificateArgType, customDomain GetCustomDomainResponseGetCustomDomainArgType) *GetCustomDomainResponse {
|
||||
this := GetCustomDomainResponse{}
|
||||
setGetCustomDomainResponseGetCertificateAttributeType(&this.Certificate, certificate)
|
||||
setGetCustomDomainResponseGetCustomDomainAttributeType(&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() (ret GetCustomDomainResponseGetCertificateRetType) {
|
||||
ret, _ = o.GetCertificateOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCertificateOk returns a tuple with the Certificate field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCustomDomainResponse) GetCertificateOk() (ret GetCustomDomainResponseGetCertificateRetType, ok bool) {
|
||||
return getGetCustomDomainResponseGetCertificateAttributeTypeOk(o.Certificate)
|
||||
}
|
||||
|
||||
// SetCertificate sets field value
|
||||
func (o *GetCustomDomainResponse) SetCertificate(v GetCustomDomainResponseGetCertificateRetType) {
|
||||
setGetCustomDomainResponseGetCertificateAttributeType(&o.Certificate, v)
|
||||
}
|
||||
|
||||
// GetCustomDomain returns the CustomDomain field value
|
||||
func (o *GetCustomDomainResponse) GetCustomDomain() (ret GetCustomDomainResponseGetCustomDomainRetType) {
|
||||
ret, _ = o.GetCustomDomainOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCustomDomainOk returns a tuple with the CustomDomain field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetCustomDomainResponse) GetCustomDomainOk() (ret GetCustomDomainResponseGetCustomDomainRetType, ok bool) {
|
||||
return getGetCustomDomainResponseGetCustomDomainAttributeTypeOk(o.CustomDomain)
|
||||
}
|
||||
|
||||
// SetCustomDomain sets field value
|
||||
func (o *GetCustomDomainResponse) SetCustomDomain(v GetCustomDomainResponseGetCustomDomainRetType) {
|
||||
setGetCustomDomainResponseGetCustomDomainAttributeType(&o.CustomDomain, v)
|
||||
}
|
||||
|
||||
func (o GetCustomDomainResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetCustomDomainResponseGetCertificateAttributeTypeOk(o.Certificate); ok {
|
||||
toSerialize["Certificate"] = val
|
||||
}
|
||||
if val, ok := getGetCustomDomainResponseGetCustomDomainAttributeTypeOk(o.CustomDomain); ok {
|
||||
toSerialize["CustomDomain"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
163
pkg/cdnbeta/model_get_custom_domain_response_certificate.go
Normal file
163
pkg/cdnbeta/model_get_custom_domain_response_certificate.go
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
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 'GetCustomDomainCustomCertificate'
|
||||
if jsonDict["type"] == "GetCustomDomainCustomCertificate" {
|
||||
// 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 'GetCustomDomainManagedCertificate'
|
||||
if jsonDict["type"] == "GetCustomDomainManagedCertificate" {
|
||||
// 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())
|
||||
}
|
||||
}
|
||||
|
||||
// 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 []byte("{}"), nil // no data in oneOf schemas => empty JSON object
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
11
pkg/cdnbeta/model_get_custom_domain_response_test.go
Normal file
11
pkg/cdnbeta/model_get_custom_domain_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
125
pkg/cdnbeta/model_get_distribution_response.go
Normal file
125
pkg/cdnbeta/model_get_distribution_response.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GetDistributionResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetDistributionResponse{}
|
||||
|
||||
/*
|
||||
types and functions for distribution
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type GetDistributionResponseGetDistributionAttributeType = *Distribution
|
||||
type GetDistributionResponseGetDistributionArgType = Distribution
|
||||
type GetDistributionResponseGetDistributionRetType = Distribution
|
||||
|
||||
func getGetDistributionResponseGetDistributionAttributeTypeOk(arg GetDistributionResponseGetDistributionAttributeType) (ret GetDistributionResponseGetDistributionRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetDistributionResponseGetDistributionAttributeType(arg *GetDistributionResponseGetDistributionAttributeType, val GetDistributionResponseGetDistributionRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// GetDistributionResponse struct for GetDistributionResponse
|
||||
type GetDistributionResponse struct {
|
||||
// REQUIRED
|
||||
Distribution GetDistributionResponseGetDistributionAttributeType `json:"distribution" required:"true"`
|
||||
}
|
||||
|
||||
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 GetDistributionResponseGetDistributionArgType) *GetDistributionResponse {
|
||||
this := GetDistributionResponse{}
|
||||
setGetDistributionResponseGetDistributionAttributeType(&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() (ret GetDistributionResponseGetDistributionRetType) {
|
||||
ret, _ = o.GetDistributionOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDistributionOk returns a tuple with the Distribution field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetDistributionResponse) GetDistributionOk() (ret GetDistributionResponseGetDistributionRetType, ok bool) {
|
||||
return getGetDistributionResponseGetDistributionAttributeTypeOk(o.Distribution)
|
||||
}
|
||||
|
||||
// SetDistribution sets field value
|
||||
func (o *GetDistributionResponse) SetDistribution(v GetDistributionResponseGetDistributionRetType) {
|
||||
setGetDistributionResponseGetDistributionAttributeType(&o.Distribution, v)
|
||||
}
|
||||
|
||||
func (o GetDistributionResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetDistributionResponseGetDistributionAttributeTypeOk(o.Distribution); ok {
|
||||
toSerialize["Distribution"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_get_distribution_response_test.go
Normal file
11
pkg/cdnbeta/model_get_distribution_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
173
pkg/cdnbeta/model_get_logs_response.go
Normal file
173
pkg/cdnbeta/model_get_logs_response.go
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
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" required:"true"`
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_get_logs_response_test.go
Normal file
11
pkg/cdnbeta/model_get_logs_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
125
pkg/cdnbeta/model_get_statistics_response.go
Normal file
125
pkg/cdnbeta/model_get_statistics_response.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the GetStatisticsResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GetStatisticsResponse{}
|
||||
|
||||
/*
|
||||
types and functions for records
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type GetStatisticsResponseGetRecordsAttributeType = *[]DistributionStatisticsRecord
|
||||
type GetStatisticsResponseGetRecordsArgType = []DistributionStatisticsRecord
|
||||
type GetStatisticsResponseGetRecordsRetType = []DistributionStatisticsRecord
|
||||
|
||||
func getGetStatisticsResponseGetRecordsAttributeTypeOk(arg GetStatisticsResponseGetRecordsAttributeType) (ret GetStatisticsResponseGetRecordsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setGetStatisticsResponseGetRecordsAttributeType(arg *GetStatisticsResponseGetRecordsAttributeType, val GetStatisticsResponseGetRecordsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// GetStatisticsResponse struct for GetStatisticsResponse
|
||||
type GetStatisticsResponse struct {
|
||||
// REQUIRED
|
||||
Records GetStatisticsResponseGetRecordsAttributeType `json:"records" required:"true"`
|
||||
}
|
||||
|
||||
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 GetStatisticsResponseGetRecordsArgType) *GetStatisticsResponse {
|
||||
this := GetStatisticsResponse{}
|
||||
setGetStatisticsResponseGetRecordsAttributeType(&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() (ret GetStatisticsResponseGetRecordsRetType) {
|
||||
ret, _ = o.GetRecordsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetRecordsOk returns a tuple with the Records field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GetStatisticsResponse) GetRecordsOk() (ret GetStatisticsResponseGetRecordsRetType, ok bool) {
|
||||
return getGetStatisticsResponseGetRecordsAttributeTypeOk(o.Records)
|
||||
}
|
||||
|
||||
// SetRecords sets field value
|
||||
func (o *GetStatisticsResponse) SetRecords(v GetStatisticsResponseGetRecordsRetType) {
|
||||
setGetStatisticsResponseGetRecordsAttributeType(&o.Records, v)
|
||||
}
|
||||
|
||||
func (o GetStatisticsResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getGetStatisticsResponseGetRecordsAttributeTypeOk(o.Records); ok {
|
||||
toSerialize["Records"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_get_statistics_response_test.go
Normal file
11
pkg/cdnbeta/model_get_statistics_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
259
pkg/cdnbeta/model_http_backend.go
Normal file
259
pkg/cdnbeta/model_http_backend.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the HttpBackend type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &HttpBackend{}
|
||||
|
||||
/*
|
||||
types and functions for geofencing
|
||||
*/
|
||||
|
||||
// isContainer
|
||||
type HttpBackendGetGeofencingAttributeType = *map[string][]string
|
||||
type HttpBackendGetGeofencingArgType = map[string][]string
|
||||
type HttpBackendGetGeofencingRetType = map[string][]string
|
||||
|
||||
func getHttpBackendGetGeofencingAttributeTypeOk(arg HttpBackendGetGeofencingAttributeType) (ret HttpBackendGetGeofencingRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendGetGeofencingAttributeType(arg *HttpBackendGetGeofencingAttributeType, val HttpBackendGetGeofencingRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for originRequestHeaders
|
||||
*/
|
||||
|
||||
// isContainer
|
||||
type HttpBackendGetOriginRequestHeadersAttributeType = *map[string]string
|
||||
type HttpBackendGetOriginRequestHeadersArgType = map[string]string
|
||||
type HttpBackendGetOriginRequestHeadersRetType = map[string]string
|
||||
|
||||
func getHttpBackendGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendGetOriginRequestHeadersAttributeType) (ret HttpBackendGetOriginRequestHeadersRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendGetOriginRequestHeadersAttributeType(arg *HttpBackendGetOriginRequestHeadersAttributeType, val HttpBackendGetOriginRequestHeadersRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for originUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type HttpBackendGetOriginUrlAttributeType = *string
|
||||
|
||||
func getHttpBackendGetOriginUrlAttributeTypeOk(arg HttpBackendGetOriginUrlAttributeType) (ret HttpBackendGetOriginUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendGetOriginUrlAttributeType(arg *HttpBackendGetOriginUrlAttributeType, val HttpBackendGetOriginUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type HttpBackendGetOriginUrlArgType = string
|
||||
type HttpBackendGetOriginUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type HttpBackendGetTypeAttributeType = *string
|
||||
|
||||
func getHttpBackendGetTypeAttributeTypeOk(arg HttpBackendGetTypeAttributeType) (ret HttpBackendGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendGetTypeAttributeType(arg *HttpBackendGetTypeAttributeType, val HttpBackendGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type HttpBackendGetTypeArgType = string
|
||||
type HttpBackendGetTypeRetType = string
|
||||
|
||||
// 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.
|
||||
// REQUIRED
|
||||
Geofencing HttpBackendGetGeofencingAttributeType `json:"geofencing" required:"true"`
|
||||
// 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.
|
||||
// REQUIRED
|
||||
OriginRequestHeaders HttpBackendGetOriginRequestHeadersAttributeType `json:"originRequestHeaders" required:"true"`
|
||||
// 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`
|
||||
// REQUIRED
|
||||
OriginUrl HttpBackendGetOriginUrlAttributeType `json:"originUrl" required:"true"`
|
||||
// REQUIRED
|
||||
Type HttpBackendGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 HttpBackendGetGeofencingArgType, originRequestHeaders HttpBackendGetOriginRequestHeadersArgType, originUrl HttpBackendGetOriginUrlArgType, types HttpBackendGetTypeArgType) *HttpBackend {
|
||||
this := HttpBackend{}
|
||||
setHttpBackendGetGeofencingAttributeType(&this.Geofencing, geofencing)
|
||||
setHttpBackendGetOriginRequestHeadersAttributeType(&this.OriginRequestHeaders, originRequestHeaders)
|
||||
setHttpBackendGetOriginUrlAttributeType(&this.OriginUrl, originUrl)
|
||||
setHttpBackendGetTypeAttributeType(&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() (ret HttpBackendGetGeofencingRetType) {
|
||||
ret, _ = o.GetGeofencingOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetGeofencingOk returns a tuple with the Geofencing field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *HttpBackend) GetGeofencingOk() (ret HttpBackendGetGeofencingRetType, ok bool) {
|
||||
return getHttpBackendGetGeofencingAttributeTypeOk(o.Geofencing)
|
||||
}
|
||||
|
||||
// SetGeofencing sets field value
|
||||
func (o *HttpBackend) SetGeofencing(v HttpBackendGetGeofencingRetType) {
|
||||
setHttpBackendGetGeofencingAttributeType(&o.Geofencing, v)
|
||||
}
|
||||
|
||||
// GetOriginRequestHeaders returns the OriginRequestHeaders field value
|
||||
func (o *HttpBackend) GetOriginRequestHeaders() (ret HttpBackendGetOriginRequestHeadersRetType) {
|
||||
ret, _ = o.GetOriginRequestHeadersOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetOriginRequestHeadersOk returns a tuple with the OriginRequestHeaders field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *HttpBackend) GetOriginRequestHeadersOk() (ret HttpBackendGetOriginRequestHeadersRetType, ok bool) {
|
||||
return getHttpBackendGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders)
|
||||
}
|
||||
|
||||
// SetOriginRequestHeaders sets field value
|
||||
func (o *HttpBackend) SetOriginRequestHeaders(v HttpBackendGetOriginRequestHeadersRetType) {
|
||||
setHttpBackendGetOriginRequestHeadersAttributeType(&o.OriginRequestHeaders, v)
|
||||
}
|
||||
|
||||
// GetOriginUrl returns the OriginUrl field value
|
||||
func (o *HttpBackend) GetOriginUrl() (ret HttpBackendGetOriginUrlRetType) {
|
||||
ret, _ = o.GetOriginUrlOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetOriginUrlOk returns a tuple with the OriginUrl field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *HttpBackend) GetOriginUrlOk() (ret HttpBackendGetOriginUrlRetType, ok bool) {
|
||||
return getHttpBackendGetOriginUrlAttributeTypeOk(o.OriginUrl)
|
||||
}
|
||||
|
||||
// SetOriginUrl sets field value
|
||||
func (o *HttpBackend) SetOriginUrl(v HttpBackendGetOriginUrlRetType) {
|
||||
setHttpBackendGetOriginUrlAttributeType(&o.OriginUrl, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *HttpBackend) GetType() (ret HttpBackendGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *HttpBackend) GetTypeOk() (ret HttpBackendGetTypeRetType, ok bool) {
|
||||
return getHttpBackendGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *HttpBackend) SetType(v HttpBackendGetTypeRetType) {
|
||||
setHttpBackendGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o HttpBackend) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getHttpBackendGetGeofencingAttributeTypeOk(o.Geofencing); ok {
|
||||
toSerialize["Geofencing"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders); ok {
|
||||
toSerialize["OriginRequestHeaders"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendGetOriginUrlAttributeTypeOk(o.OriginUrl); ok {
|
||||
toSerialize["OriginUrl"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
267
pkg/cdnbeta/model_http_backend_create.go
Normal file
267
pkg/cdnbeta/model_http_backend_create.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the HttpBackendCreate type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &HttpBackendCreate{}
|
||||
|
||||
/*
|
||||
types and functions for geofencing
|
||||
*/
|
||||
|
||||
// isContainer
|
||||
type HttpBackendCreateGetGeofencingAttributeType = *map[string][]string
|
||||
type HttpBackendCreateGetGeofencingArgType = map[string][]string
|
||||
type HttpBackendCreateGetGeofencingRetType = map[string][]string
|
||||
|
||||
func getHttpBackendCreateGetGeofencingAttributeTypeOk(arg HttpBackendCreateGetGeofencingAttributeType) (ret HttpBackendCreateGetGeofencingRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendCreateGetGeofencingAttributeType(arg *HttpBackendCreateGetGeofencingAttributeType, val HttpBackendCreateGetGeofencingRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for originRequestHeaders
|
||||
*/
|
||||
|
||||
// isContainer
|
||||
type HttpBackendCreateGetOriginRequestHeadersAttributeType = *map[string]string
|
||||
type HttpBackendCreateGetOriginRequestHeadersArgType = map[string]string
|
||||
type HttpBackendCreateGetOriginRequestHeadersRetType = map[string]string
|
||||
|
||||
func getHttpBackendCreateGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendCreateGetOriginRequestHeadersAttributeType) (ret HttpBackendCreateGetOriginRequestHeadersRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendCreateGetOriginRequestHeadersAttributeType(arg *HttpBackendCreateGetOriginRequestHeadersAttributeType, val HttpBackendCreateGetOriginRequestHeadersRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for originUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type HttpBackendCreateGetOriginUrlAttributeType = *string
|
||||
|
||||
func getHttpBackendCreateGetOriginUrlAttributeTypeOk(arg HttpBackendCreateGetOriginUrlAttributeType) (ret HttpBackendCreateGetOriginUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendCreateGetOriginUrlAttributeType(arg *HttpBackendCreateGetOriginUrlAttributeType, val HttpBackendCreateGetOriginUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type HttpBackendCreateGetOriginUrlArgType = string
|
||||
type HttpBackendCreateGetOriginUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type HttpBackendCreateGetTypeAttributeType = *string
|
||||
|
||||
func getHttpBackendCreateGetTypeAttributeTypeOk(arg HttpBackendCreateGetTypeAttributeType) (ret HttpBackendCreateGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendCreateGetTypeAttributeType(arg *HttpBackendCreateGetTypeAttributeType, val HttpBackendCreateGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type HttpBackendCreateGetTypeArgType = string
|
||||
type HttpBackendCreateGetTypeRetType = string
|
||||
|
||||
// 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 HttpBackendCreateGetGeofencingAttributeType `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 HttpBackendCreateGetOriginRequestHeadersAttributeType `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`
|
||||
// REQUIRED
|
||||
OriginUrl HttpBackendCreateGetOriginUrlAttributeType `json:"originUrl" required:"true"`
|
||||
// REQUIRED
|
||||
Type HttpBackendCreateGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 HttpBackendCreateGetOriginUrlArgType, types HttpBackendCreateGetTypeArgType) *HttpBackendCreate {
|
||||
this := HttpBackendCreate{}
|
||||
setHttpBackendCreateGetOriginUrlAttributeType(&this.OriginUrl, originUrl)
|
||||
setHttpBackendCreateGetTypeAttributeType(&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() (res HttpBackendCreateGetGeofencingRetType) {
|
||||
res, _ = o.GetGeofencingOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret HttpBackendCreateGetGeofencingRetType, ok bool) {
|
||||
return getHttpBackendCreateGetGeofencingAttributeTypeOk(o.Geofencing)
|
||||
}
|
||||
|
||||
// HasGeofencing returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *HttpBackendCreate) SetGeofencing(v HttpBackendCreateGetGeofencingRetType) {
|
||||
setHttpBackendCreateGetGeofencingAttributeType(&o.Geofencing, v)
|
||||
}
|
||||
|
||||
// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise.
|
||||
func (o *HttpBackendCreate) GetOriginRequestHeaders() (res HttpBackendCreateGetOriginRequestHeadersRetType) {
|
||||
res, _ = o.GetOriginRequestHeadersOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret HttpBackendCreateGetOriginRequestHeadersRetType, ok bool) {
|
||||
return getHttpBackendCreateGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders)
|
||||
}
|
||||
|
||||
// HasOriginRequestHeaders returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *HttpBackendCreate) SetOriginRequestHeaders(v HttpBackendCreateGetOriginRequestHeadersRetType) {
|
||||
setHttpBackendCreateGetOriginRequestHeadersAttributeType(&o.OriginRequestHeaders, v)
|
||||
}
|
||||
|
||||
// GetOriginUrl returns the OriginUrl field value
|
||||
func (o *HttpBackendCreate) GetOriginUrl() (ret HttpBackendCreateGetOriginUrlRetType) {
|
||||
ret, _ = o.GetOriginUrlOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetOriginUrlOk returns a tuple with the OriginUrl field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *HttpBackendCreate) GetOriginUrlOk() (ret HttpBackendCreateGetOriginUrlRetType, ok bool) {
|
||||
return getHttpBackendCreateGetOriginUrlAttributeTypeOk(o.OriginUrl)
|
||||
}
|
||||
|
||||
// SetOriginUrl sets field value
|
||||
func (o *HttpBackendCreate) SetOriginUrl(v HttpBackendCreateGetOriginUrlRetType) {
|
||||
setHttpBackendCreateGetOriginUrlAttributeType(&o.OriginUrl, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *HttpBackendCreate) GetType() (ret HttpBackendCreateGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *HttpBackendCreate) GetTypeOk() (ret HttpBackendCreateGetTypeRetType, ok bool) {
|
||||
return getHttpBackendCreateGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *HttpBackendCreate) SetType(v HttpBackendCreateGetTypeRetType) {
|
||||
setHttpBackendCreateGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o HttpBackendCreate) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getHttpBackendCreateGetGeofencingAttributeTypeOk(o.Geofencing); ok {
|
||||
toSerialize["Geofencing"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendCreateGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders); ok {
|
||||
toSerialize["OriginRequestHeaders"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendCreateGetOriginUrlAttributeTypeOk(o.OriginUrl); ok {
|
||||
toSerialize["OriginUrl"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendCreateGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_http_backend_create_test.go
Normal file
11
pkg/cdnbeta/model_http_backend_create_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
271
pkg/cdnbeta/model_http_backend_patch.go
Normal file
271
pkg/cdnbeta/model_http_backend_patch.go
Normal file
|
|
@ -0,0 +1,271 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the HttpBackendPatch type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &HttpBackendPatch{}
|
||||
|
||||
/*
|
||||
types and functions for geofencing
|
||||
*/
|
||||
|
||||
// isContainer
|
||||
type HttpBackendPatchGetGeofencingAttributeType = *map[string][]string
|
||||
type HttpBackendPatchGetGeofencingArgType = map[string][]string
|
||||
type HttpBackendPatchGetGeofencingRetType = map[string][]string
|
||||
|
||||
func getHttpBackendPatchGetGeofencingAttributeTypeOk(arg HttpBackendPatchGetGeofencingAttributeType) (ret HttpBackendPatchGetGeofencingRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendPatchGetGeofencingAttributeType(arg *HttpBackendPatchGetGeofencingAttributeType, val HttpBackendPatchGetGeofencingRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for originRequestHeaders
|
||||
*/
|
||||
|
||||
// isContainer
|
||||
type HttpBackendPatchGetOriginRequestHeadersAttributeType = *map[string]string
|
||||
type HttpBackendPatchGetOriginRequestHeadersArgType = map[string]string
|
||||
type HttpBackendPatchGetOriginRequestHeadersRetType = map[string]string
|
||||
|
||||
func getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(arg HttpBackendPatchGetOriginRequestHeadersAttributeType) (ret HttpBackendPatchGetOriginRequestHeadersRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendPatchGetOriginRequestHeadersAttributeType(arg *HttpBackendPatchGetOriginRequestHeadersAttributeType, val HttpBackendPatchGetOriginRequestHeadersRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for originUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type HttpBackendPatchGetOriginUrlAttributeType = *string
|
||||
|
||||
func getHttpBackendPatchGetOriginUrlAttributeTypeOk(arg HttpBackendPatchGetOriginUrlAttributeType) (ret HttpBackendPatchGetOriginUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendPatchGetOriginUrlAttributeType(arg *HttpBackendPatchGetOriginUrlAttributeType, val HttpBackendPatchGetOriginUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type HttpBackendPatchGetOriginUrlArgType = string
|
||||
type HttpBackendPatchGetOriginUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type HttpBackendPatchGetTypeAttributeType = *string
|
||||
|
||||
func getHttpBackendPatchGetTypeAttributeTypeOk(arg HttpBackendPatchGetTypeAttributeType) (ret HttpBackendPatchGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setHttpBackendPatchGetTypeAttributeType(arg *HttpBackendPatchGetTypeAttributeType, val HttpBackendPatchGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type HttpBackendPatchGetTypeArgType = string
|
||||
type HttpBackendPatchGetTypeRetType = string
|
||||
|
||||
// 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 HttpBackendPatchGetGeofencingAttributeType `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 HttpBackendPatchGetOriginRequestHeadersAttributeType `json:"originRequestHeaders,omitempty"`
|
||||
OriginUrl HttpBackendPatchGetOriginUrlAttributeType `json:"originUrl,omitempty"`
|
||||
// This property is required to determine the used backend type.
|
||||
// REQUIRED
|
||||
Type HttpBackendPatchGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 HttpBackendPatchGetTypeArgType) *HttpBackendPatch {
|
||||
this := HttpBackendPatch{}
|
||||
setHttpBackendPatchGetTypeAttributeType(&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() (res HttpBackendPatchGetGeofencingRetType) {
|
||||
res, _ = o.GetGeofencingOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret HttpBackendPatchGetGeofencingRetType, ok bool) {
|
||||
return getHttpBackendPatchGetGeofencingAttributeTypeOk(o.Geofencing)
|
||||
}
|
||||
|
||||
// HasGeofencing returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *HttpBackendPatch) SetGeofencing(v HttpBackendPatchGetGeofencingRetType) {
|
||||
setHttpBackendPatchGetGeofencingAttributeType(&o.Geofencing, v)
|
||||
}
|
||||
|
||||
// GetOriginRequestHeaders returns the OriginRequestHeaders field value if set, zero value otherwise.
|
||||
func (o *HttpBackendPatch) GetOriginRequestHeaders() (res HttpBackendPatchGetOriginRequestHeadersRetType) {
|
||||
res, _ = o.GetOriginRequestHeadersOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret HttpBackendPatchGetOriginRequestHeadersRetType, ok bool) {
|
||||
return getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders)
|
||||
}
|
||||
|
||||
// HasOriginRequestHeaders returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *HttpBackendPatch) SetOriginRequestHeaders(v HttpBackendPatchGetOriginRequestHeadersRetType) {
|
||||
setHttpBackendPatchGetOriginRequestHeadersAttributeType(&o.OriginRequestHeaders, v)
|
||||
}
|
||||
|
||||
// GetOriginUrl returns the OriginUrl field value if set, zero value otherwise.
|
||||
func (o *HttpBackendPatch) GetOriginUrl() (res HttpBackendPatchGetOriginUrlRetType) {
|
||||
res, _ = o.GetOriginUrlOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret HttpBackendPatchGetOriginUrlRetType, ok bool) {
|
||||
return getHttpBackendPatchGetOriginUrlAttributeTypeOk(o.OriginUrl)
|
||||
}
|
||||
|
||||
// HasOriginUrl returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *HttpBackendPatch) SetOriginUrl(v HttpBackendPatchGetOriginUrlRetType) {
|
||||
setHttpBackendPatchGetOriginUrlAttributeType(&o.OriginUrl, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *HttpBackendPatch) GetType() (ret HttpBackendPatchGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *HttpBackendPatch) GetTypeOk() (ret HttpBackendPatchGetTypeRetType, ok bool) {
|
||||
return getHttpBackendPatchGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *HttpBackendPatch) SetType(v HttpBackendPatchGetTypeRetType) {
|
||||
setHttpBackendPatchGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o HttpBackendPatch) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getHttpBackendPatchGetGeofencingAttributeTypeOk(o.Geofencing); ok {
|
||||
toSerialize["Geofencing"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendPatchGetOriginRequestHeadersAttributeTypeOk(o.OriginRequestHeaders); ok {
|
||||
toSerialize["OriginRequestHeaders"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendPatchGetOriginUrlAttributeTypeOk(o.OriginUrl); ok {
|
||||
toSerialize["OriginUrl"] = val
|
||||
}
|
||||
if val, ok := getHttpBackendPatchGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_http_backend_patch_test.go
Normal file
11
pkg/cdnbeta/model_http_backend_patch_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
11
pkg/cdnbeta/model_http_backend_test.go
Normal file
11
pkg/cdnbeta/model_http_backend_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
173
pkg/cdnbeta/model_list_distributions_response.go
Normal file
173
pkg/cdnbeta/model_list_distributions_response.go
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ListDistributionsResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ListDistributionsResponse{}
|
||||
|
||||
/*
|
||||
types and functions for distributions
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type ListDistributionsResponseGetDistributionsAttributeType = *[]Distribution
|
||||
type ListDistributionsResponseGetDistributionsArgType = []Distribution
|
||||
type ListDistributionsResponseGetDistributionsRetType = []Distribution
|
||||
|
||||
func getListDistributionsResponseGetDistributionsAttributeTypeOk(arg ListDistributionsResponseGetDistributionsAttributeType) (ret ListDistributionsResponseGetDistributionsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListDistributionsResponseGetDistributionsAttributeType(arg *ListDistributionsResponseGetDistributionsAttributeType, val ListDistributionsResponseGetDistributionsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for nextPageIdentifier
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type ListDistributionsResponseGetNextPageIdentifierAttributeType = *string
|
||||
|
||||
func getListDistributionsResponseGetNextPageIdentifierAttributeTypeOk(arg ListDistributionsResponseGetNextPageIdentifierAttributeType) (ret ListDistributionsResponseGetNextPageIdentifierRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListDistributionsResponseGetNextPageIdentifierAttributeType(arg *ListDistributionsResponseGetNextPageIdentifierAttributeType, val ListDistributionsResponseGetNextPageIdentifierRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type ListDistributionsResponseGetNextPageIdentifierArgType = string
|
||||
type ListDistributionsResponseGetNextPageIdentifierRetType = string
|
||||
|
||||
// ListDistributionsResponse struct for ListDistributionsResponse
|
||||
type ListDistributionsResponse struct {
|
||||
// REQUIRED
|
||||
Distributions ListDistributionsResponseGetDistributionsAttributeType `json:"distributions" required:"true"`
|
||||
NextPageIdentifier ListDistributionsResponseGetNextPageIdentifierAttributeType `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 ListDistributionsResponseGetDistributionsArgType) *ListDistributionsResponse {
|
||||
this := ListDistributionsResponse{}
|
||||
setListDistributionsResponseGetDistributionsAttributeType(&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() (ret ListDistributionsResponseGetDistributionsRetType) {
|
||||
ret, _ = o.GetDistributionsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetDistributionsOk returns a tuple with the Distributions field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ListDistributionsResponse) GetDistributionsOk() (ret ListDistributionsResponseGetDistributionsRetType, ok bool) {
|
||||
return getListDistributionsResponseGetDistributionsAttributeTypeOk(o.Distributions)
|
||||
}
|
||||
|
||||
// SetDistributions sets field value
|
||||
func (o *ListDistributionsResponse) SetDistributions(v ListDistributionsResponseGetDistributionsRetType) {
|
||||
setListDistributionsResponseGetDistributionsAttributeType(&o.Distributions, v)
|
||||
}
|
||||
|
||||
// GetNextPageIdentifier returns the NextPageIdentifier field value if set, zero value otherwise.
|
||||
func (o *ListDistributionsResponse) GetNextPageIdentifier() (res ListDistributionsResponseGetNextPageIdentifierRetType) {
|
||||
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 *ListDistributionsResponse) GetNextPageIdentifierOk() (ret ListDistributionsResponseGetNextPageIdentifierRetType, ok bool) {
|
||||
return getListDistributionsResponseGetNextPageIdentifierAttributeTypeOk(o.NextPageIdentifier)
|
||||
}
|
||||
|
||||
// HasNextPageIdentifier returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *ListDistributionsResponse) SetNextPageIdentifier(v ListDistributionsResponseGetNextPageIdentifierRetType) {
|
||||
setListDistributionsResponseGetNextPageIdentifierAttributeType(&o.NextPageIdentifier, v)
|
||||
}
|
||||
|
||||
func (o ListDistributionsResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getListDistributionsResponseGetDistributionsAttributeTypeOk(o.Distributions); ok {
|
||||
toSerialize["Distributions"] = val
|
||||
}
|
||||
if val, ok := getListDistributionsResponseGetNextPageIdentifierAttributeTypeOk(o.NextPageIdentifier); ok {
|
||||
toSerialize["NextPageIdentifier"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_list_distributions_response_test.go
Normal file
11
pkg/cdnbeta/model_list_distributions_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
125
pkg/cdnbeta/model_list_waf_collections_response.go
Normal file
125
pkg/cdnbeta/model_list_waf_collections_response.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ListWafCollectionsResponse type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ListWafCollectionsResponse{}
|
||||
|
||||
/*
|
||||
types and functions for collections
|
||||
*/
|
||||
|
||||
// isArray
|
||||
type ListWafCollectionsResponseGetCollectionsAttributeType = *[]WafRuleCollection
|
||||
type ListWafCollectionsResponseGetCollectionsArgType = []WafRuleCollection
|
||||
type ListWafCollectionsResponseGetCollectionsRetType = []WafRuleCollection
|
||||
|
||||
func getListWafCollectionsResponseGetCollectionsAttributeTypeOk(arg ListWafCollectionsResponseGetCollectionsAttributeType) (ret ListWafCollectionsResponseGetCollectionsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setListWafCollectionsResponseGetCollectionsAttributeType(arg *ListWafCollectionsResponseGetCollectionsAttributeType, val ListWafCollectionsResponseGetCollectionsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
// ListWafCollectionsResponse struct for ListWafCollectionsResponse
|
||||
type ListWafCollectionsResponse struct {
|
||||
// REQUIRED
|
||||
Collections ListWafCollectionsResponseGetCollectionsAttributeType `json:"collections" required:"true"`
|
||||
}
|
||||
|
||||
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 ListWafCollectionsResponseGetCollectionsArgType) *ListWafCollectionsResponse {
|
||||
this := ListWafCollectionsResponse{}
|
||||
setListWafCollectionsResponseGetCollectionsAttributeType(&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() (ret ListWafCollectionsResponseGetCollectionsRetType) {
|
||||
ret, _ = o.GetCollectionsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCollectionsOk returns a tuple with the Collections field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ListWafCollectionsResponse) GetCollectionsOk() (ret ListWafCollectionsResponseGetCollectionsRetType, ok bool) {
|
||||
return getListWafCollectionsResponseGetCollectionsAttributeTypeOk(o.Collections)
|
||||
}
|
||||
|
||||
// SetCollections sets field value
|
||||
func (o *ListWafCollectionsResponse) SetCollections(v ListWafCollectionsResponseGetCollectionsRetType) {
|
||||
setListWafCollectionsResponseGetCollectionsAttributeType(&o.Collections, v)
|
||||
}
|
||||
|
||||
func (o ListWafCollectionsResponse) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getListWafCollectionsResponseGetCollectionsAttributeTypeOk(o.Collections); ok {
|
||||
toSerialize["Collections"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_list_waf_collections_response_test.go
Normal file
11
pkg/cdnbeta/model_list_waf_collections_response_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
170
pkg/cdnbeta/model_loki_log_sink.go
Normal file
170
pkg/cdnbeta/model_loki_log_sink.go
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the LokiLogSink type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &LokiLogSink{}
|
||||
|
||||
/*
|
||||
types and functions for pushUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type LokiLogSinkGetPushUrlAttributeType = *string
|
||||
|
||||
func getLokiLogSinkGetPushUrlAttributeTypeOk(arg LokiLogSinkGetPushUrlAttributeType) (ret LokiLogSinkGetPushUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkGetPushUrlAttributeType(arg *LokiLogSinkGetPushUrlAttributeType, val LokiLogSinkGetPushUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type LokiLogSinkGetPushUrlArgType = string
|
||||
type LokiLogSinkGetPushUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type LokiLogSinkGetTypeAttributeType = *string
|
||||
|
||||
func getLokiLogSinkGetTypeAttributeTypeOk(arg LokiLogSinkGetTypeAttributeType) (ret LokiLogSinkGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkGetTypeAttributeType(arg *LokiLogSinkGetTypeAttributeType, val LokiLogSinkGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type LokiLogSinkGetTypeArgType = string
|
||||
type LokiLogSinkGetTypeRetType = string
|
||||
|
||||
// LokiLogSink struct for LokiLogSink
|
||||
type LokiLogSink struct {
|
||||
// REQUIRED
|
||||
PushUrl LokiLogSinkGetPushUrlAttributeType `json:"pushUrl" required:"true"`
|
||||
// REQUIRED
|
||||
Type LokiLogSinkGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 LokiLogSinkGetPushUrlArgType, types LokiLogSinkGetTypeArgType) *LokiLogSink {
|
||||
this := LokiLogSink{}
|
||||
setLokiLogSinkGetPushUrlAttributeType(&this.PushUrl, pushUrl)
|
||||
setLokiLogSinkGetTypeAttributeType(&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() (ret LokiLogSinkGetPushUrlRetType) {
|
||||
ret, _ = o.GetPushUrlOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetPushUrlOk returns a tuple with the PushUrl field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *LokiLogSink) GetPushUrlOk() (ret LokiLogSinkGetPushUrlRetType, ok bool) {
|
||||
return getLokiLogSinkGetPushUrlAttributeTypeOk(o.PushUrl)
|
||||
}
|
||||
|
||||
// SetPushUrl sets field value
|
||||
func (o *LokiLogSink) SetPushUrl(v LokiLogSinkGetPushUrlRetType) {
|
||||
setLokiLogSinkGetPushUrlAttributeType(&o.PushUrl, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *LokiLogSink) GetType() (ret LokiLogSinkGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *LokiLogSink) GetTypeOk() (ret LokiLogSinkGetTypeRetType, ok bool) {
|
||||
return getLokiLogSinkGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *LokiLogSink) SetType(v LokiLogSinkGetTypeRetType) {
|
||||
setLokiLogSinkGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o LokiLogSink) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getLokiLogSinkGetPushUrlAttributeTypeOk(o.PushUrl); ok {
|
||||
toSerialize["PushUrl"] = val
|
||||
}
|
||||
if val, ok := getLokiLogSinkGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
213
pkg/cdnbeta/model_loki_log_sink_create.go
Normal file
213
pkg/cdnbeta/model_loki_log_sink_create.go
Normal file
|
|
@ -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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the LokiLogSinkCreate type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &LokiLogSinkCreate{}
|
||||
|
||||
/*
|
||||
types and functions for credentials
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type LokiLogSinkCreateGetCredentialsAttributeType = *LokiLogSinkCredentials
|
||||
type LokiLogSinkCreateGetCredentialsArgType = LokiLogSinkCredentials
|
||||
type LokiLogSinkCreateGetCredentialsRetType = LokiLogSinkCredentials
|
||||
|
||||
func getLokiLogSinkCreateGetCredentialsAttributeTypeOk(arg LokiLogSinkCreateGetCredentialsAttributeType) (ret LokiLogSinkCreateGetCredentialsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkCreateGetCredentialsAttributeType(arg *LokiLogSinkCreateGetCredentialsAttributeType, val LokiLogSinkCreateGetCredentialsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for pushUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type LokiLogSinkCreateGetPushUrlAttributeType = *string
|
||||
|
||||
func getLokiLogSinkCreateGetPushUrlAttributeTypeOk(arg LokiLogSinkCreateGetPushUrlAttributeType) (ret LokiLogSinkCreateGetPushUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkCreateGetPushUrlAttributeType(arg *LokiLogSinkCreateGetPushUrlAttributeType, val LokiLogSinkCreateGetPushUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type LokiLogSinkCreateGetPushUrlArgType = string
|
||||
type LokiLogSinkCreateGetPushUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type LokiLogSinkCreateGetTypeAttributeType = *string
|
||||
|
||||
func getLokiLogSinkCreateGetTypeAttributeTypeOk(arg LokiLogSinkCreateGetTypeAttributeType) (ret LokiLogSinkCreateGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkCreateGetTypeAttributeType(arg *LokiLogSinkCreateGetTypeAttributeType, val LokiLogSinkCreateGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type LokiLogSinkCreateGetTypeArgType = string
|
||||
type LokiLogSinkCreateGetTypeRetType = string
|
||||
|
||||
// LokiLogSinkCreate struct for LokiLogSinkCreate
|
||||
type LokiLogSinkCreate struct {
|
||||
// REQUIRED
|
||||
Credentials LokiLogSinkCreateGetCredentialsAttributeType `json:"credentials" required:"true"`
|
||||
// REQUIRED
|
||||
PushUrl LokiLogSinkCreateGetPushUrlAttributeType `json:"pushUrl" required:"true"`
|
||||
// REQUIRED
|
||||
Type LokiLogSinkCreateGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 LokiLogSinkCreateGetCredentialsArgType, pushUrl LokiLogSinkCreateGetPushUrlArgType, types LokiLogSinkCreateGetTypeArgType) *LokiLogSinkCreate {
|
||||
this := LokiLogSinkCreate{}
|
||||
setLokiLogSinkCreateGetCredentialsAttributeType(&this.Credentials, credentials)
|
||||
setLokiLogSinkCreateGetPushUrlAttributeType(&this.PushUrl, pushUrl)
|
||||
setLokiLogSinkCreateGetTypeAttributeType(&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() (ret LokiLogSinkCreateGetCredentialsRetType) {
|
||||
ret, _ = o.GetCredentialsOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetCredentialsOk returns a tuple with the Credentials field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *LokiLogSinkCreate) GetCredentialsOk() (ret LokiLogSinkCreateGetCredentialsRetType, ok bool) {
|
||||
return getLokiLogSinkCreateGetCredentialsAttributeTypeOk(o.Credentials)
|
||||
}
|
||||
|
||||
// SetCredentials sets field value
|
||||
func (o *LokiLogSinkCreate) SetCredentials(v LokiLogSinkCreateGetCredentialsRetType) {
|
||||
setLokiLogSinkCreateGetCredentialsAttributeType(&o.Credentials, v)
|
||||
}
|
||||
|
||||
// GetPushUrl returns the PushUrl field value
|
||||
func (o *LokiLogSinkCreate) GetPushUrl() (ret LokiLogSinkCreateGetPushUrlRetType) {
|
||||
ret, _ = o.GetPushUrlOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetPushUrlOk returns a tuple with the PushUrl field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *LokiLogSinkCreate) GetPushUrlOk() (ret LokiLogSinkCreateGetPushUrlRetType, ok bool) {
|
||||
return getLokiLogSinkCreateGetPushUrlAttributeTypeOk(o.PushUrl)
|
||||
}
|
||||
|
||||
// SetPushUrl sets field value
|
||||
func (o *LokiLogSinkCreate) SetPushUrl(v LokiLogSinkCreateGetPushUrlRetType) {
|
||||
setLokiLogSinkCreateGetPushUrlAttributeType(&o.PushUrl, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *LokiLogSinkCreate) GetType() (ret LokiLogSinkCreateGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *LokiLogSinkCreate) GetTypeOk() (ret LokiLogSinkCreateGetTypeRetType, ok bool) {
|
||||
return getLokiLogSinkCreateGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *LokiLogSinkCreate) SetType(v LokiLogSinkCreateGetTypeRetType) {
|
||||
setLokiLogSinkCreateGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o LokiLogSinkCreate) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getLokiLogSinkCreateGetCredentialsAttributeTypeOk(o.Credentials); ok {
|
||||
toSerialize["Credentials"] = val
|
||||
}
|
||||
if val, ok := getLokiLogSinkCreateGetPushUrlAttributeTypeOk(o.PushUrl); ok {
|
||||
toSerialize["PushUrl"] = val
|
||||
}
|
||||
if val, ok := getLokiLogSinkCreateGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_loki_log_sink_create_test.go
Normal file
11
pkg/cdnbeta/model_loki_log_sink_create_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
170
pkg/cdnbeta/model_loki_log_sink_credentials.go
Normal file
170
pkg/cdnbeta/model_loki_log_sink_credentials.go
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the LokiLogSinkCredentials type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &LokiLogSinkCredentials{}
|
||||
|
||||
/*
|
||||
types and functions for password
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type LokiLogSinkCredentialsGetPasswordAttributeType = *string
|
||||
|
||||
func getLokiLogSinkCredentialsGetPasswordAttributeTypeOk(arg LokiLogSinkCredentialsGetPasswordAttributeType) (ret LokiLogSinkCredentialsGetPasswordRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkCredentialsGetPasswordAttributeType(arg *LokiLogSinkCredentialsGetPasswordAttributeType, val LokiLogSinkCredentialsGetPasswordRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type LokiLogSinkCredentialsGetPasswordArgType = string
|
||||
type LokiLogSinkCredentialsGetPasswordRetType = string
|
||||
|
||||
/*
|
||||
types and functions for username
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type LokiLogSinkCredentialsGetUsernameAttributeType = *string
|
||||
|
||||
func getLokiLogSinkCredentialsGetUsernameAttributeTypeOk(arg LokiLogSinkCredentialsGetUsernameAttributeType) (ret LokiLogSinkCredentialsGetUsernameRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkCredentialsGetUsernameAttributeType(arg *LokiLogSinkCredentialsGetUsernameAttributeType, val LokiLogSinkCredentialsGetUsernameRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type LokiLogSinkCredentialsGetUsernameArgType = string
|
||||
type LokiLogSinkCredentialsGetUsernameRetType = string
|
||||
|
||||
// LokiLogSinkCredentials struct for LokiLogSinkCredentials
|
||||
type LokiLogSinkCredentials struct {
|
||||
// REQUIRED
|
||||
Password LokiLogSinkCredentialsGetPasswordAttributeType `json:"password" required:"true"`
|
||||
// REQUIRED
|
||||
Username LokiLogSinkCredentialsGetUsernameAttributeType `json:"username" required:"true"`
|
||||
}
|
||||
|
||||
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 LokiLogSinkCredentialsGetPasswordArgType, username LokiLogSinkCredentialsGetUsernameArgType) *LokiLogSinkCredentials {
|
||||
this := LokiLogSinkCredentials{}
|
||||
setLokiLogSinkCredentialsGetPasswordAttributeType(&this.Password, password)
|
||||
setLokiLogSinkCredentialsGetUsernameAttributeType(&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() (ret LokiLogSinkCredentialsGetPasswordRetType) {
|
||||
ret, _ = o.GetPasswordOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetPasswordOk returns a tuple with the Password field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *LokiLogSinkCredentials) GetPasswordOk() (ret LokiLogSinkCredentialsGetPasswordRetType, ok bool) {
|
||||
return getLokiLogSinkCredentialsGetPasswordAttributeTypeOk(o.Password)
|
||||
}
|
||||
|
||||
// SetPassword sets field value
|
||||
func (o *LokiLogSinkCredentials) SetPassword(v LokiLogSinkCredentialsGetPasswordRetType) {
|
||||
setLokiLogSinkCredentialsGetPasswordAttributeType(&o.Password, v)
|
||||
}
|
||||
|
||||
// GetUsername returns the Username field value
|
||||
func (o *LokiLogSinkCredentials) GetUsername() (ret LokiLogSinkCredentialsGetUsernameRetType) {
|
||||
ret, _ = o.GetUsernameOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetUsernameOk returns a tuple with the Username field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *LokiLogSinkCredentials) GetUsernameOk() (ret LokiLogSinkCredentialsGetUsernameRetType, ok bool) {
|
||||
return getLokiLogSinkCredentialsGetUsernameAttributeTypeOk(o.Username)
|
||||
}
|
||||
|
||||
// SetUsername sets field value
|
||||
func (o *LokiLogSinkCredentials) SetUsername(v LokiLogSinkCredentialsGetUsernameRetType) {
|
||||
setLokiLogSinkCredentialsGetUsernameAttributeType(&o.Username, v)
|
||||
}
|
||||
|
||||
func (o LokiLogSinkCredentials) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getLokiLogSinkCredentialsGetPasswordAttributeTypeOk(o.Password); ok {
|
||||
toSerialize["Password"] = val
|
||||
}
|
||||
if val, ok := getLokiLogSinkCredentialsGetUsernameAttributeTypeOk(o.Username); ok {
|
||||
toSerialize["Username"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_loki_log_sink_credentials_test.go
Normal file
11
pkg/cdnbeta/model_loki_log_sink_credentials_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
221
pkg/cdnbeta/model_loki_log_sink_patch.go
Normal file
221
pkg/cdnbeta/model_loki_log_sink_patch.go
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the LokiLogSinkPatch type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &LokiLogSinkPatch{}
|
||||
|
||||
/*
|
||||
types and functions for credentials
|
||||
*/
|
||||
|
||||
// isModel
|
||||
type LokiLogSinkPatchGetCredentialsAttributeType = *LokiLogSinkCredentials
|
||||
type LokiLogSinkPatchGetCredentialsArgType = LokiLogSinkCredentials
|
||||
type LokiLogSinkPatchGetCredentialsRetType = LokiLogSinkCredentials
|
||||
|
||||
func getLokiLogSinkPatchGetCredentialsAttributeTypeOk(arg LokiLogSinkPatchGetCredentialsAttributeType) (ret LokiLogSinkPatchGetCredentialsRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkPatchGetCredentialsAttributeType(arg *LokiLogSinkPatchGetCredentialsAttributeType, val LokiLogSinkPatchGetCredentialsRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
/*
|
||||
types and functions for pushUrl
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type LokiLogSinkPatchGetPushUrlAttributeType = *string
|
||||
|
||||
func getLokiLogSinkPatchGetPushUrlAttributeTypeOk(arg LokiLogSinkPatchGetPushUrlAttributeType) (ret LokiLogSinkPatchGetPushUrlRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkPatchGetPushUrlAttributeType(arg *LokiLogSinkPatchGetPushUrlAttributeType, val LokiLogSinkPatchGetPushUrlRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type LokiLogSinkPatchGetPushUrlArgType = string
|
||||
type LokiLogSinkPatchGetPushUrlRetType = string
|
||||
|
||||
/*
|
||||
types and functions for type
|
||||
*/
|
||||
|
||||
// isNotNullableString
|
||||
type LokiLogSinkPatchGetTypeAttributeType = *string
|
||||
|
||||
func getLokiLogSinkPatchGetTypeAttributeTypeOk(arg LokiLogSinkPatchGetTypeAttributeType) (ret LokiLogSinkPatchGetTypeRetType, ok bool) {
|
||||
if arg == nil {
|
||||
return ret, false
|
||||
}
|
||||
return *arg, true
|
||||
}
|
||||
|
||||
func setLokiLogSinkPatchGetTypeAttributeType(arg *LokiLogSinkPatchGetTypeAttributeType, val LokiLogSinkPatchGetTypeRetType) {
|
||||
*arg = &val
|
||||
}
|
||||
|
||||
type LokiLogSinkPatchGetTypeArgType = string
|
||||
type LokiLogSinkPatchGetTypeRetType = string
|
||||
|
||||
// LokiLogSinkPatch struct for LokiLogSinkPatch
|
||||
type LokiLogSinkPatch struct {
|
||||
Credentials LokiLogSinkPatchGetCredentialsAttributeType `json:"credentials,omitempty"`
|
||||
PushUrl LokiLogSinkPatchGetPushUrlAttributeType `json:"pushUrl,omitempty"`
|
||||
// REQUIRED
|
||||
Type LokiLogSinkPatchGetTypeAttributeType `json:"type" required:"true"`
|
||||
}
|
||||
|
||||
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 LokiLogSinkPatchGetTypeArgType) *LokiLogSinkPatch {
|
||||
this := LokiLogSinkPatch{}
|
||||
setLokiLogSinkPatchGetTypeAttributeType(&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() (res LokiLogSinkPatchGetCredentialsRetType) {
|
||||
res, _ = o.GetCredentialsOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret LokiLogSinkPatchGetCredentialsRetType, ok bool) {
|
||||
return getLokiLogSinkPatchGetCredentialsAttributeTypeOk(o.Credentials)
|
||||
}
|
||||
|
||||
// HasCredentials returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *LokiLogSinkPatch) SetCredentials(v LokiLogSinkPatchGetCredentialsRetType) {
|
||||
setLokiLogSinkPatchGetCredentialsAttributeType(&o.Credentials, v)
|
||||
}
|
||||
|
||||
// GetPushUrl returns the PushUrl field value if set, zero value otherwise.
|
||||
func (o *LokiLogSinkPatch) GetPushUrl() (res LokiLogSinkPatchGetPushUrlRetType) {
|
||||
res, _ = o.GetPushUrlOk()
|
||||
return
|
||||
}
|
||||
|
||||
// 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() (ret LokiLogSinkPatchGetPushUrlRetType, ok bool) {
|
||||
return getLokiLogSinkPatchGetPushUrlAttributeTypeOk(o.PushUrl)
|
||||
}
|
||||
|
||||
// HasPushUrl returns a boolean if a field has been set.
|
||||
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.
|
||||
func (o *LokiLogSinkPatch) SetPushUrl(v LokiLogSinkPatchGetPushUrlRetType) {
|
||||
setLokiLogSinkPatchGetPushUrlAttributeType(&o.PushUrl, v)
|
||||
}
|
||||
|
||||
// GetType returns the Type field value
|
||||
func (o *LokiLogSinkPatch) GetType() (ret LokiLogSinkPatchGetTypeRetType) {
|
||||
ret, _ = o.GetTypeOk()
|
||||
return ret
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *LokiLogSinkPatch) GetTypeOk() (ret LokiLogSinkPatchGetTypeRetType, ok bool) {
|
||||
return getLokiLogSinkPatchGetTypeAttributeTypeOk(o.Type)
|
||||
}
|
||||
|
||||
// SetType sets field value
|
||||
func (o *LokiLogSinkPatch) SetType(v LokiLogSinkPatchGetTypeRetType) {
|
||||
setLokiLogSinkPatchGetTypeAttributeType(&o.Type, v)
|
||||
}
|
||||
|
||||
func (o LokiLogSinkPatch) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if val, ok := getLokiLogSinkPatchGetCredentialsAttributeTypeOk(o.Credentials); ok {
|
||||
toSerialize["Credentials"] = val
|
||||
}
|
||||
if val, ok := getLokiLogSinkPatchGetPushUrlAttributeTypeOk(o.PushUrl); ok {
|
||||
toSerialize["PushUrl"] = val
|
||||
}
|
||||
if val, ok := getLokiLogSinkPatchGetTypeAttributeTypeOk(o.Type); ok {
|
||||
toSerialize["Type"] = val
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
11
pkg/cdnbeta/model_loki_log_sink_patch_test.go
Normal file
11
pkg/cdnbeta/model_loki_log_sink_patch_test.go
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
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 cdnbeta
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue