bunnyshell.com/sdk@v0.16.0/docs/EnvironmentVariableAPI.md (about)

     1  # \EnvironmentVariableAPI
     2  
     3  All URIs are relative to *https://api.environments.bunnyshell.com*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**EnvironmentVariableCreate**](EnvironmentVariableAPI.md#EnvironmentVariableCreate) | **Post** /v1/environment_variables | Create a specific environment variable.
     8  [**EnvironmentVariableDelete**](EnvironmentVariableAPI.md#EnvironmentVariableDelete) | **Delete** /v1/environment_variables/{id} | Delete a specific environment variable.
     9  [**EnvironmentVariableEdit**](EnvironmentVariableAPI.md#EnvironmentVariableEdit) | **Patch** /v1/environment_variables/{id} | Edit a specific environment variable.
    10  [**EnvironmentVariableList**](EnvironmentVariableAPI.md#EnvironmentVariableList) | **Get** /v1/environment_variables | List environment variables matching any selected filters.
    11  [**EnvironmentVariableView**](EnvironmentVariableAPI.md#EnvironmentVariableView) | **Get** /v1/environment_variables/{id} | View a specific environment variable.
    12  
    13  
    14  
    15  ## EnvironmentVariableCreate
    16  
    17  > EnvironmentVariableItem EnvironmentVariableCreate(ctx).EnvironmentVariableCreateAction(environmentVariableCreateAction).Execute()
    18  
    19  Create a specific environment 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      environmentVariableCreateAction := *openapiclient.NewEnvironmentVariableCreateAction("Name_example", "Value_example", "Environment_example") // EnvironmentVariableCreateAction | The new environment_variable resource
    37  
    38      configuration := openapiclient.NewConfiguration()
    39      apiClient := openapiclient.NewAPIClient(configuration)
    40      resp, r, err := apiClient.EnvironmentVariableAPI.EnvironmentVariableCreate(context.Background()).EnvironmentVariableCreateAction(environmentVariableCreateAction).Execute()
    41      if err != nil {
    42          fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentVariableAPI.EnvironmentVariableCreate``: %v\n", err)
    43          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    44      }
    45      // response from `EnvironmentVariableCreate`: EnvironmentVariableItem
    46      fmt.Fprintf(os.Stdout, "Response from `EnvironmentVariableAPI.EnvironmentVariableCreate`: %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 apiEnvironmentVariableCreateRequest struct via the builder pattern
    57  
    58  
    59  Name | Type | Description  | Notes
    60  ------------- | ------------- | ------------- | -------------
    61   **environmentVariableCreateAction** | [**EnvironmentVariableCreateAction**](EnvironmentVariableCreateAction.md) | The new environment_variable resource | 
    62  
    63  ### Return type
    64  
    65  [**EnvironmentVariableItem**](EnvironmentVariableItem.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  ## EnvironmentVariableDelete
    82  
    83  > EnvironmentVariableDelete(ctx, id).Body(body).Execute()
    84  
    85  Delete a specific environment 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.EnvironmentVariableAPI.EnvironmentVariableDelete(context.Background(), id).Body(body).Execute()
   108      if err != nil {
   109          fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentVariableAPI.EnvironmentVariableDelete``: %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 apiEnvironmentVariableDeleteRequest 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  ## EnvironmentVariableEdit
   152  
   153  > EnvironmentVariableItem EnvironmentVariableEdit(ctx, id).EnvironmentVariableEditAction(environmentVariableEditAction).Execute()
   154  
   155  Edit a specific environment 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      environmentVariableEditAction := *openapiclient.NewEnvironmentVariableEditAction("Value_example") // EnvironmentVariableEditAction | The updated environment_variable resource
   174  
   175      configuration := openapiclient.NewConfiguration()
   176      apiClient := openapiclient.NewAPIClient(configuration)
   177      resp, r, err := apiClient.EnvironmentVariableAPI.EnvironmentVariableEdit(context.Background(), id).EnvironmentVariableEditAction(environmentVariableEditAction).Execute()
   178      if err != nil {
   179          fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentVariableAPI.EnvironmentVariableEdit``: %v\n", err)
   180          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   181      }
   182      // response from `EnvironmentVariableEdit`: EnvironmentVariableItem
   183      fmt.Fprintf(os.Stdout, "Response from `EnvironmentVariableAPI.EnvironmentVariableEdit`: %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 apiEnvironmentVariableEditRequest struct via the builder pattern
   198  
   199  
   200  Name | Type | Description  | Notes
   201  ------------- | ------------- | ------------- | -------------
   202  
   203   **environmentVariableEditAction** | [**EnvironmentVariableEditAction**](EnvironmentVariableEditAction.md) | The updated environment_variable resource | 
   204  
   205  ### Return type
   206  
   207  [**EnvironmentVariableItem**](EnvironmentVariableItem.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  ## EnvironmentVariableList
   224  
   225  > PaginatedEnvironmentVariableCollection EnvironmentVariableList(ctx).Page(page).Name(name).Environment(environment).Organization(organization).Execute()
   226  
   227  List environment 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      environment := "environment_example" // string | Filter by environment (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.EnvironmentVariableAPI.EnvironmentVariableList(context.Background()).Page(page).Name(name).Environment(environment).Organization(organization).Execute()
   252      if err != nil {
   253          fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentVariableAPI.EnvironmentVariableList``: %v\n", err)
   254          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   255      }
   256      // response from `EnvironmentVariableList`: PaginatedEnvironmentVariableCollection
   257      fmt.Fprintf(os.Stdout, "Response from `EnvironmentVariableAPI.EnvironmentVariableList`: %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 apiEnvironmentVariableListRequest 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   **environment** | **string** | Filter by environment | 
   275   **organization** | **string** | Filter by organization | 
   276  
   277  ### Return type
   278  
   279  [**PaginatedEnvironmentVariableCollection**](PaginatedEnvironmentVariableCollection.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  ## EnvironmentVariableView
   296  
   297  > EnvironmentVariableItem EnvironmentVariableView(ctx, id).Execute()
   298  
   299  View a specific environment 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.EnvironmentVariableAPI.EnvironmentVariableView(context.Background(), id).Execute()
   321      if err != nil {
   322          fmt.Fprintf(os.Stderr, "Error when calling `EnvironmentVariableAPI.EnvironmentVariableView``: %v\n", err)
   323          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   324      }
   325      // response from `EnvironmentVariableView`: EnvironmentVariableItem
   326      fmt.Fprintf(os.Stdout, "Response from `EnvironmentVariableAPI.EnvironmentVariableView`: %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 apiEnvironmentVariableViewRequest struct via the builder pattern
   341  
   342  
   343  Name | Type | Description  | Notes
   344  ------------- | ------------- | ------------- | -------------
   345  
   346  
   347  ### Return type
   348  
   349  [**EnvironmentVariableItem**](EnvironmentVariableItem.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