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

     1  # \ProjectAPI
     2  
     3  All URIs are relative to *https://api.environments.bunnyshell.com*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**ProjectCreate**](ProjectAPI.md#ProjectCreate) | **Post** /v1/projects | Creates new project.
     8  [**ProjectDelete**](ProjectAPI.md#ProjectDelete) | **Delete** /v1/projects/{id} | Delete a specific project.
     9  [**ProjectEditBuildSettings**](ProjectAPI.md#ProjectEditBuildSettings) | **Patch** /v1/projects/{id}/build-settings | Edit the build settings of a project.
    10  [**ProjectEditSettings**](ProjectAPI.md#ProjectEditSettings) | **Patch** /v1/projects/{id}/settings | Edit a project.
    11  [**ProjectList**](ProjectAPI.md#ProjectList) | **Get** /v1/projects | List projects matching any selected filters.
    12  [**ProjectView**](ProjectAPI.md#ProjectView) | **Get** /v1/projects/{id} | View a specific project.
    13  
    14  
    15  
    16  ## ProjectCreate
    17  
    18  > ProjectItem ProjectCreate(ctx).ProjectCreateAction(projectCreateAction).Execute()
    19  
    20  Creates new project.
    21  
    22  
    23  
    24  ### Example
    25  
    26  ```go
    27  package main
    28  
    29  import (
    30      "context"
    31      "fmt"
    32      "os"
    33      openapiclient "bunnyshell.com/sdk"
    34  )
    35  
    36  func main() {
    37      projectCreateAction := *openapiclient.NewProjectCreateAction("Name_example", "Organization_example") // ProjectCreateAction | The new project resource
    38  
    39      configuration := openapiclient.NewConfiguration()
    40      apiClient := openapiclient.NewAPIClient(configuration)
    41      resp, r, err := apiClient.ProjectAPI.ProjectCreate(context.Background()).ProjectCreateAction(projectCreateAction).Execute()
    42      if err != nil {
    43          fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.ProjectCreate``: %v\n", err)
    44          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    45      }
    46      // response from `ProjectCreate`: ProjectItem
    47      fmt.Fprintf(os.Stdout, "Response from `ProjectAPI.ProjectCreate`: %v\n", resp)
    48  }
    49  ```
    50  
    51  ### Path Parameters
    52  
    53  
    54  
    55  ### Other Parameters
    56  
    57  Other parameters are passed through a pointer to a apiProjectCreateRequest struct via the builder pattern
    58  
    59  
    60  Name | Type | Description  | Notes
    61  ------------- | ------------- | ------------- | -------------
    62   **projectCreateAction** | [**ProjectCreateAction**](ProjectCreateAction.md) | The new project resource | 
    63  
    64  ### Return type
    65  
    66  [**ProjectItem**](ProjectItem.md)
    67  
    68  ### Authorization
    69  
    70  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
    71  
    72  ### HTTP request headers
    73  
    74  - **Content-Type**: application/json
    75  - **Accept**: application/hal+json, application/problem+json
    76  
    77  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
    78  [[Back to Model list]](../README.md#documentation-for-models)
    79  [[Back to README]](../README.md)
    80  
    81  
    82  ## ProjectDelete
    83  
    84  > ProjectDelete(ctx, id).Body(body).Execute()
    85  
    86  Delete a specific project.
    87  
    88  
    89  
    90  ### Example
    91  
    92  ```go
    93  package main
    94  
    95  import (
    96      "context"
    97      "fmt"
    98      "os"
    99      openapiclient "bunnyshell.com/sdk"
   100  )
   101  
   102  func main() {
   103      id := "id_example" // string | Resource identifier
   104      body := interface{}(987) // interface{} | No Request Body (optional)
   105  
   106      configuration := openapiclient.NewConfiguration()
   107      apiClient := openapiclient.NewAPIClient(configuration)
   108      r, err := apiClient.ProjectAPI.ProjectDelete(context.Background(), id).Body(body).Execute()
   109      if err != nil {
   110          fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.ProjectDelete``: %v\n", err)
   111          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   112      }
   113  }
   114  ```
   115  
   116  ### Path Parameters
   117  
   118  
   119  Name | Type | Description  | Notes
   120  ------------- | ------------- | ------------- | -------------
   121  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   122  **id** | **string** | Resource identifier | 
   123  
   124  ### Other Parameters
   125  
   126  Other parameters are passed through a pointer to a apiProjectDeleteRequest struct via the builder pattern
   127  
   128  
   129  Name | Type | Description  | Notes
   130  ------------- | ------------- | ------------- | -------------
   131  
   132   **body** | **interface{}** | No Request Body | 
   133  
   134  ### Return type
   135  
   136   (empty response body)
   137  
   138  ### Authorization
   139  
   140  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
   141  
   142  ### HTTP request headers
   143  
   144  - **Content-Type**: application/json
   145  - **Accept**: application/problem+json
   146  
   147  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   148  [[Back to Model list]](../README.md#documentation-for-models)
   149  [[Back to README]](../README.md)
   150  
   151  
   152  ## ProjectEditBuildSettings
   153  
   154  > ProjectItem ProjectEditBuildSettings(ctx, id).ProjectEditBuildSettingsAction(projectEditBuildSettingsAction).Execute()
   155  
   156  Edit the build settings of a project.
   157  
   158  
   159  
   160  ### Example
   161  
   162  ```go
   163  package main
   164  
   165  import (
   166      "context"
   167      "fmt"
   168      "os"
   169      openapiclient "bunnyshell.com/sdk"
   170  )
   171  
   172  func main() {
   173      id := "id_example" // string | Resource identifier
   174      projectEditBuildSettingsAction := *openapiclient.NewProjectEditBuildSettingsAction("RegistryIntegration_example", "KubernetesIntegration_example", "Cpu_example", NullableInt32(123), NullableInt32(123)) // ProjectEditBuildSettingsAction | The updated project resource
   175  
   176      configuration := openapiclient.NewConfiguration()
   177      apiClient := openapiclient.NewAPIClient(configuration)
   178      resp, r, err := apiClient.ProjectAPI.ProjectEditBuildSettings(context.Background(), id).ProjectEditBuildSettingsAction(projectEditBuildSettingsAction).Execute()
   179      if err != nil {
   180          fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.ProjectEditBuildSettings``: %v\n", err)
   181          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   182      }
   183      // response from `ProjectEditBuildSettings`: ProjectItem
   184      fmt.Fprintf(os.Stdout, "Response from `ProjectAPI.ProjectEditBuildSettings`: %v\n", resp)
   185  }
   186  ```
   187  
   188  ### Path Parameters
   189  
   190  
   191  Name | Type | Description  | Notes
   192  ------------- | ------------- | ------------- | -------------
   193  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   194  **id** | **string** | Resource identifier | 
   195  
   196  ### Other Parameters
   197  
   198  Other parameters are passed through a pointer to a apiProjectEditBuildSettingsRequest struct via the builder pattern
   199  
   200  
   201  Name | Type | Description  | Notes
   202  ------------- | ------------- | ------------- | -------------
   203  
   204   **projectEditBuildSettingsAction** | [**ProjectEditBuildSettingsAction**](ProjectEditBuildSettingsAction.md) | The updated project resource | 
   205  
   206  ### Return type
   207  
   208  [**ProjectItem**](ProjectItem.md)
   209  
   210  ### Authorization
   211  
   212  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
   213  
   214  ### HTTP request headers
   215  
   216  - **Content-Type**: application/json
   217  - **Accept**: application/hal+json, application/problem+json
   218  
   219  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   220  [[Back to Model list]](../README.md#documentation-for-models)
   221  [[Back to README]](../README.md)
   222  
   223  
   224  ## ProjectEditSettings
   225  
   226  > ProjectItem ProjectEditSettings(ctx, id).ProjectEditSettingsAction(projectEditSettingsAction).Execute()
   227  
   228  Edit a project.
   229  
   230  
   231  
   232  ### Example
   233  
   234  ```go
   235  package main
   236  
   237  import (
   238      "context"
   239      "fmt"
   240      "os"
   241      openapiclient "bunnyshell.com/sdk"
   242  )
   243  
   244  func main() {
   245      id := "id_example" // string | Resource identifier
   246      projectEditSettingsAction := *openapiclient.NewProjectEditSettingsAction("Name_example") // ProjectEditSettingsAction | The updated project resource
   247  
   248      configuration := openapiclient.NewConfiguration()
   249      apiClient := openapiclient.NewAPIClient(configuration)
   250      resp, r, err := apiClient.ProjectAPI.ProjectEditSettings(context.Background(), id).ProjectEditSettingsAction(projectEditSettingsAction).Execute()
   251      if err != nil {
   252          fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.ProjectEditSettings``: %v\n", err)
   253          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   254      }
   255      // response from `ProjectEditSettings`: ProjectItem
   256      fmt.Fprintf(os.Stdout, "Response from `ProjectAPI.ProjectEditSettings`: %v\n", resp)
   257  }
   258  ```
   259  
   260  ### Path Parameters
   261  
   262  
   263  Name | Type | Description  | Notes
   264  ------------- | ------------- | ------------- | -------------
   265  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   266  **id** | **string** | Resource identifier | 
   267  
   268  ### Other Parameters
   269  
   270  Other parameters are passed through a pointer to a apiProjectEditSettingsRequest struct via the builder pattern
   271  
   272  
   273  Name | Type | Description  | Notes
   274  ------------- | ------------- | ------------- | -------------
   275  
   276   **projectEditSettingsAction** | [**ProjectEditSettingsAction**](ProjectEditSettingsAction.md) | The updated project resource | 
   277  
   278  ### Return type
   279  
   280  [**ProjectItem**](ProjectItem.md)
   281  
   282  ### Authorization
   283  
   284  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
   285  
   286  ### HTTP request headers
   287  
   288  - **Content-Type**: application/json
   289  - **Accept**: application/hal+json, application/problem+json
   290  
   291  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   292  [[Back to Model list]](../README.md#documentation-for-models)
   293  [[Back to README]](../README.md)
   294  
   295  
   296  ## ProjectList
   297  
   298  > PaginatedProjectCollection ProjectList(ctx).Page(page).Organization(organization).Search(search).Labels(labels).Execute()
   299  
   300  List projects matching any selected filters.
   301  
   302  
   303  
   304  ### Example
   305  
   306  ```go
   307  package main
   308  
   309  import (
   310      "context"
   311      "fmt"
   312      "os"
   313      openapiclient "bunnyshell.com/sdk"
   314  )
   315  
   316  func main() {
   317      page := int32(56) // int32 | The collection page number (optional) (default to 1)
   318      organization := "organization_example" // string | Filter by organization (optional)
   319      search := "search_example" // string | Filter by search (optional)
   320      labels := map[string]string{"key": map[string]string{"key": "Inner_example"}} // map[string]string | Filter by label key-value pair. (optional)
   321  
   322      configuration := openapiclient.NewConfiguration()
   323      apiClient := openapiclient.NewAPIClient(configuration)
   324      resp, r, err := apiClient.ProjectAPI.ProjectList(context.Background()).Page(page).Organization(organization).Search(search).Labels(labels).Execute()
   325      if err != nil {
   326          fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.ProjectList``: %v\n", err)
   327          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   328      }
   329      // response from `ProjectList`: PaginatedProjectCollection
   330      fmt.Fprintf(os.Stdout, "Response from `ProjectAPI.ProjectList`: %v\n", resp)
   331  }
   332  ```
   333  
   334  ### Path Parameters
   335  
   336  
   337  
   338  ### Other Parameters
   339  
   340  Other parameters are passed through a pointer to a apiProjectListRequest struct via the builder pattern
   341  
   342  
   343  Name | Type | Description  | Notes
   344  ------------- | ------------- | ------------- | -------------
   345   **page** | **int32** | The collection page number | [default to 1]
   346   **organization** | **string** | Filter by organization | 
   347   **search** | **string** | Filter by search | 
   348   **labels** | **map[string]map[string]string** | Filter by label key-value pair. | 
   349  
   350  ### Return type
   351  
   352  [**PaginatedProjectCollection**](PaginatedProjectCollection.md)
   353  
   354  ### Authorization
   355  
   356  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
   357  
   358  ### HTTP request headers
   359  
   360  - **Content-Type**: Not defined
   361  - **Accept**: application/hal+json, application/problem+json
   362  
   363  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   364  [[Back to Model list]](../README.md#documentation-for-models)
   365  [[Back to README]](../README.md)
   366  
   367  
   368  ## ProjectView
   369  
   370  > ProjectItem ProjectView(ctx, id).Execute()
   371  
   372  View a specific project.
   373  
   374  
   375  
   376  ### Example
   377  
   378  ```go
   379  package main
   380  
   381  import (
   382      "context"
   383      "fmt"
   384      "os"
   385      openapiclient "bunnyshell.com/sdk"
   386  )
   387  
   388  func main() {
   389      id := "id_example" // string | Resource identifier
   390  
   391      configuration := openapiclient.NewConfiguration()
   392      apiClient := openapiclient.NewAPIClient(configuration)
   393      resp, r, err := apiClient.ProjectAPI.ProjectView(context.Background(), id).Execute()
   394      if err != nil {
   395          fmt.Fprintf(os.Stderr, "Error when calling `ProjectAPI.ProjectView``: %v\n", err)
   396          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   397      }
   398      // response from `ProjectView`: ProjectItem
   399      fmt.Fprintf(os.Stdout, "Response from `ProjectAPI.ProjectView`: %v\n", resp)
   400  }
   401  ```
   402  
   403  ### Path Parameters
   404  
   405  
   406  Name | Type | Description  | Notes
   407  ------------- | ------------- | ------------- | -------------
   408  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   409  **id** | **string** | Resource identifier | 
   410  
   411  ### Other Parameters
   412  
   413  Other parameters are passed through a pointer to a apiProjectViewRequest struct via the builder pattern
   414  
   415  
   416  Name | Type | Description  | Notes
   417  ------------- | ------------- | ------------- | -------------
   418  
   419  
   420  ### Return type
   421  
   422  [**ProjectItem**](ProjectItem.md)
   423  
   424  ### Authorization
   425  
   426  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
   427  
   428  ### HTTP request headers
   429  
   430  - **Content-Type**: Not defined
   431  - **Accept**: application/hal+json, application/problem+json
   432  
   433  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   434  [[Back to Model list]](../README.md#documentation-for-models)
   435  [[Back to README]](../README.md)
   436