mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.7 KiB
Go
269 lines
6.7 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the GitPushResp type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitPushResp{}
|
|
|
|
// GitPushResp struct for GitPushResp
|
|
type GitPushResp struct {
|
|
// Branch is the branch that was advanced, resolved (never empty).
|
|
Branch *string `json:"branch,omitempty"`
|
|
// CloneURL is the repo's HTTPS remote.
|
|
CloneUrl *string `json:"cloneUrl,omitempty"`
|
|
// Commit is the new commit's full hash.
|
|
Commit *string `json:"commit,omitempty"`
|
|
// SSHURL is the repo's scp-style SSH remote.
|
|
SshUrl *string `json:"sshUrl,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitPushResp GitPushResp
|
|
|
|
// NewGitPushResp instantiates a new GitPushResp object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewGitPushResp() *GitPushResp {
|
|
this := GitPushResp{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitPushRespWithDefaults instantiates a new GitPushResp object
|
|
// This 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 NewGitPushRespWithDefaults() *GitPushResp {
|
|
this := GitPushResp{}
|
|
return &this
|
|
}
|
|
|
|
// GetBranch returns the Branch field value if set, zero value otherwise.
|
|
func (o *GitPushResp) GetBranch() string {
|
|
if o == nil || IsNil(o.Branch) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Branch
|
|
}
|
|
|
|
// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitPushResp) GetBranchOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Branch) {
|
|
return nil, false
|
|
}
|
|
return o.Branch, true
|
|
}
|
|
|
|
// HasBranch returns a boolean if a field has been set.
|
|
func (o *GitPushResp) HasBranch() bool {
|
|
if o != nil && !IsNil(o.Branch) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetBranch gets a reference to the given string and assigns it to the Branch field.
|
|
func (o *GitPushResp) SetBranch(v string) {
|
|
o.Branch = &v
|
|
}
|
|
|
|
// GetCloneUrl returns the CloneUrl field value if set, zero value otherwise.
|
|
func (o *GitPushResp) GetCloneUrl() string {
|
|
if o == nil || IsNil(o.CloneUrl) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CloneUrl
|
|
}
|
|
|
|
// GetCloneUrlOk returns a tuple with the CloneUrl field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitPushResp) GetCloneUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CloneUrl) {
|
|
return nil, false
|
|
}
|
|
return o.CloneUrl, true
|
|
}
|
|
|
|
// HasCloneUrl returns a boolean if a field has been set.
|
|
func (o *GitPushResp) HasCloneUrl() bool {
|
|
if o != nil && !IsNil(o.CloneUrl) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCloneUrl gets a reference to the given string and assigns it to the CloneUrl field.
|
|
func (o *GitPushResp) SetCloneUrl(v string) {
|
|
o.CloneUrl = &v
|
|
}
|
|
|
|
// GetCommit returns the Commit field value if set, zero value otherwise.
|
|
func (o *GitPushResp) GetCommit() string {
|
|
if o == nil || IsNil(o.Commit) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Commit
|
|
}
|
|
|
|
// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitPushResp) GetCommitOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Commit) {
|
|
return nil, false
|
|
}
|
|
return o.Commit, true
|
|
}
|
|
|
|
// HasCommit returns a boolean if a field has been set.
|
|
func (o *GitPushResp) HasCommit() bool {
|
|
if o != nil && !IsNil(o.Commit) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCommit gets a reference to the given string and assigns it to the Commit field.
|
|
func (o *GitPushResp) SetCommit(v string) {
|
|
o.Commit = &v
|
|
}
|
|
|
|
// GetSshUrl returns the SshUrl field value if set, zero value otherwise.
|
|
func (o *GitPushResp) GetSshUrl() string {
|
|
if o == nil || IsNil(o.SshUrl) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.SshUrl
|
|
}
|
|
|
|
// GetSshUrlOk returns a tuple with the SshUrl field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitPushResp) GetSshUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.SshUrl) {
|
|
return nil, false
|
|
}
|
|
return o.SshUrl, true
|
|
}
|
|
|
|
// HasSshUrl returns a boolean if a field has been set.
|
|
func (o *GitPushResp) HasSshUrl() bool {
|
|
if o != nil && !IsNil(o.SshUrl) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSshUrl gets a reference to the given string and assigns it to the SshUrl field.
|
|
func (o *GitPushResp) SetSshUrl(v string) {
|
|
o.SshUrl = &v
|
|
}
|
|
|
|
func (o GitPushResp) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitPushResp) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Branch) {
|
|
toSerialize["branch"] = o.Branch
|
|
}
|
|
if !IsNil(o.CloneUrl) {
|
|
toSerialize["cloneUrl"] = o.CloneUrl
|
|
}
|
|
if !IsNil(o.Commit) {
|
|
toSerialize["commit"] = o.Commit
|
|
}
|
|
if !IsNil(o.SshUrl) {
|
|
toSerialize["sshUrl"] = o.SshUrl
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitPushResp) UnmarshalJSON(data []byte) (err error) {
|
|
varGitPushResp := _GitPushResp{}
|
|
|
|
err = json.Unmarshal(data, &varGitPushResp)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitPushResp(varGitPushResp)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "branch")
|
|
delete(additionalProperties, "cloneUrl")
|
|
delete(additionalProperties, "commit")
|
|
delete(additionalProperties, "sshUrl")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitPushResp struct {
|
|
value *GitPushResp
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitPushResp) Get() *GitPushResp {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitPushResp) Set(val *GitPushResp) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitPushResp) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitPushResp) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitPushResp(val *GitPushResp) *NullableGitPushResp {
|
|
return &NullableGitPushResp{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitPushResp) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitPushResp) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|