github.com/khulnasoft/codebase@v0.0.0-20231214144635-a707781cbb24/go-bitbucket/model_object.go (about) 1 /* 2 * Bitbucket API 3 * 4 * Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework. 5 * 6 * API version: 2.0 7 * Contact: support@bitbucket.org 8 */ 9 10 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 11 12 package bitbucket 13 14 import ( 15 "encoding/json" 16 ) 17 18 // Object Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`. 19 type Object struct { 20 Type string `json:"type"` 21 } 22 23 // NewObject instantiates a new Object object 24 // This constructor will assign default values to properties that have it defined, 25 // and makes sure properties required by API are set, but the set of arguments 26 // will change when the set of required properties is changed 27 func NewObject(type_ string) *Object { 28 this := Object{} 29 this.Type = type_ 30 return &this 31 } 32 33 // NewObjectWithDefaults instantiates a new Object object 34 // This constructor will only assign default values to properties that have it defined, 35 // but it doesn't guarantee that properties required by API are set 36 func NewObjectWithDefaults() *Object { 37 this := Object{} 38 return &this 39 } 40 41 // GetType returns the Type field value 42 func (o *Object) GetType() string { 43 if o == nil { 44 var ret string 45 return ret 46 } 47 48 return o.Type 49 } 50 51 // GetTypeOk returns a tuple with the Type field value 52 // and a boolean to check if the value has been set. 53 func (o *Object) GetTypeOk() (*string, bool) { 54 if o == nil { 55 return nil, false 56 } 57 return &o.Type, true 58 } 59 60 // SetType sets field value 61 func (o *Object) SetType(v string) { 62 o.Type = v 63 } 64 65 func (o Object) MarshalJSON() ([]byte, error) { 66 toSerialize := map[string]interface{}{} 67 if true { 68 toSerialize["type"] = o.Type 69 } 70 return json.Marshal(toSerialize) 71 } 72 73 type NullableObject struct { 74 value *Object 75 isSet bool 76 } 77 78 func (v NullableObject) Get() *Object { 79 return v.value 80 } 81 82 func (v *NullableObject) Set(val *Object) { 83 v.value = val 84 v.isSet = true 85 } 86 87 func (v NullableObject) IsSet() bool { 88 return v.isSet 89 } 90 91 func (v *NullableObject) Unset() { 92 v.value = nil 93 v.isSet = false 94 } 95 96 func NewNullableObject(val *Object) *NullableObject { 97 return &NullableObject{value: val, isSet: true} 98 } 99 100 func (v NullableObject) MarshalJSON() ([]byte, error) { 101 return json.Marshal(v.value) 102 } 103 104 func (v *NullableObject) UnmarshalJSON(src []byte) error { 105 v.isSet = true 106 return json.Unmarshal(src, &v.value) 107 }