mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
269 lines
6.8 KiB
Go
269 lines
6.8 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 GitPushReq type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitPushReq{}
|
|
|
|
// GitPushReq struct for GitPushReq
|
|
type GitPushReq struct {
|
|
// Branch to advance; empty means \"main\". A fresh branch that is the repo's first also becomes HEAD.
|
|
Branch *string `json:"branch,omitempty"`
|
|
// Files are added to or overwritten on the branch tip — files already there and not listed SURVIVE. At least one, at most 5000, 32 MiB each.
|
|
Files []GitPushFile `json:"files,omitempty"`
|
|
// Message is the commit message; empty gets a generated one.
|
|
Message *string `json:"message,omitempty"`
|
|
// Name is the repo to push into, from the :name path segment. It is CREATED on first push if it does not exist.
|
|
Name *string `json:"name,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitPushReq GitPushReq
|
|
|
|
// NewGitPushReq instantiates a new GitPushReq object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// 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 NewGitPushReq() *GitPushReq {
|
|
this := GitPushReq{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitPushReqWithDefaults instantiates a new GitPushReq object
|
|
// This 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 NewGitPushReqWithDefaults() *GitPushReq {
|
|
this := GitPushReq{}
|
|
return &this
|
|
}
|
|
|
|
// GetBranch returns the Branch field value if set, zero value otherwise.
|
|
func (o *GitPushReq) 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 *GitPushReq) 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 *GitPushReq) 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 *GitPushReq) SetBranch(v string) {
|
|
o.Branch = &v
|
|
}
|
|
|
|
// GetFiles returns the Files field value if set, zero value otherwise.
|
|
func (o *GitPushReq) GetFiles() []GitPushFile {
|
|
if o == nil || IsNil(o.Files) {
|
|
var ret []GitPushFile
|
|
return ret
|
|
}
|
|
return o.Files
|
|
}
|
|
|
|
// GetFilesOk returns a tuple with the Files field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitPushReq) GetFilesOk() ([]GitPushFile, bool) {
|
|
if o == nil || IsNil(o.Files) {
|
|
return nil, false
|
|
}
|
|
return o.Files, true
|
|
}
|
|
|
|
// HasFiles returns a boolean if a field has been set.
|
|
func (o *GitPushReq) HasFiles() bool {
|
|
if o != nil && !IsNil(o.Files) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFiles gets a reference to the given []GitPushFile and assigns it to the Files field.
|
|
func (o *GitPushReq) SetFiles(v []GitPushFile) {
|
|
o.Files = v
|
|
}
|
|
|
|
// GetMessage returns the Message field value if set, zero value otherwise.
|
|
func (o *GitPushReq) GetMessage() string {
|
|
if o == nil || IsNil(o.Message) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Message
|
|
}
|
|
|
|
// 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 *GitPushReq) GetMessageOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Message) {
|
|
return nil, false
|
|
}
|
|
return o.Message, true
|
|
}
|
|
|
|
// HasMessage returns a boolean if a field has been set.
|
|
func (o *GitPushReq) HasMessage() bool {
|
|
if o != nil && !IsNil(o.Message) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMessage gets a reference to the given string and assigns it to the Message field.
|
|
func (o *GitPushReq) SetMessage(v string) {
|
|
o.Message = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *GitPushReq) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// 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 *GitPushReq) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *GitPushReq) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *GitPushReq) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
func (o GitPushReq) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitPushReq) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Branch) {
|
|
toSerialize["branch"] = o.Branch
|
|
}
|
|
if !IsNil(o.Files) {
|
|
toSerialize["files"] = o.Files
|
|
}
|
|
if !IsNil(o.Message) {
|
|
toSerialize["message"] = o.Message
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitPushReq) UnmarshalJSON(data []byte) (err error) {
|
|
varGitPushReq := _GitPushReq{}
|
|
|
|
err = json.Unmarshal(data, &varGitPushReq)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitPushReq(varGitPushReq)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "branch")
|
|
delete(additionalProperties, "files")
|
|
delete(additionalProperties, "message")
|
|
delete(additionalProperties, "name")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitPushReq struct {
|
|
value *GitPushReq
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitPushReq) Get() *GitPushReq {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitPushReq) Set(val *GitPushReq) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitPushReq) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitPushReq) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitPushReq(val *GitPushReq) *NullableGitPushReq {
|
|
return &NullableGitPushReq{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitPushReq) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitPushReq) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|