bunnyshell.com/sdk@v0.16.0/model_project_create_action.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 ProjectCreateAction type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ProjectCreateAction{} 20 21 // ProjectCreateAction A project holds multiple environments and shared secrets and settings. 22 type ProjectCreateAction struct { 23 Name string `json:"name"` 24 Organization string `json:"organization"` 25 Labels *map[string]string `json:"labels,omitempty"` 26 } 27 28 // NewProjectCreateAction instantiates a new ProjectCreateAction object 29 // This constructor will assign default values to properties that have it defined, 30 // and makes sure properties required by API are set, but the set of arguments 31 // will change when the set of required properties is changed 32 func NewProjectCreateAction(name string, organization string) *ProjectCreateAction { 33 this := ProjectCreateAction{} 34 this.Name = name 35 this.Organization = organization 36 return &this 37 } 38 39 // NewProjectCreateActionWithDefaults instantiates a new ProjectCreateAction 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 NewProjectCreateActionWithDefaults() *ProjectCreateAction { 43 this := ProjectCreateAction{} 44 return &this 45 } 46 47 // GetName returns the Name field value 48 func (o *ProjectCreateAction) GetName() string { 49 if o == nil { 50 var ret string 51 return ret 52 } 53 54 return o.Name 55 } 56 57 // GetNameOk returns a tuple with the Name field value 58 // and a boolean to check if the value has been set. 59 func (o *ProjectCreateAction) GetNameOk() (*string, bool) { 60 if o == nil { 61 return nil, false 62 } 63 return &o.Name, true 64 } 65 66 // SetName sets field value 67 func (o *ProjectCreateAction) SetName(v string) { 68 o.Name = v 69 } 70 71 // GetOrganization returns the Organization field value 72 func (o *ProjectCreateAction) GetOrganization() string { 73 if o == nil { 74 var ret string 75 return ret 76 } 77 78 return o.Organization 79 } 80 81 // GetOrganizationOk returns a tuple with the Organization field value 82 // and a boolean to check if the value has been set. 83 func (o *ProjectCreateAction) GetOrganizationOk() (*string, bool) { 84 if o == nil { 85 return nil, false 86 } 87 return &o.Organization, true 88 } 89 90 // SetOrganization sets field value 91 func (o *ProjectCreateAction) SetOrganization(v string) { 92 o.Organization = v 93 } 94 95 // GetLabels returns the Labels field value if set, zero value otherwise. 96 func (o *ProjectCreateAction) GetLabels() map[string]string { 97 if o == nil || IsNil(o.Labels) { 98 var ret map[string]string 99 return ret 100 } 101 return *o.Labels 102 } 103 104 // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise 105 // and a boolean to check if the value has been set. 106 func (o *ProjectCreateAction) GetLabelsOk() (*map[string]string, bool) { 107 if o == nil || IsNil(o.Labels) { 108 return nil, false 109 } 110 return o.Labels, true 111 } 112 113 // HasLabels returns a boolean if a field has been set. 114 func (o *ProjectCreateAction) HasLabels() bool { 115 if o != nil && !IsNil(o.Labels) { 116 return true 117 } 118 119 return false 120 } 121 122 // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field. 123 func (o *ProjectCreateAction) SetLabels(v map[string]string) { 124 o.Labels = &v 125 } 126 127 func (o ProjectCreateAction) MarshalJSON() ([]byte, error) { 128 toSerialize, err := o.ToMap() 129 if err != nil { 130 return []byte{}, err 131 } 132 return json.Marshal(toSerialize) 133 } 134 135 func (o ProjectCreateAction) ToMap() (map[string]interface{}, error) { 136 toSerialize := map[string]interface{}{} 137 toSerialize["name"] = o.Name 138 toSerialize["organization"] = o.Organization 139 if !IsNil(o.Labels) { 140 toSerialize["labels"] = o.Labels 141 } 142 return toSerialize, nil 143 } 144 145 type NullableProjectCreateAction struct { 146 value *ProjectCreateAction 147 isSet bool 148 } 149 150 func (v NullableProjectCreateAction) Get() *ProjectCreateAction { 151 return v.value 152 } 153 154 func (v *NullableProjectCreateAction) Set(val *ProjectCreateAction) { 155 v.value = val 156 v.isSet = true 157 } 158 159 func (v NullableProjectCreateAction) IsSet() bool { 160 return v.isSet 161 } 162 163 func (v *NullableProjectCreateAction) Unset() { 164 v.value = nil 165 v.isSet = false 166 } 167 168 func NewNullableProjectCreateAction(val *ProjectCreateAction) *NullableProjectCreateAction { 169 return &NullableProjectCreateAction{value: val, isSet: true} 170 } 171 172 func (v NullableProjectCreateAction) MarshalJSON() ([]byte, error) { 173 return json.Marshal(v.value) 174 } 175 176 func (v *NullableProjectCreateAction) UnmarshalJSON(src []byte) error { 177 v.isSet = true 178 return json.Unmarshal(src, &v.value) 179 }