bunnyshell.com/sdk@v0.16.0/docs/ProjectVariableAPI.md (about) 1 # \ProjectVariableAPI 2 3 All URIs are relative to *https://api.environments.bunnyshell.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**ProjectVariableCreate**](ProjectVariableAPI.md#ProjectVariableCreate) | **Post** /v1/project_variables | Create a specific project variable. 8 [**ProjectVariableDelete**](ProjectVariableAPI.md#ProjectVariableDelete) | **Delete** /v1/project_variables/{id} | Delete a specific project variable. 9 [**ProjectVariableEdit**](ProjectVariableAPI.md#ProjectVariableEdit) | **Patch** /v1/project_variables/{id} | Edit a specific project variable. 10 [**ProjectVariableList**](ProjectVariableAPI.md#ProjectVariableList) | **Get** /v1/project_variables | List project variables matching any selected filters. 11 [**ProjectVariableView**](ProjectVariableAPI.md#ProjectVariableView) | **Get** /v1/project_variables/{id} | View a specific project variable. 12 13 14 15 ## ProjectVariableCreate 16 17 > ProjectVariableItem ProjectVariableCreate(ctx).ProjectVariableCreateAction(projectVariableCreateAction).Execute() 18 19 Create a specific project variable. 20 21 22 23 ### Example 24 25 ```go 26 package main 27 28 import ( 29 "context" 30 "fmt" 31 "os" 32 openapiclient "bunnyshell.com/sdk" 33 ) 34 35 func main() { 36 projectVariableCreateAction := *openapiclient.NewProjectVariableCreateAction("Name_example", "Value_example", "Project_example") // ProjectVariableCreateAction | The new project_variable resource 37 38 configuration := openapiclient.NewConfiguration() 39 apiClient := openapiclient.NewAPIClient(configuration) 40 resp, r, err := apiClient.ProjectVariableAPI.ProjectVariableCreate(context.Background()).ProjectVariableCreateAction(projectVariableCreateAction).Execute() 41 if err != nil { 42 fmt.Fprintf(os.Stderr, "Error when calling `ProjectVariableAPI.ProjectVariableCreate``: %v\n", err) 43 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 44 } 45 // response from `ProjectVariableCreate`: ProjectVariableItem 46 fmt.Fprintf(os.Stdout, "Response from `ProjectVariableAPI.ProjectVariableCreate`: %v\n", resp) 47 } 48 ``` 49 50 ### Path Parameters 51 52 53 54 ### Other Parameters 55 56 Other parameters are passed through a pointer to a apiProjectVariableCreateRequest struct via the builder pattern 57 58 59 Name | Type | Description | Notes 60 ------------- | ------------- | ------------- | ------------- 61 **projectVariableCreateAction** | [**ProjectVariableCreateAction**](ProjectVariableCreateAction.md) | The new project_variable resource | 62 63 ### Return type 64 65 [**ProjectVariableItem**](ProjectVariableItem.md) 66 67 ### Authorization 68 69 [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth) 70 71 ### HTTP request headers 72 73 - **Content-Type**: application/json 74 - **Accept**: application/hal+json, application/problem+json 75 76 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 77 [[Back to Model list]](../README.md#documentation-for-models) 78 [[Back to README]](../README.md) 79 80 81 ## ProjectVariableDelete 82 83 > ProjectVariableDelete(ctx, id).Body(body).Execute() 84 85 Delete a specific project variable. 86 87 88 89 ### Example 90 91 ```go 92 package main 93 94 import ( 95 "context" 96 "fmt" 97 "os" 98 openapiclient "bunnyshell.com/sdk" 99 ) 100 101 func main() { 102 id := "id_example" // string | Resource identifier 103 body := interface{}(987) // interface{} | No Request Body (optional) 104 105 configuration := openapiclient.NewConfiguration() 106 apiClient := openapiclient.NewAPIClient(configuration) 107 r, err := apiClient.ProjectVariableAPI.ProjectVariableDelete(context.Background(), id).Body(body).Execute() 108 if err != nil { 109 fmt.Fprintf(os.Stderr, "Error when calling `ProjectVariableAPI.ProjectVariableDelete``: %v\n", err) 110 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 111 } 112 } 113 ``` 114 115 ### Path Parameters 116 117 118 Name | Type | Description | Notes 119 ------------- | ------------- | ------------- | ------------- 120 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 121 **id** | **string** | Resource identifier | 122 123 ### Other Parameters 124 125 Other parameters are passed through a pointer to a apiProjectVariableDeleteRequest struct via the builder pattern 126 127 128 Name | Type | Description | Notes 129 ------------- | ------------- | ------------- | ------------- 130 131 **body** | **interface{}** | No Request Body | 132 133 ### Return type 134 135 (empty response body) 136 137 ### Authorization 138 139 [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth) 140 141 ### HTTP request headers 142 143 - **Content-Type**: application/json 144 - **Accept**: application/problem+json 145 146 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 147 [[Back to Model list]](../README.md#documentation-for-models) 148 [[Back to README]](../README.md) 149 150 151 ## ProjectVariableEdit 152 153 > ProjectVariableItem ProjectVariableEdit(ctx, id).ProjectVariableEditAction(projectVariableEditAction).Execute() 154 155 Edit a specific project variable. 156 157 158 159 ### Example 160 161 ```go 162 package main 163 164 import ( 165 "context" 166 "fmt" 167 "os" 168 openapiclient "bunnyshell.com/sdk" 169 ) 170 171 func main() { 172 id := "id_example" // string | Resource identifier 173 projectVariableEditAction := *openapiclient.NewProjectVariableEditAction("Value_example") // ProjectVariableEditAction | The updated project_variable resource 174 175 configuration := openapiclient.NewConfiguration() 176 apiClient := openapiclient.NewAPIClient(configuration) 177 resp, r, err := apiClient.ProjectVariableAPI.ProjectVariableEdit(context.Background(), id).ProjectVariableEditAction(projectVariableEditAction).Execute() 178 if err != nil { 179 fmt.Fprintf(os.Stderr, "Error when calling `ProjectVariableAPI.ProjectVariableEdit``: %v\n", err) 180 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 181 } 182 // response from `ProjectVariableEdit`: ProjectVariableItem 183 fmt.Fprintf(os.Stdout, "Response from `ProjectVariableAPI.ProjectVariableEdit`: %v\n", resp) 184 } 185 ``` 186 187 ### Path Parameters 188 189 190 Name | Type | Description | Notes 191 ------------- | ------------- | ------------- | ------------- 192 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 193 **id** | **string** | Resource identifier | 194 195 ### Other Parameters 196 197 Other parameters are passed through a pointer to a apiProjectVariableEditRequest struct via the builder pattern 198 199 200 Name | Type | Description | Notes 201 ------------- | ------------- | ------------- | ------------- 202 203 **projectVariableEditAction** | [**ProjectVariableEditAction**](ProjectVariableEditAction.md) | The updated project_variable resource | 204 205 ### Return type 206 207 [**ProjectVariableItem**](ProjectVariableItem.md) 208 209 ### Authorization 210 211 [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth) 212 213 ### HTTP request headers 214 215 - **Content-Type**: application/json 216 - **Accept**: application/hal+json, application/problem+json 217 218 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 219 [[Back to Model list]](../README.md#documentation-for-models) 220 [[Back to README]](../README.md) 221 222 223 ## ProjectVariableList 224 225 > PaginatedProjectVariableCollection ProjectVariableList(ctx).Page(page).Name(name).Project(project).Organization(organization).Execute() 226 227 List project variables matching any selected filters. 228 229 230 231 ### Example 232 233 ```go 234 package main 235 236 import ( 237 "context" 238 "fmt" 239 "os" 240 openapiclient "bunnyshell.com/sdk" 241 ) 242 243 func main() { 244 page := int32(56) // int32 | The collection page number (optional) (default to 1) 245 name := "name_example" // string | Filter by name (optional) 246 project := "project_example" // string | Filter by project (optional) 247 organization := "organization_example" // string | Filter by organization (optional) 248 249 configuration := openapiclient.NewConfiguration() 250 apiClient := openapiclient.NewAPIClient(configuration) 251 resp, r, err := apiClient.ProjectVariableAPI.ProjectVariableList(context.Background()).Page(page).Name(name).Project(project).Organization(organization).Execute() 252 if err != nil { 253 fmt.Fprintf(os.Stderr, "Error when calling `ProjectVariableAPI.ProjectVariableList``: %v\n", err) 254 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 255 } 256 // response from `ProjectVariableList`: PaginatedProjectVariableCollection 257 fmt.Fprintf(os.Stdout, "Response from `ProjectVariableAPI.ProjectVariableList`: %v\n", resp) 258 } 259 ``` 260 261 ### Path Parameters 262 263 264 265 ### Other Parameters 266 267 Other parameters are passed through a pointer to a apiProjectVariableListRequest struct via the builder pattern 268 269 270 Name | Type | Description | Notes 271 ------------- | ------------- | ------------- | ------------- 272 **page** | **int32** | The collection page number | [default to 1] 273 **name** | **string** | Filter by name | 274 **project** | **string** | Filter by project | 275 **organization** | **string** | Filter by organization | 276 277 ### Return type 278 279 [**PaginatedProjectVariableCollection**](PaginatedProjectVariableCollection.md) 280 281 ### Authorization 282 283 [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth) 284 285 ### HTTP request headers 286 287 - **Content-Type**: Not defined 288 - **Accept**: application/hal+json, application/problem+json 289 290 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 291 [[Back to Model list]](../README.md#documentation-for-models) 292 [[Back to README]](../README.md) 293 294 295 ## ProjectVariableView 296 297 > ProjectVariableItem ProjectVariableView(ctx, id).Execute() 298 299 View a specific project variable. 300 301 302 303 ### Example 304 305 ```go 306 package main 307 308 import ( 309 "context" 310 "fmt" 311 "os" 312 openapiclient "bunnyshell.com/sdk" 313 ) 314 315 func main() { 316 id := "id_example" // string | Resource identifier 317 318 configuration := openapiclient.NewConfiguration() 319 apiClient := openapiclient.NewAPIClient(configuration) 320 resp, r, err := apiClient.ProjectVariableAPI.ProjectVariableView(context.Background(), id).Execute() 321 if err != nil { 322 fmt.Fprintf(os.Stderr, "Error when calling `ProjectVariableAPI.ProjectVariableView``: %v\n", err) 323 fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 324 } 325 // response from `ProjectVariableView`: ProjectVariableItem 326 fmt.Fprintf(os.Stdout, "Response from `ProjectVariableAPI.ProjectVariableView`: %v\n", resp) 327 } 328 ``` 329 330 ### Path Parameters 331 332 333 Name | Type | Description | Notes 334 ------------- | ------------- | ------------- | ------------- 335 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 336 **id** | **string** | Resource identifier | 337 338 ### Other Parameters 339 340 Other parameters are passed through a pointer to a apiProjectVariableViewRequest struct via the builder pattern 341 342 343 Name | Type | Description | Notes 344 ------------- | ------------- | ------------- | ------------- 345 346 347 ### Return type 348 349 [**ProjectVariableItem**](ProjectVariableItem.md) 350 351 ### Authorization 352 353 [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth) 354 355 ### HTTP request headers 356 357 - **Content-Type**: Not defined 358 - **Accept**: application/hal+json, application/problem+json 359 360 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 361 [[Back to Model list]](../README.md#documentation-for-models) 362 [[Back to README]](../README.md) 363