Skip to content

Latest commit

 

History

History
941 lines (602 loc) · 27.2 KB

CodeReferencesApi.md

File metadata and controls

941 lines (602 loc) · 27.2 KB

\CodeReferencesApi

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

Method HTTP request Description
DeleteBranches Post /api/v2/code-refs/repositories/{repo}/branch-delete-tasks Delete branches
DeleteRepository Delete /api/v2/code-refs/repositories/{repo} Delete repository
GetBranch Get /api/v2/code-refs/repositories/{repo}/branches/{branch} Get branch
GetBranches Get /api/v2/code-refs/repositories/{repo}/branches List branches
GetExtinctions Get /api/v2/code-refs/extinctions List extinctions
GetRepositories Get /api/v2/code-refs/repositories List repositories
GetRepository Get /api/v2/code-refs/repositories/{repo} Get repository
GetRootStatistic Get /api/v2/code-refs/statistics Get links to code reference repositories for each project
GetStatistics Get /api/v2/code-refs/statistics/{projectKey} Get code references statistics for flags
PatchRepository Patch /api/v2/code-refs/repositories/{repo} Update repository
PostExtinction Post /api/v2/code-refs/repositories/{repo}/branches/{branch}/extinction-events Create extinction
PostRepository Post /api/v2/code-refs/repositories Create repository
PutBranch Put /api/v2/code-refs/repositories/{repo}/branches/{branch} Upsert branch

DeleteBranches

DeleteBranches(ctx, repo).RequestBody(requestBody).Execute()

Delete branches

Example

package main

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

func main() {
    repo := "repo_example" // string | The repository name to delete branches for.
    requestBody := []string{"Property_example"} // []string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CodeReferencesApi.DeleteBranches(context.Background(), repo).RequestBody(requestBody).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CodeReferencesApi.DeleteBranches``: %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.
repo string The repository name to delete branches for.

Other Parameters

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

Name Type Description Notes

requestBody | []string | |

Return type

(empty response body)

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]

DeleteRepository

DeleteRepository(ctx, repo).Execute()

Delete repository

Example

package main

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

func main() {
    repo := "repo_example" // string | The repository name

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CodeReferencesApi.DeleteRepository(context.Background(), repo).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CodeReferencesApi.DeleteRepository``: %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.
repo string The repository name

Other Parameters

Other parameters are passed through a pointer to a apiDeleteRepositoryRequest 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]

GetBranch

BranchRep GetBranch(ctx, repo, branch).ProjKey(projKey).FlagKey(flagKey).Execute()

Get branch

Example

package main

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

