bunnyshell.com/sdk@v0.16.0/model_sync_path_item.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 SyncPathItem type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &SyncPathItem{}
    20  
    21  // SyncPathItem struct for SyncPathItem
    22  type SyncPathItem struct {
    23  	// The local path on the host os to sync from.
    24  	LocalPath NullableString `json:"localPath,omitempty"`
    25  	// The remote path on the container to sync to.
    26  	RemotePath *string `json:"remotePath,omitempty"`
    27  }
    28  
    29  // NewSyncPathItem instantiates a new SyncPathItem object
    30  // This constructor will assign default values to properties that have it defined,
    31  // and makes sure properties required by API are set, but the set of arguments
    32  // will change when the set of required properties is changed
    33  func NewSyncPathItem() *SyncPathItem {
    34  	this := SyncPathItem{}
    35  	return &this
    36  }
    37  
    38  // NewSyncPathItemWithDefaults instantiates a new SyncPathItem object
    39  // This constructor will only assign default values to properties that have it defined,
    40  // but it doesn't guarantee that properties required by API are set
    41  func NewSyncPathItemWithDefaults() *SyncPathItem {
    42  	this := SyncPathItem{}
    43  	return &this
    44  }
    45  
    46  // GetLocalPath returns the LocalPath field value if set, zero value otherwise (both if not set or set to explicit null).
    47  func (o *SyncPathItem) GetLocalPath() string {
    48  	if o == nil || IsNil(o.LocalPath.Get()) {
    49  		var ret string
    50  		return ret
    51  	}
    52  	return *o.LocalPath.Get()
    53  }
    54  
    55  // GetLocalPathOk returns a tuple with the LocalPath field value if set, nil otherwise
    56  // and a boolean to check if the value has been set.
    57  // NOTE: If the value is an explicit nil, `nil, true` will be returned
    58  func (o *SyncPathItem) GetLocalPathOk() (*string, bool) {
    59  	if o == nil {
    60  		return nil, false
    61  	}
    62  	return o.LocalPath.Get(), o.LocalPath.IsSet()
    63  }
    64  
    65  // HasLocalPath returns a boolean if a field has been set.
    66  func (o *SyncPathItem) HasLocalPath() bool {
    67  	if o != nil && o.LocalPath.IsSet() {
    68  		return true
    69  	}
    70  
    71  	return false
    72  }
    73  
    74  // SetLocalPath gets a reference to the given NullableString and assigns it to the LocalPath field.
    75  func (o *SyncPathItem) SetLocalPath(v string) {
    76  	o.LocalPath.Set(&v)
    77  }
    78  
    79  // SetLocalPathNil sets the value for LocalPath to be an explicit nil
    80  func (o *SyncPathItem) SetLocalPathNil() {
    81  	o.LocalPath.Set(nil)
    82  }
    83  
    84  // UnsetLocalPath ensures that no value is present for LocalPath, not even an explicit nil
    85  func (o *SyncPathItem) UnsetLocalPath() {
    86  	o.LocalPath.Unset()
    87  }
    88  
    89  // GetRemotePath returns the RemotePath field value if set, zero value otherwise.
    90  func (o *SyncPathItem) GetRemotePath() string {
    91  	if o == nil || IsNil(o.RemotePath) {
    92  		var ret string
    93  		return ret
    94  	}
    95  	return *o.RemotePath
    96  }
    97  
    98  // GetRemotePathOk returns a tuple with the RemotePath field value if set, nil otherwise
    99  // and a boolean to check if the value has been set.
   100  func (o *SyncPathItem) GetRemotePathOk() (*string, bool) {
   101  	if o == nil || IsNil(o.RemotePath) {
   102  		return nil, false
   103  	}
   104  	return o.RemotePath, true
   105  }
   106  
   107  // HasRemotePath returns a boolean if a field has been set.
   108  func (o *SyncPathItem) HasRemotePath() bool {
   109  	if o != nil && !IsNil(o.RemotePath) {
   110  		return true
   111  	}
   112  
   113  	return false
   114  }
   115  
   116  // SetRemotePath gets a reference to the given string and assigns it to the RemotePath field.
   117  func (o *SyncPathItem) SetRemotePath(v string) {
   118  	o.RemotePath = &v
   119  }
   120  
   121  func (o SyncPathItem) MarshalJSON() ([]byte, error) {
   122  	toSerialize, err := o.ToMap()
   123  	if err != nil {
   124  		return []byte{}, err
   125  	}
   126  	return json.Marshal(toSerialize)
   127  }
   128  
   129  func (o SyncPathItem) ToMap() (map[string]interface{}, error) {
   130  	toSerialize := map[string]interface{}{}
   131  	if o.LocalPath.IsSet() {
   132  		toSerialize["localPath"] = o.LocalPath.Get()
   133  	}
   134  	if !IsNil(o.RemotePath) {
   135  		toSerialize["remotePath"] = o.RemotePath
   136  	}
   137  	return toSerialize, nil
   138  }
   139  
   140  type NullableSyncPathItem struct {
   141  	value *SyncPathItem
   142  	isSet bool
   143  }
   144  
   145  func (v NullableSyncPathItem) Get() *SyncPathItem {
   146  	return v.value
   147  }
   148  
   149  func (v *NullableSyncPathItem) Set(val *SyncPathItem) {
   150  	v.value = val
   151  	v.isSet = true
   152  }
   153  
   154  func (v NullableSyncPathItem) IsSet() bool {
   155  	return v.isSet
   156  }
   157  
   158  func (v *NullableSyncPathItem) Unset() {
   159  	v.value = nil
   160  	v.isSet = false
   161  }
   162  
   163  func NewNullableSyncPathItem(val *SyncPathItem) *NullableSyncPathItem {
   164  	return &NullableSyncPathItem{value: val, isSet: true}
   165  }
   166  
   167  func (v NullableSyncPathItem) MarshalJSON() ([]byte, error) {
   168  	return json.Marshal(v.value)
   169  }
   170  
   171  func (v *NullableSyncPathItem) UnmarshalJSON(src []byte) error {
   172  	v.isSet = true
   173  	return json.Unmarshal(src, &v.value)
   174  }