diff --git a/services/certificates/api_default_test.go b/services/certificates/api_default_test.go index 024c12f19..1272927c4 100644 --- a/services/certificates/api_default_test.go +++ b/services/certificates/api_default_test.go @@ -24,14 +24,14 @@ import ( func Test_certificates_DefaultApiService(t *testing.T) { t.Run("Test DefaultApiService CreateCertificate", func(t *testing.T) { - path := "/v2beta/projects/{projectId}/regions/{region}/certificates" + _apiUrlPath := "/v2beta/projects/{projectId}/regions/{region}/certificates" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := CreateCertificateResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -65,8 +65,8 @@ func Test_certificates_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue + region := regionValue createCertificatePayload := CreateCertificatePayload{} resp, reqErr := apiClient.CreateCertificate(context.Background(), projectId, region).CreateCertificatePayload(createCertificatePayload).Execute() @@ -74,22 +74,22 @@ func Test_certificates_DefaultApiService(t *testing.T) { if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService DeleteCertificate", func(t *testing.T) { - path := "/v2beta/projects/{projectId}/regions/{region}/certificates/{id}" + _apiUrlPath := "/v2beta/projects/{projectId}/regions/{region}/certificates/{id}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + 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) @@ -123,31 +123,31 @@ func Test_certificates_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - id := "id" + projectId := projectIdValue + region := regionValue + id := idValue resp, reqErr := apiClient.DeleteCertificate(context.Background(), projectId, region, id).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService GetCertificate", func(t *testing.T) { - path := "/v2beta/projects/{projectId}/regions/{region}/certificates/{id}" + _apiUrlPath := "/v2beta/projects/{projectId}/regions/{region}/certificates/{id}" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) idValue := "id" - path = strings.Replace(path, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(idValue, "id")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := GetCertificateResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -181,29 +181,29 @@ func Test_certificates_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" - id := "id" + projectId := projectIdValue + region := regionValue + id := idValue resp, reqErr := apiClient.GetCertificate(context.Background(), projectId, region, id).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) t.Run("Test DefaultApiService ListCertificates", func(t *testing.T) { - path := "/v2beta/projects/{projectId}/regions/{region}/certificates" + _apiUrlPath := "/v2beta/projects/{projectId}/regions/{region}/certificates" projectIdValue := "projectId" - path = strings.Replace(path, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) regionValue := "region" - path = strings.Replace(path, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) + _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(regionValue, "region")), -1) testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(path, func(w http.ResponseWriter, req *http.Request) { + testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { data := ListCertificatesResponse{} w.Header().Add("Content-Type", "application/json") json.NewEncoder(w).Encode(data) @@ -237,15 +237,15 @@ func Test_certificates_DefaultApiService(t *testing.T) { t.Fatalf("creating API client: %v", err) } - projectId := "projectId" - region := "region" + projectId := projectIdValue + region := regionValue resp, reqErr := apiClient.ListCertificates(context.Background(), projectId, region).Execute() if reqErr != nil { t.Fatalf("error in call: %v", reqErr) } - if resp == nil { + if IsNil(resp) { t.Fatalf("response not present") } }) diff --git a/services/certificates/model_create_certificate_payload.go b/services/certificates/model_create_certificate_payload.go index c9e4f87eb..47ca094c6 100644 --- a/services/certificates/model_create_certificate_payload.go +++ b/services/certificates/model_create_certificate_payload.go @@ -17,18 +17,123 @@ import ( // checks if the CreateCertificatePayload type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateCertificatePayload{} +/* + types and functions for name +*/ + +// isNotNullableString +type CreateCertificatePayloadGetNameAttributeType = *string + +func getCreateCertificatePayloadGetNameAttributeTypeOk(arg CreateCertificatePayloadGetNameAttributeType) (ret CreateCertificatePayloadGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetNameAttributeType(arg *CreateCertificatePayloadGetNameAttributeType, val CreateCertificatePayloadGetNameRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetNameArgType = string +type CreateCertificatePayloadGetNameRetType = string + +/* + types and functions for privateKey +*/ + +// isNotNullableString +type CreateCertificatePayloadGetPrivateKeyAttributeType = *string + +func getCreateCertificatePayloadGetPrivateKeyAttributeTypeOk(arg CreateCertificatePayloadGetPrivateKeyAttributeType) (ret CreateCertificatePayloadGetPrivateKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetPrivateKeyAttributeType(arg *CreateCertificatePayloadGetPrivateKeyAttributeType, val CreateCertificatePayloadGetPrivateKeyRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetPrivateKeyArgType = string +type CreateCertificatePayloadGetPrivateKeyRetType = string + +/* + types and functions for projectId +*/ + +// isNotNullableString +type CreateCertificatePayloadGetProjectIdAttributeType = *string + +func getCreateCertificatePayloadGetProjectIdAttributeTypeOk(arg CreateCertificatePayloadGetProjectIdAttributeType) (ret CreateCertificatePayloadGetProjectIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetProjectIdAttributeType(arg *CreateCertificatePayloadGetProjectIdAttributeType, val CreateCertificatePayloadGetProjectIdRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetProjectIdArgType = string +type CreateCertificatePayloadGetProjectIdRetType = string + +/* + types and functions for publicKey +*/ + +// isNotNullableString +type CreateCertificatePayloadGetPublicKeyAttributeType = *string + +func getCreateCertificatePayloadGetPublicKeyAttributeTypeOk(arg CreateCertificatePayloadGetPublicKeyAttributeType) (ret CreateCertificatePayloadGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetPublicKeyAttributeType(arg *CreateCertificatePayloadGetPublicKeyAttributeType, val CreateCertificatePayloadGetPublicKeyRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetPublicKeyArgType = string +type CreateCertificatePayloadGetPublicKeyRetType = string + +/* + types and functions for region +*/ + +// isNotNullableString +type CreateCertificatePayloadGetRegionAttributeType = *string + +func getCreateCertificatePayloadGetRegionAttributeTypeOk(arg CreateCertificatePayloadGetRegionAttributeType) (ret CreateCertificatePayloadGetRegionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificatePayloadGetRegionAttributeType(arg *CreateCertificatePayloadGetRegionAttributeType, val CreateCertificatePayloadGetRegionRetType) { + *arg = &val +} + +type CreateCertificatePayloadGetRegionArgType = string +type CreateCertificatePayloadGetRegionRetType = string + // CreateCertificatePayload Uploads a PEM encoded X509 public/private key pair type CreateCertificatePayload struct { // TLS certificate name - Name *string `json:"name,omitempty"` + Name CreateCertificatePayloadGetNameAttributeType `json:"name,omitempty"` // The PEM encoded private key part - PrivateKey *string `json:"privateKey,omitempty"` + PrivateKey CreateCertificatePayloadGetPrivateKeyAttributeType `json:"privateKey,omitempty"` // Project identifier - ProjectId *string `json:"projectId,omitempty"` + ProjectId CreateCertificatePayloadGetProjectIdAttributeType `json:"projectId,omitempty"` // The PEM encoded public key part - PublicKey *string `json:"publicKey,omitempty"` + PublicKey CreateCertificatePayloadGetPublicKeyAttributeType `json:"publicKey,omitempty"` // Region - Region *string `json:"region,omitempty"` + Region CreateCertificatePayloadGetRegionAttributeType `json:"region,omitempty"` } // NewCreateCertificatePayload instantiates a new CreateCertificatePayload object @@ -49,181 +154,136 @@ func NewCreateCertificatePayloadWithDefaults() *CreateCertificatePayload { } // GetName returns the Name field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *CreateCertificatePayload) GetName() (res CreateCertificatePayloadGetNameRetType) { + res, _ = o.GetNameOk() + return } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCertificatePayload) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *CreateCertificatePayload) GetNameOk() (ret CreateCertificatePayloadGetNameRetType, ok bool) { + return getCreateCertificatePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *CreateCertificatePayload) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *CreateCertificatePayload) SetName(v *string) { - o.Name = v +func (o *CreateCertificatePayload) SetName(v CreateCertificatePayloadGetNameRetType) { + setCreateCertificatePayloadGetNameAttributeType(&o.Name, v) } // GetPrivateKey returns the PrivateKey field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetPrivateKey() *string { - if o == nil || IsNil(o.PrivateKey) { - var ret *string - return ret - } - return o.PrivateKey +func (o *CreateCertificatePayload) GetPrivateKey() (res CreateCertificatePayloadGetPrivateKeyRetType) { + res, _ = o.GetPrivateKeyOk() + return } // GetPrivateKeyOk returns a tuple with the PrivateKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCertificatePayload) GetPrivateKeyOk() (*string, bool) { - if o == nil || IsNil(o.PrivateKey) { - return nil, false - } - return o.PrivateKey, true +func (o *CreateCertificatePayload) GetPrivateKeyOk() (ret CreateCertificatePayloadGetPrivateKeyRetType, ok bool) { + return getCreateCertificatePayloadGetPrivateKeyAttributeTypeOk(o.PrivateKey) } // HasPrivateKey returns a boolean if a field has been set. func (o *CreateCertificatePayload) HasPrivateKey() bool { - if o != nil && !IsNil(o.PrivateKey) { - return true - } - - return false + _, ok := o.GetPrivateKeyOk() + return ok } // SetPrivateKey gets a reference to the given string and assigns it to the PrivateKey field. -func (o *CreateCertificatePayload) SetPrivateKey(v *string) { - o.PrivateKey = v +func (o *CreateCertificatePayload) SetPrivateKey(v CreateCertificatePayloadGetPrivateKeyRetType) { + setCreateCertificatePayloadGetPrivateKeyAttributeType(&o.PrivateKey, v) } // GetProjectId returns the ProjectId field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetProjectId() *string { - if o == nil || IsNil(o.ProjectId) { - var ret *string - return ret - } - return o.ProjectId +func (o *CreateCertificatePayload) GetProjectId() (res CreateCertificatePayloadGetProjectIdRetType) { + res, _ = o.GetProjectIdOk() + return } // GetProjectIdOk returns a tuple with the ProjectId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCertificatePayload) GetProjectIdOk() (*string, bool) { - if o == nil || IsNil(o.ProjectId) { - return nil, false - } - return o.ProjectId, true +func (o *CreateCertificatePayload) GetProjectIdOk() (ret CreateCertificatePayloadGetProjectIdRetType, ok bool) { + return getCreateCertificatePayloadGetProjectIdAttributeTypeOk(o.ProjectId) } // HasProjectId returns a boolean if a field has been set. func (o *CreateCertificatePayload) HasProjectId() bool { - if o != nil && !IsNil(o.ProjectId) { - return true - } - - return false + _, ok := o.GetProjectIdOk() + return ok } // SetProjectId gets a reference to the given string and assigns it to the ProjectId field. -func (o *CreateCertificatePayload) SetProjectId(v *string) { - o.ProjectId = v +func (o *CreateCertificatePayload) SetProjectId(v CreateCertificatePayloadGetProjectIdRetType) { + setCreateCertificatePayloadGetProjectIdAttributeType(&o.ProjectId, v) } // GetPublicKey returns the PublicKey field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - return o.PublicKey +func (o *CreateCertificatePayload) GetPublicKey() (res CreateCertificatePayloadGetPublicKeyRetType) { + res, _ = o.GetPublicKeyOk() + return } // GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCertificatePayload) GetPublicKeyOk() (*string, bool) { - if o == nil || IsNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true +func (o *CreateCertificatePayload) GetPublicKeyOk() (ret CreateCertificatePayloadGetPublicKeyRetType, ok bool) { + return getCreateCertificatePayloadGetPublicKeyAttributeTypeOk(o.PublicKey) } // HasPublicKey returns a boolean if a field has been set. func (o *CreateCertificatePayload) HasPublicKey() bool { - if o != nil && !IsNil(o.PublicKey) { - return true - } - - return false + _, ok := o.GetPublicKeyOk() + return ok } // SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. -func (o *CreateCertificatePayload) SetPublicKey(v *string) { - o.PublicKey = v +func (o *CreateCertificatePayload) SetPublicKey(v CreateCertificatePayloadGetPublicKeyRetType) { + setCreateCertificatePayloadGetPublicKeyAttributeType(&o.PublicKey, v) } // GetRegion returns the Region field value if set, zero value otherwise. -func (o *CreateCertificatePayload) GetRegion() *string { - if o == nil || IsNil(o.Region) { - var ret *string - return ret - } - return o.Region +func (o *CreateCertificatePayload) GetRegion() (res CreateCertificatePayloadGetRegionRetType) { + 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 *CreateCertificatePayload) GetRegionOk() (*string, bool) { - if o == nil || IsNil(o.Region) { - return nil, false - } - return o.Region, true +func (o *CreateCertificatePayload) GetRegionOk() (ret CreateCertificatePayloadGetRegionRetType, ok bool) { + return getCreateCertificatePayloadGetRegionAttributeTypeOk(o.Region) } // HasRegion returns a boolean if a field has been set. func (o *CreateCertificatePayload) HasRegion() bool { - if o != nil && !IsNil(o.Region) { - return true - } - - return false + _, ok := o.GetRegionOk() + return ok } // SetRegion gets a reference to the given string and assigns it to the Region field. -func (o *CreateCertificatePayload) SetRegion(v *string) { - o.Region = v +func (o *CreateCertificatePayload) SetRegion(v CreateCertificatePayloadGetRegionRetType) { + setCreateCertificatePayloadGetRegionAttributeType(&o.Region, v) } func (o CreateCertificatePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getCreateCertificatePayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.PrivateKey) { - toSerialize["privateKey"] = o.PrivateKey + if val, ok := getCreateCertificatePayloadGetPrivateKeyAttributeTypeOk(o.PrivateKey); ok { + toSerialize["PrivateKey"] = val } - if !IsNil(o.ProjectId) { - toSerialize["projectId"] = o.ProjectId + if val, ok := getCreateCertificatePayloadGetProjectIdAttributeTypeOk(o.ProjectId); ok { + toSerialize["ProjectId"] = val } - if !IsNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + if val, ok := getCreateCertificatePayloadGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region + if val, ok := getCreateCertificatePayloadGetRegionAttributeTypeOk(o.Region); ok { + toSerialize["Region"] = val } return toSerialize, nil } diff --git a/services/certificates/model_create_certificate_response.go b/services/certificates/model_create_certificate_response.go index a2a756778..1bc5306e3 100644 --- a/services/certificates/model_create_certificate_response.go +++ b/services/certificates/model_create_certificate_response.go @@ -17,12 +17,54 @@ import ( // checks if the CreateCertificateResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &CreateCertificateResponse{} +/* + types and functions for id +*/ + +// isNotNullableString +type CreateCertificateResponseGetIdAttributeType = *string + +func getCreateCertificateResponseGetIdAttributeTypeOk(arg CreateCertificateResponseGetIdAttributeType) (ret CreateCertificateResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificateResponseGetIdAttributeType(arg *CreateCertificateResponseGetIdAttributeType, val CreateCertificateResponseGetIdRetType) { + *arg = &val +} + +type CreateCertificateResponseGetIdArgType = string +type CreateCertificateResponseGetIdRetType = string + +/* + types and functions for region +*/ + +// isNotNullableString +type CreateCertificateResponseGetRegionAttributeType = *string + +func getCreateCertificateResponseGetRegionAttributeTypeOk(arg CreateCertificateResponseGetRegionAttributeType) (ret CreateCertificateResponseGetRegionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateCertificateResponseGetRegionAttributeType(arg *CreateCertificateResponseGetRegionAttributeType, val CreateCertificateResponseGetRegionRetType) { + *arg = &val +} + +type CreateCertificateResponseGetRegionArgType = string +type CreateCertificateResponseGetRegionRetType = string + // CreateCertificateResponse CreateCertificateResponse returns unique resource id type CreateCertificateResponse struct { // The certificates resource id - Id *string `json:"id,omitempty"` + Id CreateCertificateResponseGetIdAttributeType `json:"id,omitempty"` // Region - Region *string `json:"region,omitempty"` + Region CreateCertificateResponseGetRegionAttributeType `json:"region,omitempty"` } // NewCreateCertificateResponse instantiates a new CreateCertificateResponse object @@ -43,76 +85,58 @@ func NewCreateCertificateResponseWithDefaults() *CreateCertificateResponse { } // GetId returns the Id field value if set, zero value otherwise. -func (o *CreateCertificateResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *CreateCertificateResponse) GetId() (res CreateCertificateResponseGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateCertificateResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *CreateCertificateResponse) GetIdOk() (ret CreateCertificateResponseGetIdRetType, ok bool) { + return getCreateCertificateResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *CreateCertificateResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *CreateCertificateResponse) SetId(v *string) { - o.Id = v +func (o *CreateCertificateResponse) SetId(v CreateCertificateResponseGetIdRetType) { + setCreateCertificateResponseGetIdAttributeType(&o.Id, v) } // GetRegion returns the Region field value if set, zero value otherwise. -func (o *CreateCertificateResponse) GetRegion() *string { - if o == nil || IsNil(o.Region) { - var ret *string - return ret - } - return o.Region +func (o *CreateCertificateResponse) GetRegion() (res CreateCertificateResponseGetRegionRetType) { + 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 *CreateCertificateResponse) GetRegionOk() (*string, bool) { - if o == nil || IsNil(o.Region) { - return nil, false - } - return o.Region, true +func (o *CreateCertificateResponse) GetRegionOk() (ret CreateCertificateResponseGetRegionRetType, ok bool) { + return getCreateCertificateResponseGetRegionAttributeTypeOk(o.Region) } // HasRegion returns a boolean if a field has been set. func (o *CreateCertificateResponse) HasRegion() bool { - if o != nil && !IsNil(o.Region) { - return true - } - - return false + _, ok := o.GetRegionOk() + return ok } // SetRegion gets a reference to the given string and assigns it to the Region field. -func (o *CreateCertificateResponse) SetRegion(v *string) { - o.Region = v +func (o *CreateCertificateResponse) SetRegion(v CreateCertificateResponseGetRegionRetType) { + setCreateCertificateResponseGetRegionAttributeType(&o.Region, v) } func (o CreateCertificateResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getCreateCertificateResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region + if val, ok := getCreateCertificateResponseGetRegionAttributeTypeOk(o.Region); ok { + toSerialize["Region"] = val } return toSerialize, nil } diff --git a/services/certificates/model_get_certificate_response.go b/services/certificates/model_get_certificate_response.go index 85499b11d..6286d7ee3 100644 --- a/services/certificates/model_get_certificate_response.go +++ b/services/certificates/model_get_certificate_response.go @@ -17,16 +17,100 @@ import ( // checks if the GetCertificateResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GetCertificateResponse{} +/* + types and functions for id +*/ + +// isNotNullableString +type GetCertificateResponseGetIdAttributeType = *string + +func getGetCertificateResponseGetIdAttributeTypeOk(arg GetCertificateResponseGetIdAttributeType) (ret GetCertificateResponseGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetCertificateResponseGetIdAttributeType(arg *GetCertificateResponseGetIdAttributeType, val GetCertificateResponseGetIdRetType) { + *arg = &val +} + +type GetCertificateResponseGetIdArgType = string +type GetCertificateResponseGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +type GetCertificateResponseGetNameAttributeType = *string + +func getGetCertificateResponseGetNameAttributeTypeOk(arg GetCertificateResponseGetNameAttributeType) (ret GetCertificateResponseGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetCertificateResponseGetNameAttributeType(arg *GetCertificateResponseGetNameAttributeType, val GetCertificateResponseGetNameRetType) { + *arg = &val +} + +type GetCertificateResponseGetNameArgType = string +type GetCertificateResponseGetNameRetType = string + +/* + types and functions for publicKey +*/ + +// isNotNullableString +type GetCertificateResponseGetPublicKeyAttributeType = *string + +func getGetCertificateResponseGetPublicKeyAttributeTypeOk(arg GetCertificateResponseGetPublicKeyAttributeType) (ret GetCertificateResponseGetPublicKeyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetCertificateResponseGetPublicKeyAttributeType(arg *GetCertificateResponseGetPublicKeyAttributeType, val GetCertificateResponseGetPublicKeyRetType) { + *arg = &val +} + +type GetCertificateResponseGetPublicKeyArgType = string +type GetCertificateResponseGetPublicKeyRetType = string + +/* + types and functions for region +*/ + +// isNotNullableString +type GetCertificateResponseGetRegionAttributeType = *string + +func getGetCertificateResponseGetRegionAttributeTypeOk(arg GetCertificateResponseGetRegionAttributeType) (ret GetCertificateResponseGetRegionRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGetCertificateResponseGetRegionAttributeType(arg *GetCertificateResponseGetRegionAttributeType, val GetCertificateResponseGetRegionRetType) { + *arg = &val +} + +type GetCertificateResponseGetRegionArgType = string +type GetCertificateResponseGetRegionRetType = string + // GetCertificateResponse GetCertificateResponse returns name, id and public key type GetCertificateResponse struct { // The certificates resource id - Id *string `json:"id,omitempty"` + Id GetCertificateResponseGetIdAttributeType `json:"id,omitempty"` // TLS certificate name - Name *string `json:"name,omitempty"` + Name GetCertificateResponseGetNameAttributeType `json:"name,omitempty"` // The PEM encoded public key part - PublicKey *string `json:"publicKey,omitempty"` + PublicKey GetCertificateResponseGetPublicKeyAttributeType `json:"publicKey,omitempty"` // Region of the LoadBalancer - Region *string `json:"region,omitempty"` + Region GetCertificateResponseGetRegionAttributeType `json:"region,omitempty"` } // NewGetCertificateResponse instantiates a new GetCertificateResponse object @@ -47,146 +131,110 @@ func NewGetCertificateResponseWithDefaults() *GetCertificateResponse { } // GetId returns the Id field value if set, zero value otherwise. -func (o *GetCertificateResponse) GetId() *string { - if o == nil || IsNil(o.Id) { - var ret *string - return ret - } - return o.Id +func (o *GetCertificateResponse) GetId() (res GetCertificateResponseGetIdRetType) { + res, _ = o.GetIdOk() + return } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetCertificateResponse) GetIdOk() (*string, bool) { - if o == nil || IsNil(o.Id) { - return nil, false - } - return o.Id, true +func (o *GetCertificateResponse) GetIdOk() (ret GetCertificateResponseGetIdRetType, ok bool) { + return getGetCertificateResponseGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *GetCertificateResponse) HasId() bool { - if o != nil && !IsNil(o.Id) { - return true - } - - return false + _, ok := o.GetIdOk() + return ok } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *GetCertificateResponse) SetId(v *string) { - o.Id = v +func (o *GetCertificateResponse) SetId(v GetCertificateResponseGetIdRetType) { + setGetCertificateResponseGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value if set, zero value otherwise. -func (o *GetCertificateResponse) GetName() *string { - if o == nil || IsNil(o.Name) { - var ret *string - return ret - } - return o.Name +func (o *GetCertificateResponse) GetName() (res GetCertificateResponseGetNameRetType) { + res, _ = o.GetNameOk() + return } // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetCertificateResponse) GetNameOk() (*string, bool) { - if o == nil || IsNil(o.Name) { - return nil, false - } - return o.Name, true +func (o *GetCertificateResponse) GetNameOk() (ret GetCertificateResponseGetNameRetType, ok bool) { + return getGetCertificateResponseGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *GetCertificateResponse) HasName() bool { - if o != nil && !IsNil(o.Name) { - return true - } - - return false + _, ok := o.GetNameOk() + return ok } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *GetCertificateResponse) SetName(v *string) { - o.Name = v +func (o *GetCertificateResponse) SetName(v GetCertificateResponseGetNameRetType) { + setGetCertificateResponseGetNameAttributeType(&o.Name, v) } // GetPublicKey returns the PublicKey field value if set, zero value otherwise. -func (o *GetCertificateResponse) GetPublicKey() *string { - if o == nil || IsNil(o.PublicKey) { - var ret *string - return ret - } - return o.PublicKey +func (o *GetCertificateResponse) GetPublicKey() (res GetCertificateResponseGetPublicKeyRetType) { + res, _ = o.GetPublicKeyOk() + return } // GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetCertificateResponse) GetPublicKeyOk() (*string, bool) { - if o == nil || IsNil(o.PublicKey) { - return nil, false - } - return o.PublicKey, true +func (o *GetCertificateResponse) GetPublicKeyOk() (ret GetCertificateResponseGetPublicKeyRetType, ok bool) { + return getGetCertificateResponseGetPublicKeyAttributeTypeOk(o.PublicKey) } // HasPublicKey returns a boolean if a field has been set. func (o *GetCertificateResponse) HasPublicKey() bool { - if o != nil && !IsNil(o.PublicKey) { - return true - } - - return false + _, ok := o.GetPublicKeyOk() + return ok } // SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. -func (o *GetCertificateResponse) SetPublicKey(v *string) { - o.PublicKey = v +func (o *GetCertificateResponse) SetPublicKey(v GetCertificateResponseGetPublicKeyRetType) { + setGetCertificateResponseGetPublicKeyAttributeType(&o.PublicKey, v) } // GetRegion returns the Region field value if set, zero value otherwise. -func (o *GetCertificateResponse) GetRegion() *string { - if o == nil || IsNil(o.Region) { - var ret *string - return ret - } - return o.Region +func (o *GetCertificateResponse) GetRegion() (res GetCertificateResponseGetRegionRetType) { + 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 *GetCertificateResponse) GetRegionOk() (*string, bool) { - if o == nil || IsNil(o.Region) { - return nil, false - } - return o.Region, true +func (o *GetCertificateResponse) GetRegionOk() (ret GetCertificateResponseGetRegionRetType, ok bool) { + return getGetCertificateResponseGetRegionAttributeTypeOk(o.Region) } // HasRegion returns a boolean if a field has been set. func (o *GetCertificateResponse) HasRegion() bool { - if o != nil && !IsNil(o.Region) { - return true - } - - return false + _, ok := o.GetRegionOk() + return ok } // SetRegion gets a reference to the given string and assigns it to the Region field. -func (o *GetCertificateResponse) SetRegion(v *string) { - o.Region = v +func (o *GetCertificateResponse) SetRegion(v GetCertificateResponseGetRegionRetType) { + setGetCertificateResponseGetRegionAttributeType(&o.Region, v) } func (o GetCertificateResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Id) { - toSerialize["id"] = o.Id + if val, ok := getGetCertificateResponseGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val } - if !IsNil(o.Name) { - toSerialize["name"] = o.Name + if val, ok := getGetCertificateResponseGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val } - if !IsNil(o.PublicKey) { - toSerialize["publicKey"] = o.PublicKey + if val, ok := getGetCertificateResponseGetPublicKeyAttributeTypeOk(o.PublicKey); ok { + toSerialize["PublicKey"] = val } - if !IsNil(o.Region) { - toSerialize["region"] = o.Region + if val, ok := getGetCertificateResponseGetRegionAttributeTypeOk(o.Region); ok { + toSerialize["Region"] = val } return toSerialize, nil } diff --git a/services/certificates/model_google_protobuf_any.go b/services/certificates/model_google_protobuf_any.go index 704db5d2c..c8b0e022f 100644 --- a/services/certificates/model_google_protobuf_any.go +++ b/services/certificates/model_google_protobuf_any.go @@ -17,10 +17,31 @@ import ( // checks if the GoogleProtobufAny type satisfies the MappedNullable interface at compile time var _ MappedNullable = &GoogleProtobufAny{} +/* + types and functions for @type +*/ + +// isNotNullableString +type GoogleProtobufAnyGetTypeAttributeType = *string + +func getGoogleProtobufAnyGetTypeAttributeTypeOk(arg GoogleProtobufAnyGetTypeAttributeType) (ret GoogleProtobufAnyGetTypeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setGoogleProtobufAnyGetTypeAttributeType(arg *GoogleProtobufAnyGetTypeAttributeType, val GoogleProtobufAnyGetTypeRetType) { + *arg = &val +} + +type GoogleProtobufAnyGetTypeArgType = string +type GoogleProtobufAnyGetTypeRetType = string + // GoogleProtobufAny Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. type GoogleProtobufAny struct { // The type of the serialized message. - Type *string `json:"@type,omitempty"` + Type GoogleProtobufAnyGetTypeAttributeType `json:"@type,omitempty"` AdditionalProperties map[string]interface{} } @@ -44,41 +65,32 @@ func NewGoogleProtobufAnyWithDefaults() *GoogleProtobufAny { } // GetType returns the Type field value if set, zero value otherwise. -func (o *GoogleProtobufAny) GetType() *string { - if o == nil || IsNil(o.Type) { - var ret *string - return ret - } - return o.Type +func (o *GoogleProtobufAny) GetType() (res GoogleProtobufAnyGetTypeRetType) { + res, _ = o.GetTypeOk() + return } // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GoogleProtobufAny) GetTypeOk() (*string, bool) { - if o == nil || IsNil(o.Type) { - return nil, false - } - return o.Type, true +func (o *GoogleProtobufAny) GetTypeOk() (ret GoogleProtobufAnyGetTypeRetType, ok bool) { + return getGoogleProtobufAnyGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. func (o *GoogleProtobufAny) HasType() bool { - if o != nil && !IsNil(o.Type) { - return true - } - - return false + _, ok := o.GetTypeOk() + return ok } // SetType gets a reference to the given string and assigns it to the Type field. -func (o *GoogleProtobufAny) SetType(v *string) { - o.Type = v +func (o *GoogleProtobufAny) SetType(v GoogleProtobufAnyGetTypeRetType) { + setGoogleProtobufAnyGetTypeAttributeType(&o.Type, v) } func (o GoogleProtobufAny) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Type) { - toSerialize["@type"] = o.Type + if val, ok := getGoogleProtobufAnyGetTypeAttributeTypeOk(o.Type); ok { + toSerialize["Type"] = val } for key, value := range o.AdditionalProperties { diff --git a/services/certificates/model_list_certificates_response.go b/services/certificates/model_list_certificates_response.go index 3cc6e6138..4ba499bf4 100644 --- a/services/certificates/model_list_certificates_response.go +++ b/services/certificates/model_list_certificates_response.go @@ -17,11 +17,52 @@ import ( // checks if the ListCertificatesResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ListCertificatesResponse{} +/* + types and functions for items +*/ + +// isArray +type ListCertificatesResponseGetItemsAttributeType = *[]GetCertificateResponse +type ListCertificatesResponseGetItemsArgType = []GetCertificateResponse +type ListCertificatesResponseGetItemsRetType = []GetCertificateResponse + +func getListCertificatesResponseGetItemsAttributeTypeOk(arg ListCertificatesResponseGetItemsAttributeType) (ret ListCertificatesResponseGetItemsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListCertificatesResponseGetItemsAttributeType(arg *ListCertificatesResponseGetItemsAttributeType, val ListCertificatesResponseGetItemsRetType) { + *arg = &val +} + +/* + types and functions for nextPageId +*/ + +// isNotNullableString +type ListCertificatesResponseGetNextPageIdAttributeType = *string + +func getListCertificatesResponseGetNextPageIdAttributeTypeOk(arg ListCertificatesResponseGetNextPageIdAttributeType) (ret ListCertificatesResponseGetNextPageIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setListCertificatesResponseGetNextPageIdAttributeType(arg *ListCertificatesResponseGetNextPageIdAttributeType, val ListCertificatesResponseGetNextPageIdRetType) { + *arg = &val +} + +type ListCertificatesResponseGetNextPageIdArgType = string +type ListCertificatesResponseGetNextPageIdRetType = string + // ListCertificatesResponse ListCertificateResponse returns a list of certificate responses type ListCertificatesResponse struct { - Items *[]GetCertificateResponse `json:"items,omitempty"` + Items ListCertificatesResponseGetItemsAttributeType `json:"items,omitempty"` // Continue token from the ListCertificatesResponse with Limit option - NextPageId *string `json:"nextPageId,omitempty"` + NextPageId ListCertificatesResponseGetNextPageIdAttributeType `json:"nextPageId,omitempty"` } // NewListCertificatesResponse instantiates a new ListCertificatesResponse object @@ -42,76 +83,58 @@ func NewListCertificatesResponseWithDefaults() *ListCertificatesResponse { } // GetItems returns the Items field value if set, zero value otherwise. -func (o *ListCertificatesResponse) GetItems() *[]GetCertificateResponse { - if o == nil || IsNil(o.Items) { - var ret *[]GetCertificateResponse - return ret - } - return o.Items +func (o *ListCertificatesResponse) GetItems() (res ListCertificatesResponseGetItemsRetType) { + res, _ = o.GetItemsOk() + return } // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListCertificatesResponse) GetItemsOk() (*[]GetCertificateResponse, bool) { - if o == nil || IsNil(o.Items) { - return nil, false - } - return o.Items, true +func (o *ListCertificatesResponse) GetItemsOk() (ret ListCertificatesResponseGetItemsRetType, ok bool) { + return getListCertificatesResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. func (o *ListCertificatesResponse) HasItems() bool { - if o != nil && !IsNil(o.Items) { - return true - } - - return false + _, ok := o.GetItemsOk() + return ok } // SetItems gets a reference to the given []GetCertificateResponse and assigns it to the Items field. -func (o *ListCertificatesResponse) SetItems(v *[]GetCertificateResponse) { - o.Items = v +func (o *ListCertificatesResponse) SetItems(v ListCertificatesResponseGetItemsRetType) { + setListCertificatesResponseGetItemsAttributeType(&o.Items, v) } // GetNextPageId returns the NextPageId field value if set, zero value otherwise. -func (o *ListCertificatesResponse) GetNextPageId() *string { - if o == nil || IsNil(o.NextPageId) { - var ret *string - return ret - } - return o.NextPageId +func (o *ListCertificatesResponse) GetNextPageId() (res ListCertificatesResponseGetNextPageIdRetType) { + res, _ = o.GetNextPageIdOk() + return } // GetNextPageIdOk returns a tuple with the NextPageId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListCertificatesResponse) GetNextPageIdOk() (*string, bool) { - if o == nil || IsNil(o.NextPageId) { - return nil, false - } - return o.NextPageId, true +func (o *ListCertificatesResponse) GetNextPageIdOk() (ret ListCertificatesResponseGetNextPageIdRetType, ok bool) { + return getListCertificatesResponseGetNextPageIdAttributeTypeOk(o.NextPageId) } // HasNextPageId returns a boolean if a field has been set. func (o *ListCertificatesResponse) HasNextPageId() bool { - if o != nil && !IsNil(o.NextPageId) { - return true - } - - return false + _, ok := o.GetNextPageIdOk() + return ok } // SetNextPageId gets a reference to the given string and assigns it to the NextPageId field. -func (o *ListCertificatesResponse) SetNextPageId(v *string) { - o.NextPageId = v +func (o *ListCertificatesResponse) SetNextPageId(v ListCertificatesResponseGetNextPageIdRetType) { + setListCertificatesResponseGetNextPageIdAttributeType(&o.NextPageId, v) } func (o ListCertificatesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Items) { - toSerialize["items"] = o.Items + if val, ok := getListCertificatesResponseGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val } - if !IsNil(o.NextPageId) { - toSerialize["nextPageId"] = o.NextPageId + if val, ok := getListCertificatesResponseGetNextPageIdAttributeTypeOk(o.NextPageId); ok { + toSerialize["NextPageId"] = val } return toSerialize, nil } diff --git a/services/certificates/model_status.go b/services/certificates/model_status.go index a6849bf48..331aa9e85 100644 --- a/services/certificates/model_status.go +++ b/services/certificates/model_status.go @@ -17,15 +17,76 @@ import ( // checks if the Status type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Status{} +/* + types and functions for code +*/ + +// isInteger +type StatusGetCodeAttributeType = *int64 +type StatusGetCodeArgType = int64 +type StatusGetCodeRetType = int64 + +func getStatusGetCodeAttributeTypeOk(arg StatusGetCodeAttributeType) (ret StatusGetCodeRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetCodeAttributeType(arg *StatusGetCodeAttributeType, val StatusGetCodeRetType) { + *arg = &val +} + +/* + types and functions for details +*/ + +// isArray +type StatusGetDetailsAttributeType = *[]GoogleProtobufAny +type StatusGetDetailsArgType = []GoogleProtobufAny +type StatusGetDetailsRetType = []GoogleProtobufAny + +func getStatusGetDetailsAttributeTypeOk(arg StatusGetDetailsAttributeType) (ret StatusGetDetailsRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetDetailsAttributeType(arg *StatusGetDetailsAttributeType, val StatusGetDetailsRetType) { + *arg = &val +} + +/* + types and functions for message +*/ + +// isNotNullableString +type StatusGetMessageAttributeType = *string + +func getStatusGetMessageAttributeTypeOk(arg StatusGetMessageAttributeType) (ret StatusGetMessageRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setStatusGetMessageAttributeType(arg *StatusGetMessageAttributeType, val StatusGetMessageRetType) { + *arg = &val +} + +type StatusGetMessageArgType = string +type StatusGetMessageRetType = string + // Status The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). type Status struct { // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. // Can be cast to int32 without loss of precision. - Code *int64 `json:"code,omitempty"` + Code StatusGetCodeAttributeType `json:"code,omitempty"` // A list of messages that carry the error details. There is a common set of message types for APIs to use. - Details *[]GoogleProtobufAny `json:"details,omitempty"` + Details StatusGetDetailsAttributeType `json:"details,omitempty"` // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - Message *string `json:"message,omitempty"` + Message StatusGetMessageAttributeType `json:"message,omitempty"` } // NewStatus instantiates a new Status object @@ -46,111 +107,84 @@ func NewStatusWithDefaults() *Status { } // GetCode returns the Code field value if set, zero value otherwise. -func (o *Status) GetCode() *int64 { - if o == nil || IsNil(o.Code) { - var ret *int64 - return ret - } - return o.Code +func (o *Status) GetCode() (res StatusGetCodeRetType) { + res, _ = o.GetCodeOk() + return } // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Status) GetCodeOk() (*int64, bool) { - if o == nil || IsNil(o.Code) { - return nil, false - } - return o.Code, true +func (o *Status) GetCodeOk() (ret StatusGetCodeRetType, ok bool) { + return getStatusGetCodeAttributeTypeOk(o.Code) } // HasCode returns a boolean if a field has been set. func (o *Status) HasCode() bool { - if o != nil && !IsNil(o.Code) { - return true - } - - return false + _, ok := o.GetCodeOk() + return ok } // SetCode gets a reference to the given int64 and assigns it to the Code field. -func (o *Status) SetCode(v *int64) { - o.Code = v +func (o *Status) SetCode(v StatusGetCodeRetType) { + setStatusGetCodeAttributeType(&o.Code, v) } // GetDetails returns the Details field value if set, zero value otherwise. -func (o *Status) GetDetails() *[]GoogleProtobufAny { - if o == nil || IsNil(o.Details) { - var ret *[]GoogleProtobufAny - return ret - } - return o.Details +func (o *Status) GetDetails() (res StatusGetDetailsRetType) { + 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 *Status) GetDetailsOk() (*[]GoogleProtobufAny, bool) { - if o == nil || IsNil(o.Details) { - return nil, false - } - return o.Details, true +func (o *Status) GetDetailsOk() (ret StatusGetDetailsRetType, ok bool) { + return getStatusGetDetailsAttributeTypeOk(o.Details) } // HasDetails returns a boolean if a field has been set. func (o *Status) HasDetails() bool { - if o != nil && !IsNil(o.Details) { - return true - } - - return false + _, ok := o.GetDetailsOk() + return ok } // SetDetails gets a reference to the given []GoogleProtobufAny and assigns it to the Details field. -func (o *Status) SetDetails(v *[]GoogleProtobufAny) { - o.Details = v +func (o *Status) SetDetails(v StatusGetDetailsRetType) { + setStatusGetDetailsAttributeType(&o.Details, v) } // GetMessage returns the Message field value if set, zero value otherwise. -func (o *Status) GetMessage() *string { - if o == nil || IsNil(o.Message) { - var ret *string - return ret - } - return o.Message +func (o *Status) GetMessage() (res StatusGetMessageRetType) { + res, _ = o.GetMessageOk() + return } // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Status) GetMessageOk() (*string, bool) { - if o == nil || IsNil(o.Message) { - return nil, false - } - return o.Message, true +func (o *Status) GetMessageOk() (ret StatusGetMessageRetType, ok bool) { + return getStatusGetMessageAttributeTypeOk(o.Message) } // HasMessage returns a boolean if a field has been set. func (o *Status) HasMessage() bool { - if o != nil && !IsNil(o.Message) { - return true - } - - return false + _, ok := o.GetMessageOk() + return ok } // SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *Status) SetMessage(v *string) { - o.Message = v +func (o *Status) SetMessage(v StatusGetMessageRetType) { + setStatusGetMessageAttributeType(&o.Message, v) } func (o Status) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if !IsNil(o.Code) { - toSerialize["code"] = o.Code + if val, ok := getStatusGetCodeAttributeTypeOk(o.Code); ok { + toSerialize["Code"] = val } - if !IsNil(o.Details) { - toSerialize["details"] = o.Details + if val, ok := getStatusGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val } - if !IsNil(o.Message) { - toSerialize["message"] = o.Message + if val, ok := getStatusGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val } return toSerialize, nil } diff --git a/services/certificates/utils.go b/services/certificates/utils.go index 585f513e3..1c911ae83 100644 --- a/services/certificates/utils.go +++ b/services/certificates/utils.go @@ -40,6 +40,29 @@ func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. func PtrTime(v time.Time) *time.Time { return &v } +type NullableValue[T any] struct { + value *T + isSet bool +} + +func (v NullableValue[T]) Get() *T { + return v.value +} + +func (v *NullableValue[T]) Set(val *T) { + v.value = val + v.isSet = true +} + +func (v NullableValue[T]) IsSet() bool { + return v.isSet +} + +func (v *NullableValue[T]) Unset() { + v.value = nil + v.isSet = false +} + type NullableBool struct { value *bool isSet bool @@ -333,6 +356,9 @@ func IsNil(i interface{}) bool { if i == nil { return true } + if t, ok := i.(interface{ IsSet() bool }); ok { + return !t.IsSet() + } switch reflect.TypeOf(i).Kind() { case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: return reflect.ValueOf(i).IsNil()