func main() {
    repo := "repo_example" // string | The repository name
    branch := "branch_example" // string | The url-encoded branch name
    projKey := "projKey_example" // string | Filter results to a specific project (optional)
    flagKey := "flagKey_example" // string | Filter results to a specific flag key (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CodeReferencesApi.GetBranch(context.Background(), repo, branch).ProjKey(projKey).FlagKey(flagKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CodeReferencesApi.GetBranch``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetBranch`: BranchRep
    fmt.Fprintf(os.Stdout, "Response from `CodeReferencesApi.GetBranch`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repo string The repository name
branch string The url-encoded branch name

Other Parameters

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

Name Type Description Notes

projKey | string | Filter results to a specific project | flagKey | string | Filter results to a specific flag key |

Return type

BranchRep

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]

GetBranches

BranchCollectionRep GetBranches(ctx, repo).Execute()

List branches

Example

package main

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

func main() {
    repo := "repo_example" // string | The repository name

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repo string The repository name

Other Parameters

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

Name Type Description Notes

Return type

BranchCollectionRep

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]

GetExtinctions

ExtinctionCollectionRep GetExtinctions(ctx).RepoName(repoName).BranchName(branchName).ProjKey(projKey).FlagKey(flagKey).From(from).To(to).Execute()

List extinctions

Example

package main

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

func main() {
    repoName := "repoName_example" // string | Filter results to a specific repository (optional)
    branchName := "branchName_example" // string | Filter results to a specific branch. By default, only the default branch will be queried for extinctions. (optional)
    projKey := "projKey_example" // string | Filter results to a specific project (optional)
    flagKey := "flagKey_example" // string | Filter results to a specific flag key (optional)
    from := int64(789) // int64 | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`. (optional)
    to := int64(789) // int64 | Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`. (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CodeReferencesApi.GetExtinctions(context.Background()).RepoName(repoName).BranchName(branchName).ProjKey(projKey).FlagKey(flagKey).From(from).To(to).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CodeReferencesApi.GetExtinctions``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetExtinctions`: ExtinctionCollectionRep
    fmt.Fprintf(os.Stdout, "Response from `CodeReferencesApi.GetExtinctions`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
repoName string Filter results to a specific repository
branchName string Filter results to a specific branch. By default, only the default branch will be queried for extinctions.
projKey string Filter results to a specific project
flagKey string Filter results to a specific flag key
from int64 Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `to`.
to int64 Filter results to a specific timeframe based on commit time, expressed as a Unix epoch time in milliseconds. Must be used with `from`.

Return type

ExtinctionCollectionRep

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]

GetRepositories

RepositoryCollectionRep GetRepositories(ctx).WithBranches(withBranches).WithReferencesForDefaultBranch(withReferencesForDefaultBranch).ProjKey(projKey).FlagKey(flagKey).Execute()

List repositories

Example

package main

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

func main() {
    withBranches := "withBranches_example" // string | If set to any value, the endpoint returns repositories with associated branch data (optional)
    withReferencesForDefaultBranch := "withReferencesForDefaultBranch_example" // string | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch (optional)
    projKey := "projKey_example" // string | A LaunchDarkly project key. If provided, this filters code reference results to the specified project. (optional)
    flagKey := "flagKey_example" // string | If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CodeReferencesApi.GetRepositories(context.Background()).WithBranches(withBranches).WithReferencesForDefaultBranch(withReferencesForDefaultBranch).ProjKey(projKey).FlagKey(flagKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CodeReferencesApi.GetRepositories``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetRepositories`: RepositoryCollectionRep
    fmt.Fprintf(os.Stdout, "Response from `CodeReferencesApi.GetRepositories`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
withBranches string If set to any value, the endpoint returns repositories with associated branch data
withReferencesForDefaultBranch string If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch
projKey string A LaunchDarkly project key. If provided, this filters code reference results to the specified project.
flagKey string If set to any value, the endpoint returns repositories with associated branch data, as well as code references for the default git branch

Return type

RepositoryCollectionRep

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]

GetRepository

RepositoryRep GetRepository(ctx, repo).Execute()

Get repository

Example

package main

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

func main() {
    repo := "repo_example" // string | The repository name

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repo string The repository name

Other Parameters

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

Name Type Description Notes

Return type

RepositoryRep

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]

GetRootStatistic

StatisticsRoot GetRootStatistic(ctx).Execute()

Get links to code reference repositories for each project

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

StatisticsRoot

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]

GetStatistics

StatisticCollectionRep GetStatistics(ctx, projectKey).FlagKey(flagKey).Execute()

Get code references statistics for flags

Example

package main

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

func main() {
    projectKey := "projectKey_example" // string | The project key
    flagKey := "flagKey_example" // string | Filter results to a specific flag key (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CodeReferencesApi.GetStatistics(context.Background(), projectKey).FlagKey(flagKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CodeReferencesApi.GetStatistics``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetStatistics`: StatisticCollectionRep
    fmt.Fprintf(os.Stdout, "Response from `CodeReferencesApi.GetStatistics`: %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 apiGetStatisticsRequest struct via the builder pattern

Name Type Description Notes

flagKey | string | Filter results to a specific flag key |

Return type

StatisticCollectionRep

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]

PatchRepository

RepositoryRep PatchRepository(ctx, repo).PatchOperation(patchOperation).Execute()

Update repository

Example

package main

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

func main() {
    repo := "repo_example" // string | The repository name
    patchOperation := []openapiclient.PatchOperation{*openapiclient.NewPatchOperation("replace", "/exampleField", interface{}(new example value))} // []PatchOperation | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
repo string The repository name

Other Parameters

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

Name Type Description Notes

patchOperation | []PatchOperation | |

Return type

RepositoryRep

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]

PostExtinction

PostExtinction(ctx, repo, branch).Extinction(extinction).Execute()

Create extinction

Example

package main

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

func main() {
    repo := "repo_example" // string | The repository name
    branch := "branch_example" // string | The URL-encoded branch name
    extinction := []openapiclient.Extinction{*openapiclient.NewExtinction("a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "Remove flag for launched feature", int64(123), "enable-feature", "default")} // []Extinction | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CodeReferencesApi.PostExtinction(context.Background(), repo, branch).Extinction(extinction).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CodeReferencesApi.PostExtinction``: %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.
repo string The repository name
branch string The URL-encoded branch name

Other Parameters

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

Name Type Description Notes

extinction | []Extinction | |

Return type

(empty response body)

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]

PostRepository

RepositoryRep PostRepository(ctx).RepositoryPost(repositoryPost).Execute()

Create repository

Example

package main

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

func main() {
    repositoryPost := *openapiclient.NewRepositoryPost("LaunchDarkly-Docs") // RepositoryPost | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
repositoryPost RepositoryPost

Return type

RepositoryRep

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]

PutBranch

PutBranch(ctx, repo, branch).PutBranch(putBranch).Execute()

Upsert branch

Example

package main

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

func main() {
    repo := "repo_example" // string | The repository name
    branch := "branch_example" // string | The URL-encoded branch name
    putBranch := *openapiclient.NewPutBranch("main", "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", int64(123)) // PutBranch | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.CodeReferencesApi.PutBranch(context.Background(), repo, branch).PutBranch(putBranch).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `CodeReferencesApi.PutBranch``: %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.
repo string The repository name
branch string The URL-encoded branch name

Other Parameters

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

Name Type Description Notes

putBranch | PutBranch | |

Return type

(empty response body)

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]