github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_device_policy.go (about)

     1  /*
     2   * Cios Openapi
     3   *
     4   * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
     5   *
     6   * API version: 1.0.1
     7   */
     8  
     9  // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
    10  
    11  package cios
    12  
    13  import (
    14  	"encoding/json"
    15  )
    16  
    17  // DevicePolicy struct for DevicePolicy
    18  type DevicePolicy struct {
    19  	PolicyId string `json:"policy_id"`
    20  	ActivationKey *string `json:"activation_key,omitempty"`
    21  	ResourceOwnerId string `json:"resource_owner_id"`
    22  	CreatedAt string `json:"created_at"`
    23  	UpdatedAt string `json:"updated_at"`
    24  }
    25  
    26  // NewDevicePolicy instantiates a new DevicePolicy object
    27  // This constructor will assign default values to properties that have it defined,
    28  // and makes sure properties required by API are set, but the set of arguments
    29  // will change when the set of required properties is changed
    30  func NewDevicePolicy(policyId string, resourceOwnerId string, createdAt string, updatedAt string, ) *DevicePolicy {
    31  	this := DevicePolicy{}
    32  	this.PolicyId = policyId
    33  	this.ResourceOwnerId = resourceOwnerId
    34  	this.CreatedAt = createdAt
    35  	this.UpdatedAt = updatedAt
    36  	return &this
    37  }
    38  
    39  // NewDevicePolicyWithDefaults instantiates a new DevicePolicy object
    40  // This constructor will only assign default values to properties that have it defined,
    41  // but it doesn't guarantee that properties required by API are set
    42  func NewDevicePolicyWithDefaults() *DevicePolicy {
    43  	this := DevicePolicy{}
    44  	return &this
    45  }
    46  
    47  // GetPolicyId returns the PolicyId field value
    48  func (o *DevicePolicy) GetPolicyId() string {
    49  	if o == nil  {
    50  		var ret string
    51  		return ret
    52  	}
    53  
    54  	return o.PolicyId
    55  }
    56  
    57  // GetPolicyIdOk returns a tuple with the PolicyId field value
    58  // and a boolean to check if the value has been set.
    59  func (o *DevicePolicy) GetPolicyIdOk() (*string, bool) {
    60  	if o == nil  {
    61  		return nil, false
    62  	}
    63  	return &o.PolicyId, true
    64  }
    65  
    66  // SetPolicyId sets field value
    67  func (o *DevicePolicy) SetPolicyId(v string) {
    68  	o.PolicyId = v
    69  }
    70  
    71  // GetActivationKey returns the ActivationKey field value if set, zero value otherwise.
    72  func (o *DevicePolicy) GetActivationKey() string {
    73  	if o == nil || o.ActivationKey == nil {
    74  		var ret string
    75  		return ret
    76  	}
    77  	return *o.ActivationKey
    78  }
    79  
    80  // GetActivationKeyOk returns a tuple with the ActivationKey field value if set, nil otherwise
    81  // and a boolean to check if the value has been set.
    82  func (o *DevicePolicy) GetActivationKeyOk() (*string, bool) {
    83  	if o == nil || o.ActivationKey == nil {
    84  		return nil, false
    85  	}
    86  	return o.ActivationKey, true
    87  }
    88  
    89  // HasActivationKey returns a boolean if a field has been set.
    90  func (o *DevicePolicy) HasActivationKey() bool {
    91  	if o != nil && o.ActivationKey != nil {
    92  		return true
    93  	}
    94  
    95  	return false
    96  }
    97  
    98  // SetActivationKey gets a reference to the given string and assigns it to the ActivationKey field.
    99  func (o *DevicePolicy) SetActivationKey(v string) {
   100  	o.ActivationKey = &v
   101  }
   102  
   103  // GetResourceOwnerId returns the ResourceOwnerId field value
   104  func (o *DevicePolicy) GetResourceOwnerId() string {
   105  	if o == nil  {
   106  		var ret string
   107  		return ret
   108  	}
   109  
   110  	return o.ResourceOwnerId
   111  }
   112  
   113  // GetResourceOwnerIdOk returns a tuple with the ResourceOwnerId field value
   114  // and a boolean to check if the value has been set.
   115  func (o *DevicePolicy) GetResourceOwnerIdOk() (*string, bool) {
   116  	if o == nil  {
   117  		return nil, false
   118  	}
   119  	return &o.ResourceOwnerId, true
   120  }
   121  
   122  // SetResourceOwnerId sets field value
   123  func (o *DevicePolicy) SetResourceOwnerId(v string) {
   124  	o.ResourceOwnerId = v
   125  }
   126  
   127  // GetCreatedAt returns the CreatedAt field value
   128  func (o *DevicePolicy) GetCreatedAt() string {
   129  	if o == nil  {
   130  		var ret string
   131  		return ret
   132  	}
   133  
   134  	return o.CreatedAt
   135  }
   136  
   137  // GetCreatedAtOk returns a tuple with the CreatedAt field value
   138  // and a boolean to check if the value has been set.
   139  func (o *DevicePolicy) GetCreatedAtOk() (*string, bool) {
   140  	if o == nil  {
   141  		return nil, false
   142  	}
   143  	return &o.CreatedAt, true
   144  }
   145  
   146  // SetCreatedAt sets field value
   147  func (o *DevicePolicy) SetCreatedAt(v string) {
   148  	o.CreatedAt = v
   149  }
   150  
   151  // GetUpdatedAt returns the UpdatedAt field value
   152  func (o *DevicePolicy) GetUpdatedAt() string {
   153  	if o == nil  {
   154  		var ret string
   155  		return ret
   156  	}
   157  
   158  	return o.UpdatedAt
   159  }
   160  
   161  // GetUpdatedAtOk returns a tuple with the UpdatedAt field value
   162  // and a boolean to check if the value has been set.
   163  func (o *DevicePolicy) GetUpdatedAtOk() (*string, bool) {
   164  	if o == nil  {
   165  		return nil, false
   166  	}
   167  	return &o.UpdatedAt, true
   168  }
   169  
   170  // SetUpdatedAt sets field value
   171  func (o *DevicePolicy) SetUpdatedAt(v string) {
   172  	o.UpdatedAt = v
   173  }
   174  
   175  func (o DevicePolicy) MarshalJSON() ([]byte, error) {
   176  	toSerialize := map[string]interface{}{}
   177  	if true {
   178  		toSerialize["policy_id"] = o.PolicyId
   179  	}
   180  	if o.ActivationKey != nil {
   181  		toSerialize["activation_key"] = o.ActivationKey
   182  	}
   183  	if true {
   184  		toSerialize["resource_owner_id"] = o.ResourceOwnerId
   185  	}
   186  	if true {
   187  		toSerialize["created_at"] = o.CreatedAt
   188  	}
   189  	if true {
   190  		toSerialize["updated_at"] = o.UpdatedAt
   191  	}
   192  	return json.Marshal(toSerialize)
   193  }
   194  
   195  type NullableDevicePolicy struct {
   196  	value *DevicePolicy
   197  	isSet bool
   198  }
   199  
   200  func (v NullableDevicePolicy) Get() *DevicePolicy {
   201  	return v.value
   202  }
   203  
   204  func (v *NullableDevicePolicy) Set(val *DevicePolicy) {
   205  	v.value = val
   206  	v.isSet = true
   207  }
   208  
   209  func (v NullableDevicePolicy) IsSet() bool {
   210  	return v.isSet
   211  }
   212  
   213  func (v *NullableDevicePolicy) Unset() {
   214  	v.value = nil
   215  	v.isSet = false
   216  }
   217  
   218  func NewNullableDevicePolicy(val *DevicePolicy) *NullableDevicePolicy {
   219  	return &NullableDevicePolicy{value: val, isSet: true}
   220  }
   221  
   222  func (v NullableDevicePolicy) MarshalJSON() ([]byte, error) {
   223  	return json.Marshal(v.value)
   224  }
   225  
   226  func (v *NullableDevicePolicy) UnmarshalJSON(src []byte) error {
   227  	v.isSet = true
   228  	return json.Unmarshal(src, &v.value)
   229  }
   230  
   231