package
0.0.0-20231214144635-a707781cbb24
Repository: https://github.com/khulnasoft/codebase.git
Documentation: pkg.go.dev

# README

Bitbucket OpenAPI

This is trimmed version of generated bitbucket OpenAPI client, which contains Reports API only which is needed to use the Code Insights feature for khulnasoft/codebase.

Bitbucket API swagger definitions can be found here Bitbucket API.

Problems with official OpenAPI definitions

Unfortunately officially provided OpenAPI definition is not completely valid , see this issues:

  1. ktrysmt/go-bitbucket Issue #96

  2. JIRA Bitbucket Cloud/BCLOUD-17601 - api.bitbucket.org/swagger.json is broken

However, we were able to generate needed models via OpenAPI Generator CLI with --skip-validate-spec ignoring the errors.

Also, to make it work, in generated code URLs {workspace} need to be replaced with {username}, because BitBucket OpenAPI definition is not correct :shrug::

Resource URL is /2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}

but Path actual parameters are username, repo_slug, commit, reportId

Attempts to generate code

  • Go Swagger:

    $ swagger validate https://bitbucket.org/api/swagger.json
    json: cannot unmarshal bool into Go struct field SwaggerProps.definitions of type []string
    
  • OpenAPI Generator CLI:

    $ docker run --rm -v "${PWD}:/local" \
        openapitools/openapi-generator-cli generate \
             -i https://api.bitbucket.org/swagger.json
             -g go \
             -o /local/out/go
    ...
    Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
    | Error count: 53, Warning count: 17
    ...
    

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
NewConfiguration returns a new Configuration object.
NewErrorError instantiates a new ErrorError object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewErrorErrorWithDefaults instantiates a new ErrorError object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewModelError instantiates a new ModelError object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewModelErrorWithDefaults instantiates a new ModelError object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewObject instantiates a new Object object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewObjectWithDefaults instantiates a new Object object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewPaginatedAnnotations instantiates a new PaginatedAnnotations object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewPaginatedAnnotationsWithDefaults instantiates a new PaginatedAnnotations object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewPaginatedReports instantiates a new PaginatedReports object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewPaginatedReportsWithDefaults instantiates a new PaginatedReports object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewReport instantiates a new Report object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewReportAllOf instantiates a new ReportAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewReportAllOfWithDefaults instantiates a new ReportAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewReportAnnotation instantiates a new ReportAnnotation object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewReportAnnotationAllOf instantiates a new ReportAnnotationAllOf object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewReportAnnotationAllOfWithDefaults instantiates a new ReportAnnotationAllOf object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewReportAnnotationWithDefaults instantiates a new ReportAnnotation object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewReportData instantiates a new ReportData object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewReportDataWithDefaults instantiates a new ReportData object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewReportWithDefaults instantiates a new Report object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKeys takes a string apikey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextServerIndex uses a server configuration from the index.
ContextServerVariables overrides a server configuration variables.

# Structs

No description provided by the author
APIClient manages communication with the Bitbucket API API v2.0 In most cases there should be only one, shared, APIClient.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
Configuration stores the configuration of the API client.
ErrorError struct for ErrorError.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
ModelError Base type for most resource objects.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Object Base type for most resource objects.
PaginatedAnnotations A paginated list of annotations.
PaginatedReports A paginated list of reports.
Report struct for Report.
ReportAllOf A report for a commit.
ReportAnnotation struct for ReportAnnotation.
ReportAnnotationAllOf A report for a commit.
ReportData A key-value element that will be displayed along with the report.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.

# Type aliases

ReportsApiService ReportsApi service.
ServerConfigurations stores multiple ServerConfiguration items.