Skip to content

Latest commit

 

History

History
582 lines (372 loc) · 17 KB

ProjectsApi.md

File metadata and controls

582 lines (372 loc) · 17 KB

\ProjectsApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
DeleteProject Delete /api/v2/projects/{projectKey} Delete project
GetFlagDefaultsByProject Get /api/v2/projects/{projectKey}/flag-defaults Get flag defaults for project
GetProject Get /api/v2/projects/{projectKey} Get project
GetProjects Get /api/v2/projects List projects
PatchFlagDefaultsByProject Patch /api/v2/projects/{projectKey}/flag-defaults Update flag default for project
PatchProject Patch /api/v2/projects/{projectKey} Update project
PostProject Post /api/v2/projects Create project
PutFlagDefaultsByProject Put /api/v2/projects/{projectKey}/flag-defaults Create or update flag defaults for project

DeleteProject

DeleteProject(ctx, projectKey).Execute()

Delete project

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projectKey := "projectKey_example" // string | The project key

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ProjectsApi.DeleteProject(context.Background(), projectKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.DeleteProject``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key

Other Parameters

Other parameters are passed through a pointer to a apiDeleteProjectRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFlagDefaultsByProject

FlagDefaultsRep GetFlagDefaultsByProject(ctx, projectKey).Execute()

Get flag defaults for project

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projectKey := "projectKey_example" // string | The project key

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ProjectsApi.GetFlagDefaultsByProject(context.Background(), projectKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.GetFlagDefaultsByProject``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetFlagDefaultsByProject`: FlagDefaultsRep
    fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.GetFlagDefaultsByProject`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key

Other Parameters

Other parameters are passed through a pointer to a apiGetFlagDefaultsByProjectRequest struct via the builder pattern

Name Type Description Notes

Return type

FlagDefaultsRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetProject

Project GetProject(ctx, projectKey).Expand(expand).Execute()

Get project

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projectKey := "projectKey_example" // string | The project key.
    expand := "expand_example" // string | A comma-separated list of properties that can reveal additional information in the response. (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ProjectsApi.GetProject(context.Background(), projectKey).Expand(expand).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.GetProject``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetProject`: Project
    fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.GetProject`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key.

Other Parameters

Other parameters are passed through a pointer to a apiGetProjectRequest struct via the builder pattern

Name Type Description Notes

expand | string | A comma-separated list of properties that can reveal additional information in the response. |

Return type

Project

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetProjects

Projects GetProjects(ctx).Limit(limit).Offset(offset).Filter(filter).Sort(sort).Expand(expand).Execute()

List projects

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    limit := int64(789) // int64 | The number of projects to return in the response. Defaults to 20. (optional)
    offset := int64(789) // int64 | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items. (optional)
    filter := "filter_example" // string | A comma-separated list of filters. Each filter is constructed as `field:value`. (optional)
    sort := "sort_example" // string | A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. (optional)
    expand := "expand_example" // string | A comma-separated list of properties that can reveal additional information in the response. (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ProjectsApi.GetProjects(context.Background()).Limit(limit).Offset(offset).Filter(filter).Sort(sort).Expand(expand).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.GetProjects``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetProjects`: Projects
    fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.GetProjects`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetProjectsRequest struct via the builder pattern

Name Type Description Notes
limit int64 The number of projects to return in the response. Defaults to 20.
offset int64 Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next `limit` items.
filter string A comma-separated list of filters. Each filter is constructed as `field:value`.
sort string A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order.
expand string A comma-separated list of properties that can reveal additional information in the response.

Return type

Projects

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PatchFlagDefaultsByProject

UpsertPayloadRep PatchFlagDefaultsByProject(ctx, projectKey).PatchOperation(patchOperation).Execute()

Update flag default for project

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projectKey := "projectKey_example" // string | The project key
    patchOperation := []openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/exampleField", interface{}(new example value))} // []PatchOperation | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ProjectsApi.PatchFlagDefaultsByProject(context.Background(), projectKey).PatchOperation(patchOperation).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.PatchFlagDefaultsByProject``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PatchFlagDefaultsByProject`: UpsertPayloadRep
    fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.PatchFlagDefaultsByProject`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key

Other Parameters

Other parameters are passed through a pointer to a apiPatchFlagDefaultsByProjectRequest struct via the builder pattern

Name Type Description Notes

patchOperation | []PatchOperation | |

Return type

UpsertPayloadRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PatchProject

ProjectRep PatchProject(ctx, projectKey).PatchOperation(patchOperation).Execute()

Update project

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projectKey := "projectKey_example" // string | The project key
    patchOperation := []openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/exampleField", interface{}(new example value))} // []PatchOperation | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ProjectsApi.PatchProject(context.Background(), projectKey).PatchOperation(patchOperation).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.PatchProject``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PatchProject`: ProjectRep
    fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.PatchProject`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key

Other Parameters

Other parameters are passed through a pointer to a apiPatchProjectRequest struct via the builder pattern

Name Type Description Notes

patchOperation | []PatchOperation | |

Return type

ProjectRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostProject

ProjectRep PostProject(ctx).ProjectPost(projectPost).Execute()

Create project

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projectPost := *openapiclient.NewProjectPost("My Project", "my-project") // ProjectPost | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ProjectsApi.PostProject(context.Background()).ProjectPost(projectPost).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.PostProject``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PostProject`: ProjectRep
    fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.PostProject`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiPostProjectRequest struct via the builder pattern

Name Type Description Notes
projectPost ProjectPost

Return type

ProjectRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutFlagDefaultsByProject

UpsertPayloadRep PutFlagDefaultsByProject(ctx, projectKey).UpsertFlagDefaultsPayload(upsertFlagDefaultsPayload).Execute()

Create or update flag defaults for project

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    projectKey := "projectKey_example" // string | The project key
    upsertFlagDefaultsPayload := *openapiclient.NewUpsertFlagDefaultsPayload([]string{"Tags_example"}, false, *openapiclient.NewDefaultClientSideAvailability(false, false), *openapiclient.NewBooleanFlagDefaults("TrueDisplayName_example", "FalseDisplayName_example", "TrueDescription_example", "FalseDescription_example", int32(123), int32(123))) // UpsertFlagDefaultsPayload | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ProjectsApi.PutFlagDefaultsByProject(context.Background(), projectKey).UpsertFlagDefaultsPayload(upsertFlagDefaultsPayload).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProjectsApi.PutFlagDefaultsByProject``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `PutFlagDefaultsByProject`: UpsertPayloadRep
    fmt.Fprintf(os.Stdout, "Response from `ProjectsApi.PutFlagDefaultsByProject`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
projectKey string The project key

Other Parameters

Other parameters are passed through a pointer to a apiPutFlagDefaultsByProjectRequest struct via the builder pattern

Name Type Description Notes

upsertFlagDefaultsPayload | UpsertFlagDefaultsPayload | |

Return type

UpsertPayloadRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]