bunnyshell.com/sdk@v0.16.0/model_validate_source_string.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 ValidateSourceString type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &ValidateSourceString{}
    20  
    21  // ValidateSourceString struct for ValidateSourceString
    22  type ValidateSourceString struct {
    23  	Type                      *string        `json:"type,omitempty"`
    24  	BunnyshellYaml            string         `json:"bunnyshellYaml"`
    25  	TemplateYaml              string         `json:"templateYaml"`
    26  	ValidateComponents        *bool          `json:"validateComponents,omitempty"`
    27  	ValidateForOrganizationId NullableString `json:"validateForOrganizationId,omitempty"`
    28  }
    29  
    30  // NewValidateSourceString instantiates a new ValidateSourceString object
    31  // This constructor will assign default values to properties that have it defined,
    32  // and makes sure properties required by API are set, but the set of arguments
    33  // will change when the set of required properties is changed
    34  func NewValidateSourceString(bunnyshellYaml string, templateYaml string) *ValidateSourceString {
    35  	this := ValidateSourceString{}
    36  	var type_ string = "string"
    37  	this.Type = &type_
    38  	this.BunnyshellYaml = bunnyshellYaml
    39  	this.TemplateYaml = templateYaml
    40  	return &this
    41  }
    42  
    43  // NewValidateSourceStringWithDefaults instantiates a new ValidateSourceString object
    44  // This constructor will only assign default values to properties that have it defined,
    45  // but it doesn't guarantee that properties required by API are set
    46  func NewValidateSourceStringWithDefaults() *ValidateSourceString {
    47  	this := ValidateSourceString{}
    48  	var type_ string = "string"
    49  	this.Type = &type_
    50  	return &this
    51  }
    52  
    53  // GetType returns the Type field value if set, zero value otherwise.
    54  func (o *ValidateSourceString) GetType() string {
    55  	if o == nil || IsNil(o.Type) {
    56  		var ret string
    57  		return ret
    58  	}
    59  	return *o.Type
    60  }
    61  
    62  // GetTypeOk returns a tuple with the Type field value if set, nil otherwise
    63  // and a boolean to check if the value has been set.
    64  func (o *ValidateSourceString) GetTypeOk() (*string, bool) {
    65  	if o == nil || IsNil(o.Type) {
    66  		return nil, false
    67  	}
    68  	return o.Type, true
    69  }
    70  
    71  // HasType returns a boolean if a field has been set.
    72  func (o *ValidateSourceString) HasType() bool {
    73  	if o != nil && !IsNil(o.Type) {
    74  		return true
    75  	}
    76  
    77  	return false
    78  }
    79  
    80  // SetType gets a reference to the given string and assigns it to the Type field.
    81  func (o *ValidateSourceString) SetType(v string) {
    82  	o.Type = &v
    83  }
    84  
    85  // GetBunnyshellYaml returns the BunnyshellYaml field value
    86  func (o *ValidateSourceString) GetBunnyshellYaml() string {
    87  	if o == nil {
    88  		var ret string
    89  		return ret
    90  	}
    91  
    92  	return o.BunnyshellYaml
    93  }
    94  
    95  // GetBunnyshellYamlOk returns a tuple with the BunnyshellYaml field value
    96  // and a boolean to check if the value has been set.
    97  func (o *ValidateSourceString) GetBunnyshellYamlOk() (*string, bool) {
    98  	if o == nil {
    99  		return nil, false
   100  	}
   101  	return &o.BunnyshellYaml, true
   102  }
   103  
   104  // SetBunnyshellYaml sets field value
   105  func (o *ValidateSourceString) SetBunnyshellYaml(v string) {
   106  	o.BunnyshellYaml = v
   107  }
   108  
   109  // GetTemplateYaml returns the TemplateYaml field value
   110  func (o *ValidateSourceString) GetTemplateYaml() string {
   111  	if o == nil {
   112  		var ret string
   113  		return ret
   114  	}
   115  
   116  	return o.TemplateYaml
   117  }
   118  
   119  // GetTemplateYamlOk returns a tuple with the TemplateYaml field value
   120  // and a boolean to check if the value has been set.
   121  func (o *ValidateSourceString) GetTemplateYamlOk() (*string, bool) {
   122  	if o == nil {
   123  		return nil, false
   124  	}
   125  	return &o.TemplateYaml, true
   126  }
   127  
   128  // SetTemplateYaml sets field value
   129  func (o *ValidateSourceString) SetTemplateYaml(v string) {
   130  	o.TemplateYaml = v
   131  }
   132  
   133  // GetValidateComponents returns the ValidateComponents field value if set, zero value otherwise.
   134  func (o *ValidateSourceString) GetValidateComponents() bool {
   135  	if o == nil || IsNil(o.ValidateComponents) {
   136  		var ret bool
   137  		return ret
   138  	}
   139  	return *o.ValidateComponents
   140  }
   141  
   142  // GetValidateComponentsOk returns a tuple with the ValidateComponents field value if set, nil otherwise
   143  // and a boolean to check if the value has been set.
   144  func (o *ValidateSourceString) GetValidateComponentsOk() (*bool, bool) {
   145  	if o == nil || IsNil(o.ValidateComponents) {
   146  		return nil, false
   147  	}
   148  	return o.ValidateComponents, true
   149  }
   150  
   151  // HasValidateComponents returns a boolean if a field has been set.
   152  func (o *ValidateSourceString) HasValidateComponents() bool {
   153  	if o != nil && !IsNil(o.ValidateComponents) {
   154  		return true
   155  	}
   156  
   157  	return false
   158  }
   159  
   160  // SetValidateComponents gets a reference to the given bool and assigns it to the ValidateComponents field.
   161  func (o *ValidateSourceString) SetValidateComponents(v bool) {
   162  	o.ValidateComponents = &v
   163  }
   164  
   165  // GetValidateForOrganizationId returns the ValidateForOrganizationId field value if set, zero value otherwise (both if not set or set to explicit null).
   166  func (o *ValidateSourceString) GetValidateForOrganizationId() string {
   167  	if o == nil || IsNil(o.ValidateForOrganizationId.Get()) {
   168  		var ret string
   169  		return ret
   170  	}
   171  	return *o.ValidateForOrganizationId.Get()
   172  }
   173  
   174  // GetValidateForOrganizationIdOk returns a tuple with the ValidateForOrganizationId field value if set, nil otherwise
   175  // and a boolean to check if the value has been set.
   176  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   177  func (o *ValidateSourceString) GetValidateForOrganizationIdOk() (*string, bool) {
   178  	if o == nil {
   179  		return nil, false
   180  	}
   181  	return o.ValidateForOrganizationId.Get(), o.ValidateForOrganizationId.IsSet()
   182  }
   183  
   184  // HasValidateForOrganizationId returns a boolean if a field has been set.
   185  func (o *ValidateSourceString) HasValidateForOrganizationId() bool {
   186  	if o != nil && o.ValidateForOrganizationId.IsSet() {
   187  		return true
   188  	}
   189  
   190  	return false
   191  }
   192  
   193  // SetValidateForOrganizationId gets a reference to the given NullableString and assigns it to the ValidateForOrganizationId field.
   194  func (o *ValidateSourceString) SetValidateForOrganizationId(v string) {
   195  	o.ValidateForOrganizationId.Set(&v)
   196  }
   197  
   198  // SetValidateForOrganizationIdNil sets the value for ValidateForOrganizationId to be an explicit nil
   199  func (o *ValidateSourceString) SetValidateForOrganizationIdNil() {
   200  	o.ValidateForOrganizationId.Set(nil)
   201  }
   202  
   203  // UnsetValidateForOrganizationId ensures that no value is present for ValidateForOrganizationId, not even an explicit nil
   204  func (o *ValidateSourceString) UnsetValidateForOrganizationId() {
   205  	o.ValidateForOrganizationId.Unset()
   206  }
   207  
   208  func (o ValidateSourceString) MarshalJSON() ([]byte, error) {
   209  	toSerialize, err := o.ToMap()
   210  	if err != nil {
   211  		return []byte{}, err
   212  	}
   213  	return json.Marshal(toSerialize)
   214  }
   215  
   216  func (o ValidateSourceString) ToMap() (map[string]interface{}, error) {
   217  	toSerialize := map[string]interface{}{}
   218  	if !IsNil(o.Type) {
   219  		toSerialize["type"] = o.Type
   220  	}
   221  	toSerialize["bunnyshellYaml"] = o.BunnyshellYaml
   222  	toSerialize["templateYaml"] = o.TemplateYaml
   223  	if !IsNil(o.ValidateComponents) {
   224  		toSerialize["validateComponents"] = o.ValidateComponents
   225  	}
   226  	if o.ValidateForOrganizationId.IsSet() {
   227  		toSerialize["validateForOrganizationId"] = o.ValidateForOrganizationId.Get()
   228  	}
   229  	return toSerialize, nil
   230  }
   231  
   232  type NullableValidateSourceString struct {
   233  	value *ValidateSourceString
   234  	isSet bool
   235  }
   236  
   237  func (v NullableValidateSourceString) Get() *ValidateSourceString {
   238  	return v.value
   239  }
   240  
   241  func (v *NullableValidateSourceString) Set(val *ValidateSourceString) {
   242  	v.value = val
   243  	v.isSet = true
   244  }
   245  
   246  func (v NullableValidateSourceString) IsSet() bool {
   247  	return v.isSet
   248  }
   249  
   250  func (v *NullableValidateSourceString) Unset() {
   251  	v.value = nil
   252  	v.isSet = false
   253  }
   254  
   255  func NewNullableValidateSourceString(val *ValidateSourceString) *NullableValidateSourceString {
   256  	return &NullableValidateSourceString{value: val, isSet: true}
   257  }
   258  
   259  func (v NullableValidateSourceString) MarshalJSON() ([]byte, error) {
   260  	return json.Marshal(v.value)
   261  }
   262  
   263  func (v *NullableValidateSourceString) UnmarshalJSON(src []byte) error {
   264  	v.isSet = true
   265  	return json.Unmarshal(src, &v.value)
   266  }