github.com/openfga/go-sdk@v0.3.5/model_write_request_deletes.go (about) 1 /** 2 * Go SDK for OpenFGA 3 * 4 * API version: 0.1 5 * Website: https://openfga.dev 6 * Documentation: https://openfga.dev/docs 7 * Support: https://discord.gg/8naAwJfWN6 8 * License: [Apache-2.0](https://github.com/openfga/go-sdk/blob/main/LICENSE) 9 * 10 * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. 11 */ 12 13 package openfga 14 15 import ( 16 "bytes" 17 18 "encoding/json" 19 ) 20 21 // WriteRequestDeletes struct for WriteRequestDeletes 22 type WriteRequestDeletes struct { 23 TupleKeys []TupleKeyWithoutCondition `json:"tuple_keys"yaml:"tuple_keys"` 24 } 25 26 // NewWriteRequestDeletes instantiates a new WriteRequestDeletes 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 NewWriteRequestDeletes(tupleKeys []TupleKeyWithoutCondition) *WriteRequestDeletes { 31 this := WriteRequestDeletes{} 32 this.TupleKeys = tupleKeys 33 return &this 34 } 35 36 // NewWriteRequestDeletesWithDefaults instantiates a new WriteRequestDeletes object 37 // This constructor will only assign default values to properties that have it defined, 38 // but it doesn't guarantee that properties required by API are set 39 func NewWriteRequestDeletesWithDefaults() *WriteRequestDeletes { 40 this := WriteRequestDeletes{} 41 return &this 42 } 43 44 // GetTupleKeys returns the TupleKeys field value 45 func (o *WriteRequestDeletes) GetTupleKeys() []TupleKeyWithoutCondition { 46 if o == nil { 47 var ret []TupleKeyWithoutCondition 48 return ret 49 } 50 51 return o.TupleKeys 52 } 53 54 // GetTupleKeysOk returns a tuple with the TupleKeys field value 55 // and a boolean to check if the value has been set. 56 func (o *WriteRequestDeletes) GetTupleKeysOk() (*[]TupleKeyWithoutCondition, bool) { 57 if o == nil { 58 return nil, false 59 } 60 return &o.TupleKeys, true 61 } 62 63 // SetTupleKeys sets field value 64 func (o *WriteRequestDeletes) SetTupleKeys(v []TupleKeyWithoutCondition) { 65 o.TupleKeys = v 66 } 67 68 func (o WriteRequestDeletes) MarshalJSON() ([]byte, error) { 69 toSerialize := map[string]interface{}{} 70 toSerialize["tuple_keys"] = o.TupleKeys 71 var b bytes.Buffer 72 enc := json.NewEncoder(&b) 73 enc.SetEscapeHTML(false) 74 err := enc.Encode(toSerialize) 75 if err != nil { 76 return nil, err 77 } 78 return b.Bytes(), nil 79 } 80 81 type NullableWriteRequestDeletes struct { 82 value *WriteRequestDeletes 83 isSet bool 84 } 85 86 func (v NullableWriteRequestDeletes) Get() *WriteRequestDeletes { 87 return v.value 88 } 89 90 func (v *NullableWriteRequestDeletes) Set(val *WriteRequestDeletes) { 91 v.value = val 92 v.isSet = true 93 } 94 95 func (v NullableWriteRequestDeletes) IsSet() bool { 96 return v.isSet 97 } 98 99 func (v *NullableWriteRequestDeletes) Unset() { 100 v.value = nil 101 v.isSet = false 102 } 103 104 func NewNullableWriteRequestDeletes(val *WriteRequestDeletes) *NullableWriteRequestDeletes { 105 return &NullableWriteRequestDeletes{value: val, isSet: true} 106 } 107 108 func (v NullableWriteRequestDeletes) MarshalJSON() ([]byte, error) { 109 return json.Marshal(v.value) 110 } 111 112 func (v *NullableWriteRequestDeletes) UnmarshalJSON(src []byte) error { 113 v.isSet = true 114 return json.Unmarshal(src, &v.value) 115 }