bunnyshell.com/sdk@v0.16.0/model_validate_source_git.go (about)

     1  /*
     2  API Bunnyshell Environments
     3  
     4  Interact with Bunnyshell Platform
     5  
     6  API version: 1.1.0
     7  Contact: osi+support@bunnyshell.com
     8  */
     9  
    10  // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
    11  
    12  package sdk
    13  
    14  import (
    15  	"encoding/json"
    16  )
    17  
    18  // checks if the ValidateSourceGit type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &ValidateSourceGit{}
    20  
    21  // ValidateSourceGit struct for ValidateSourceGit
    22  type ValidateSourceGit struct {
    23  	Type               *string `json:"type,omitempty"`
    24  	Url                string  `json:"url"`
    25  	Ref                string  `json:"ref"`
    26  	DirPath            string  `json:"dirPath"`
    27  	OrganizationId     string  `json:"organizationId"`
    28  	ValidateComponents *bool   `json:"validateComponents,omitempty"`
    29  }
    30  
    31  // NewValidateSourceGit instantiates a new ValidateSourceGit object
    32  // This constructor will assign default values to properties that have it defined,
    33  // and makes sure properties required by API are set, but the set of arguments
    34  // will change when the set of required properties is changed
    35  func NewValidateSourceGit(url string, ref string, dirPath string, organizationId string) *ValidateSourceGit {
    36  	this := ValidateSourceGit{}
    37  	var type_ string = "git"
    38  	this.Type = &type_
    39  	this.Url = url
    40  	this.Ref = ref
    41  	this.DirPath = dirPath
    42  	this.OrganizationId = organizationId
    43  	return &this
    44  }
    45  
    46  // NewValidateSourceGitWithDefaults instantiates a new ValidateSourceGit object
    47  // This constructor will only assign default values to properties that have it defined,
    48  // but it doesn't guarantee that properties required by API are set
    49  func NewValidateSourceGitWithDefaults() *ValidateSourceGit {
    50  	this := ValidateSourceGit{}
    51  	var type_ string = "git"
    52  	this.Type = &type_
    53  	return &this
    54  }
    55  
    56  // GetType returns the Type field value if set, zero value otherwise.
    57  func (o *ValidateSourceGit) GetType() string {
    58  	if o == nil || IsNil(o.Type) {
    59  		var ret string
    60  		return ret
    61  	}
    62  	return *o.Type
    63  }
    64  
    65  // GetTypeOk returns a tuple with the Type field value if set, nil otherwise
    66  // and a boolean to check if the value has been set.
    67  func (o *ValidateSourceGit) GetTypeOk() (*string, bool) {
    68  	if o == nil || IsNil(o.Type) {
    69  		return nil, false
    70  	}
    71  	return o.Type, true
    72  }
    73  
    74  // HasType returns a boolean if a field has been set.
    75  func (o *ValidateSourceGit) HasType() bool {
    76  	if o != nil && !IsNil(o.Type) {
    77  		return true
    78  	}
    79  
    80  	return false
    81  }
    82  
    83  // SetType gets a reference to the given string and assigns it to the Type field.
    84  func (o *ValidateSourceGit) SetType(v string) {
    85  	o.Type = &v
    86  }
    87  
    88  // GetUrl returns the Url field value
    89  func (o *ValidateSourceGit) GetUrl() string {
    90  	if o == nil {
    91  		var ret string
    92  		return ret
    93  	}
    94  
    95  	return o.Url
    96  }
    97  
    98  // GetUrlOk returns a tuple with the Url field value
    99  // and a boolean to check if the value has been set.
   100  func (o *ValidateSourceGit) GetUrlOk() (*string, bool) {
   101  	if o == nil {
   102  		return nil, false
   103  	}
   104  	return &o.Url, true
   105  }
   106  
   107  // SetUrl sets field value
   108  func (o *ValidateSourceGit) SetUrl(v string) {
   109  	o.Url = v
   110  }
   111  
   112  // GetRef returns the Ref field value
   113  func (o *ValidateSourceGit) GetRef() string {
   114  	if o == nil {
   115  		var ret string
   116  		return ret
   117  	}
   118  
   119  	return o.Ref
   120  }
   121  
   122  // GetRefOk returns a tuple with the Ref field value
   123  // and a boolean to check if the value has been set.
   124  func (o *ValidateSourceGit) GetRefOk() (*string, bool) {
   125  	if o == nil {
   126  		return nil, false
   127  	}
   128  	return &o.Ref, true
   129  }
   130  
   131  // SetRef sets field value
   132  func (o *ValidateSourceGit) SetRef(v string) {
   133  	o.Ref = v
   134  }
   135  
   136  // GetDirPath returns the DirPath field value
   137  func (o *ValidateSourceGit) GetDirPath() string {
   138  	if o == nil {
   139  		var ret string
   140  		return ret
   141  	}
   142  
   143  	return o.DirPath
   144  }
   145  
   146  // GetDirPathOk returns a tuple with the DirPath field value
   147  // and a boolean to check if the value has been set.
   148  func (o *ValidateSourceGit) GetDirPathOk() (*string, bool) {
   149  	if o == nil {
   150  		return nil, false
   151  	}
   152  	return &o.DirPath, true
   153  }
   154  
   155  // SetDirPath sets field value
   156  func (o *ValidateSourceGit) SetDirPath(v string) {
   157  	o.DirPath = v
   158  }
   159  
   160  // GetOrganizationId returns the OrganizationId field value
   161  func (o *ValidateSourceGit) GetOrganizationId() string {
   162  	if o == nil {
   163  		var ret string
   164  		return ret
   165  	}
   166  
   167  	return o.OrganizationId
   168  }
   169  
   170  // GetOrganizationIdOk returns a tuple with the OrganizationId field value
   171  // and a boolean to check if the value has been set.
   172  func (o *ValidateSourceGit) GetOrganizationIdOk() (*string, bool) {
   173  	if o == nil {
   174  		return nil, false
   175  	}
   176  	return &o.OrganizationId, true
   177  }
   178  
   179  // SetOrganizationId sets field value
   180  func (o *ValidateSourceGit) SetOrganizationId(v string) {
   181  	o.OrganizationId = v
   182  }
   183  
   184  // GetValidateComponents returns the ValidateComponents field value if set, zero value otherwise.
   185  func (o *ValidateSourceGit) GetValidateComponents() bool {
   186  	if o == nil || IsNil(o.ValidateComponents) {
   187  		var ret bool
   188  		return ret
   189  	}
   190  	return *o.ValidateComponents
   191  }
   192  
   193  // GetValidateComponentsOk returns a tuple with the ValidateComponents field value if set, nil otherwise
   194  // and a boolean to check if the value has been set.
   195  func (o *ValidateSourceGit) GetValidateComponentsOk() (*bool, bool) {
   196  	if o == nil || IsNil(o.ValidateComponents) {
   197  		return nil, false
   198  	}
   199  	return o.ValidateComponents, true
   200  }
   201  
   202  // HasValidateComponents returns a boolean if a field has been set.
   203  func (o *ValidateSourceGit) HasValidateComponents() bool {
   204  	if o != nil && !IsNil(o.ValidateComponents) {
   205  		return true
   206  	}
   207  
   208  	return false
   209  }
   210  
   211  // SetValidateComponents gets a reference to the given bool and assigns it to the ValidateComponents field.
   212  func (o *ValidateSourceGit) SetValidateComponents(v bool) {
   213  	o.ValidateComponents = &v
   214  }
   215  
   216  func (o ValidateSourceGit) MarshalJSON() ([]byte, error) {
   217  	toSerialize, err := o.ToMap()
   218  	if err != nil {
   219  		return []byte{}, err
   220  	}
   221  	return json.Marshal(toSerialize)
   222  }
   223  
   224  func (o ValidateSourceGit) ToMap() (map[string]interface{}, error) {
   225  	toSerialize := map[string]interface{}{}
   226  	if !IsNil(o.Type) {
   227  		toSerialize["type"] = o.Type
   228  	}
   229  	toSerialize["url"] = o.Url
   230  	toSerialize["ref"] = o.Ref
   231  	toSerialize["dirPath"] = o.DirPath
   232  	toSerialize["organizationId"] = o.OrganizationId
   233  	if !IsNil(o.ValidateComponents) {
   234  		toSerialize["validateComponents"] = o.ValidateComponents
   235  	}
   236  	return toSerialize, nil
   237  }
   238  
   239  type NullableValidateSourceGit struct {
   240  	value *ValidateSourceGit
   241  	isSet bool
   242  }
   243  
   244  func (v NullableValidateSourceGit) Get() *ValidateSourceGit {
   245  	return v.value
   246  }
   247  
   248  func (v *NullableValidateSourceGit) Set(val *ValidateSourceGit) {
   249  	v.value = val
   250  	v.isSet = true
   251  }
   252  
   253  func (v NullableValidateSourceGit) IsSet() bool {
   254  	return v.isSet
   255  }
   256  
   257  func (v *NullableValidateSourceGit) Unset() {
   258  	v.value = nil
   259  	v.isSet = false
   260  }
   261  
   262  func NewNullableValidateSourceGit(val *ValidateSourceGit) *NullableValidateSourceGit {
   263  	return &NullableValidateSourceGit{value: val, isSet: true}
   264  }
   265  
   266  func (v NullableValidateSourceGit) MarshalJSON() ([]byte, error) {
   267  	return json.Marshal(v.value)
   268  }
   269  
   270  func (v *NullableValidateSourceGit) UnmarshalJSON(src []byte) error {
   271  	v.isSet = true
   272  	return json.Unmarshal(src, &v.value)
   273  }