bunnyshell.com/sdk@v0.16.0/model_secret_decrypted_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 SecretDecryptedItem type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &SecretDecryptedItem{}
    20  
    21  // SecretDecryptedItem A secret is used to encrypt plain texts and decrypt cipher texts.
    22  type SecretDecryptedItem struct {
    23  	// Plain text.
    24  	PlainText *string `json:"plainText,omitempty"`
    25  	// Organization identifier.
    26  	Organization *string `json:"organization,omitempty"`
    27  }
    28  
    29  // NewSecretDecryptedItem instantiates a new SecretDecryptedItem 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 NewSecretDecryptedItem() *SecretDecryptedItem {
    34  	this := SecretDecryptedItem{}
    35  	return &this
    36  }
    37  
    38  // NewSecretDecryptedItemWithDefaults instantiates a new SecretDecryptedItem 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 NewSecretDecryptedItemWithDefaults() *SecretDecryptedItem {
    42  	this := SecretDecryptedItem{}
    43  	return &this
    44  }
    45  
    46  // GetPlainText returns the PlainText field value if set, zero value otherwise.
    47  func (o *SecretDecryptedItem) GetPlainText() string {
    48  	if o == nil || IsNil(o.PlainText) {
    49  		var ret string
    50  		return ret
    51  	}
    52  	return *o.PlainText
    53  }
    54  
    55  // GetPlainTextOk returns a tuple with the PlainText field value if set, nil otherwise
    56  // and a boolean to check if the value has been set.
    57  func (o *SecretDecryptedItem) GetPlainTextOk() (*string, bool) {
    58  	if o == nil || IsNil(o.PlainText) {
    59  		return nil, false
    60  	}
    61  	return o.PlainText, true
    62  }
    63  
    64  // HasPlainText returns a boolean if a field has been set.
    65  func (o *SecretDecryptedItem) HasPlainText() bool {
    66  	if o != nil && !IsNil(o.PlainText) {
    67  		return true
    68  	}
    69  
    70  	return false
    71  }
    72  
    73  // SetPlainText gets a reference to the given string and assigns it to the PlainText field.
    74  func (o *SecretDecryptedItem) SetPlainText(v string) {
    75  	o.PlainText = &v
    76  }
    77  
    78  // GetOrganization returns the Organization field value if set, zero value otherwise.
    79  func (o *SecretDecryptedItem) GetOrganization() string {
    80  	if o == nil || IsNil(o.Organization) {
    81  		var ret string
    82  		return ret
    83  	}
    84  	return *o.Organization
    85  }
    86  
    87  // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise
    88  // and a boolean to check if the value has been set.
    89  func (o *SecretDecryptedItem) GetOrganizationOk() (*string, bool) {
    90  	if o == nil || IsNil(o.Organization) {
    91  		return nil, false
    92  	}
    93  	return o.Organization, true
    94  }
    95  
    96  // HasOrganization returns a boolean if a field has been set.
    97  func (o *SecretDecryptedItem) HasOrganization() bool {
    98  	if o != nil && !IsNil(o.Organization) {
    99  		return true
   100  	}
   101  
   102  	return false
   103  }
   104  
   105  // SetOrganization gets a reference to the given string and assigns it to the Organization field.
   106  func (o *SecretDecryptedItem) SetOrganization(v string) {
   107  	o.Organization = &v
   108  }
   109  
   110  func (o SecretDecryptedItem) MarshalJSON() ([]byte, error) {
   111  	toSerialize, err := o.ToMap()
   112  	if err != nil {
   113  		return []byte{}, err
   114  	}
   115  	return json.Marshal(toSerialize)
   116  }
   117  
   118  func (o SecretDecryptedItem) ToMap() (map[string]interface{}, error) {
   119  	toSerialize := map[string]interface{}{}
   120  	if !IsNil(o.PlainText) {
   121  		toSerialize["plainText"] = o.PlainText
   122  	}
   123  	if !IsNil(o.Organization) {
   124  		toSerialize["organization"] = o.Organization
   125  	}
   126  	return toSerialize, nil
   127  }
   128  
   129  type NullableSecretDecryptedItem struct {
   130  	value *SecretDecryptedItem
   131  	isSet bool
   132  }
   133  
   134  func (v NullableSecretDecryptedItem) Get() *SecretDecryptedItem {
   135  	return v.value
   136  }
   137  
   138  func (v *NullableSecretDecryptedItem) Set(val *SecretDecryptedItem) {
   139  	v.value = val
   140  	v.isSet = true
   141  }
   142  
   143  func (v NullableSecretDecryptedItem) IsSet() bool {
   144  	return v.isSet
   145  }
   146  
   147  func (v *NullableSecretDecryptedItem) Unset() {
   148  	v.value = nil
   149  	v.isSet = false
   150  }
   151  
   152  func NewNullableSecretDecryptedItem(val *SecretDecryptedItem) *NullableSecretDecryptedItem {
   153  	return &NullableSecretDecryptedItem{value: val, isSet: true}
   154  }
   155  
   156  func (v NullableSecretDecryptedItem) MarshalJSON() ([]byte, error) {
   157  	return json.Marshal(v.value)
   158  }
   159  
   160  func (v *NullableSecretDecryptedItem) UnmarshalJSON(src []byte) error {
   161  	v.isSet = true
   162  	return json.Unmarshal(src, &v.value)
   163  }