From f58b041b17dad9a2857bed9f99b76ff797eb4813 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 17:54:24 -0700 Subject: [PATCH] chore: speakeasy sdk regeneration - Generate (#19) * ci: regenerated with OpenAPI Doc v1, Speakeay CLI 1.65.0 * ci: regenerated with OpenAPI Doc v1, Speakeay CLI 1.65.1 * ci: regenerated with OpenAPI Doc v1, Speakeay CLI 1.65.1 * regenerate docs * ci: regenerated with OpenAPI Doc v1, Speakeay CLI 1.65.2 --------- Co-authored-by: speakeasybot Co-authored-by: Chris Dinh --- RELEASES.md | 26 +++++- docs/resources/grant_kit.md | 9 +- docs/resources/identity.md | 11 ++- examples/provider/provider.tf | 2 +- examples/resources/abbey_identity/resource.tf | 5 +- files.gen | 1 + gen.yaml | 8 +- internal/provider/grantkit_resource.go | 12 ++- internal/provider/grantkit_resource_sdk.go | 72 ++++++++++------ internal/provider/identity_resource.go | 58 +++++++++---- internal/provider/identity_resource_sdk.go | 25 ++++-- internal/provider/type_request.go | 1 + internal/provider/type_review.go | 1 + internal/provider/type_step.go | 4 +- internal/sdk/apikeys.go | 4 +- internal/sdk/connections.go | 8 +- internal/sdk/connectionspecs.go | 2 +- internal/sdk/demo.go | 6 +- internal/sdk/grantkits.go | 12 +-- internal/sdk/grants.go | 6 +- internal/sdk/identities.go | 86 ++++++++++++++++++- .../pkg/models/operations/updateidentity.go | 24 ++++++ .../sdk/pkg/models/shared/grantworkflow.go | 2 +- internal/sdk/pkg/models/shared/identity.go | 12 +-- .../sdk/pkg/models/shared/identityparams.go | 7 +- internal/sdk/pkg/models/shared/request.go | 1 + internal/sdk/pkg/models/shared/review.go | 1 + internal/sdk/pkg/models/shared/step.go | 4 +- internal/sdk/requests.go | 8 +- internal/sdk/reviews.go | 8 +- internal/sdk/sdk.go | 4 +- 31 files changed, 317 insertions(+), 113 deletions(-) create mode 100755 internal/sdk/pkg/models/operations/updateidentity.go diff --git a/RELEASES.md b/RELEASES.md index b8f6dea..f6067d2 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -52,4 +52,28 @@ Based on: ### Changes Based on: - OpenAPI Doc v1 -- Speakeasy CLI 1.65.0 (2.73.0) https://github.com/speakeasy-api/speakeasy \ No newline at end of file +- Speakeasy CLI 1.65.0 (2.73.0) https://github.com/speakeasy-api/speakeasy + +## 2023-07-26 00:04:10 +### Changes +Based on: +- OpenAPI Doc v1 +- Speakeasy CLI 1.65.0 (2.73.0) https://github.com/speakeasy-api/speakeasy + +## 2023-07-27 00:04:06 +### Changes +Based on: +- OpenAPI Doc v1 +- Speakeasy CLI 1.65.1 (2.73.1) https://github.com/speakeasy-api/speakeasy + +## 2023-07-27 04:31:21 +### Changes +Based on: +- OpenAPI Doc v1 +- Speakeasy CLI 1.65.1 (2.73.1) https://github.com/speakeasy-api/speakeasy + +## 2023-07-28 00:03:45 +### Changes +Based on: +- OpenAPI Doc v1 +- Speakeasy CLI 1.65.2 (2.75.1) https://github.com/speakeasy-api/speakeasy \ No newline at end of file diff --git a/docs/resources/grant_kit.md b/docs/resources/grant_kit.md index 396db83..4815267 100644 --- a/docs/resources/grant_kit.md +++ b/docs/resources/grant_kit.md @@ -72,19 +72,16 @@ Optional: ### Nested Schema for `workflow` -Required: +Optional: - `steps` (Attributes List) (see [below for nested schema](#nestedatt--workflow--steps)) ### Nested Schema for `workflow.steps` -Required: - -- `reviewers` (Attributes) (see [below for nested schema](#nestedatt--workflow--steps--reviewers)) - Optional: +- `reviewers` (Attributes) (see [below for nested schema](#nestedatt--workflow--steps--reviewers)) - `skip_if` (Attributes List) (see [below for nested schema](#nestedatt--workflow--steps--skip_if)) @@ -134,6 +131,7 @@ Read-Only: - `grant_kit_name` (String) - `grant_kit_version_id` (String) - `id` (String) +- `pull_request` (String) - `reason` (String) - `reviews` (Attributes List) (see [below for nested schema](#nestedatt--requests--reviews)) - `status` (String) must be one of [Pending, Denied, Approved, Canceled] @@ -151,6 +149,7 @@ Read-Only: - `grant_kit_name` (String) - `grant_kit_version_id` (String) - `id` (String) +- `pull_request` (String) - `reason` (String) - `request_id` (String) - `status` (String) must be one of [Pending, Denied, Approved, Canceled] diff --git a/docs/resources/identity.md b/docs/resources/identity.md index 505832e..be012e1 100644 --- a/docs/resources/identity.md +++ b/docs/resources/identity.md @@ -14,8 +14,9 @@ Identity Resource ```terraform resource "abbey_identity" "my_identity" { - linked = "...my_linked..." - name = "Johnnie Stamm" + abbey_account = "...my_abbey_account..." + metadata = "...my_metadata..." + source = "...my_source..." } ``` @@ -24,12 +25,14 @@ resource "abbey_identity" "my_identity" { ### Required -- `linked` (String) Json encoded string. See documentation for details -- `name` (String) +- `abbey_account` (String) +- `metadata` (String) Json encoded string. See documentation for details. +- `source` (String) ### Read-Only - `created_at` (String) - `id` (String) The ID of this resource. +- `updated_at` (String) diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 932585d..c6b235a 100755 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -2,7 +2,7 @@ terraform { required_providers { abbey = { source = "abbeylabs/abbey" - version = "2.1.0" + version = "2.2.0" } } } diff --git a/examples/resources/abbey_identity/resource.tf b/examples/resources/abbey_identity/resource.tf index 5127548..ac0e26f 100755 --- a/examples/resources/abbey_identity/resource.tf +++ b/examples/resources/abbey_identity/resource.tf @@ -1,4 +1,5 @@ resource "abbey_identity" "my_identity" { - linked = "...my_linked..." - name = "Johnnie Stamm" + abbey_account = "...my_abbey_account..." + metadata = "...my_metadata..." + source = "...my_source..." } \ No newline at end of file diff --git a/files.gen b/files.gen index 6d087ee..e261550 100755 --- a/files.gen +++ b/files.gen @@ -86,6 +86,7 @@ internal/sdk/pkg/models/operations/revokegrant.go internal/sdk/pkg/models/operations/createidentity.go internal/sdk/pkg/models/operations/deleteidentity.go internal/sdk/pkg/models/operations/getidentity.go +internal/sdk/pkg/models/operations/updateidentity.go internal/sdk/pkg/models/operations/cancelrequestbyid.go internal/sdk/pkg/models/operations/createrequest.go internal/sdk/pkg/models/operations/getrequestbyid.go diff --git a/gen.yaml b/gen.yaml index 50e0d10..97d9648 100755 --- a/gen.yaml +++ b/gen.yaml @@ -1,13 +1,13 @@ configVersion: 1.0.0 management: - docChecksum: ad48929d9282323a385d356a103808af + docChecksum: 1782e6a415dc8b830f4be9836e6c6fe6 docVersion: v1 - speakeasyVersion: 1.65.0 - generationVersion: 2.73.0 + speakeasyVersion: 1.65.2 + generationVersion: 2.75.1 generation: sdkClassName: SDK singleTagPerOp: false terraform: - version: 2.1.0 + version: 2.2.0 author: abbeylabs packageName: abbey diff --git a/internal/provider/grantkit_resource.go b/internal/provider/grantkit_resource.go index 2c83107..aa029af 100755 --- a/internal/provider/grantkit_resource.go +++ b/internal/provider/grantkit_resource.go @@ -170,6 +170,9 @@ func (r *GrantKitResource) Schema(ctx context.Context, req resource.SchemaReques "id": schema.StringAttribute{ Computed: true, }, + "pull_request": schema.StringAttribute{ + Computed: true, + }, "reason": schema.StringAttribute{ Computed: true, }, @@ -234,6 +237,9 @@ func (r *GrantKitResource) Schema(ctx context.Context, req resource.SchemaReques "id": schema.StringAttribute{ Computed: true, }, + "pull_request": schema.StringAttribute{ + Computed: true, + }, "reason": schema.StringAttribute{ Computed: true, }, @@ -302,11 +308,13 @@ func (r *GrantKitResource) Schema(ctx context.Context, req resource.SchemaReques Optional: true, Attributes: map[string]schema.Attribute{ "steps": schema.ListNestedAttribute{ - Required: true, + Computed: true, + Optional: true, NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "reviewers": schema.SingleNestedAttribute{ - Required: true, + Computed: true, + Optional: true, Attributes: map[string]schema.Attribute{ "all_of": schema.ListAttribute{ Computed: true, diff --git a/internal/provider/grantkit_resource_sdk.go b/internal/provider/grantkit_resource_sdk.go index 9316f45..6e1428f 100755 --- a/internal/provider/grantkit_resource_sdk.go +++ b/internal/provider/grantkit_resource_sdk.go @@ -52,17 +52,20 @@ func (r *GrantKitResourceModel) ToCreateSDKType() *shared.GrantKitCreateParams { if r.Workflow != nil { steps := make([]shared.Step, 0) for _, stepsItem := range r.Workflow.Steps { - allOf := make([]string, 0) - for _, allOfItem := range stepsItem.Reviewers.AllOf { - allOf = append(allOf, allOfItem.ValueString()) - } - oneOf := make([]string, 0) - for _, oneOfItem := range stepsItem.Reviewers.OneOf { - oneOf = append(oneOf, oneOfItem.ValueString()) - } - reviewers := shared.Reviewers{ - AllOf: allOf, - OneOf: oneOf, + var reviewers *shared.Reviewers + if stepsItem.Reviewers != nil { + allOf := make([]string, 0) + for _, allOfItem := range stepsItem.Reviewers.AllOf { + allOf = append(allOf, allOfItem.ValueString()) + } + oneOf := make([]string, 0) + for _, oneOfItem := range stepsItem.Reviewers.OneOf { + oneOf = append(oneOf, oneOfItem.ValueString()) + } + reviewers = &shared.Reviewers{ + AllOf: allOf, + OneOf: oneOf, + } } skipIf := make([]shared.Policy, 0) for _, skipIfItem := range stepsItem.SkipIf { @@ -151,17 +154,20 @@ func (r *GrantKitResourceModel) ToUpdateSDKType() *shared.GrantKitUpdateParams { if r.Workflow != nil { steps := make([]shared.Step, 0) for _, stepsItem := range r.Workflow.Steps { - allOf := make([]string, 0) - for _, allOfItem := range stepsItem.Reviewers.AllOf { - allOf = append(allOf, allOfItem.ValueString()) - } - oneOf := make([]string, 0) - for _, oneOfItem := range stepsItem.Reviewers.OneOf { - oneOf = append(oneOf, oneOfItem.ValueString()) - } - reviewers := shared.Reviewers{ - AllOf: allOf, - OneOf: oneOf, + var reviewers *shared.Reviewers + if stepsItem.Reviewers != nil { + allOf := make([]string, 0) + for _, allOfItem := range stepsItem.Reviewers.AllOf { + allOf = append(allOf, allOfItem.ValueString()) + } + oneOf := make([]string, 0) + for _, oneOfItem := range stepsItem.Reviewers.OneOf { + oneOf = append(oneOf, oneOfItem.ValueString()) + } + reviewers = &shared.Reviewers{ + AllOf: allOf, + OneOf: oneOf, + } } skipIf := make([]shared.Policy, 0) for _, skipIfItem := range stepsItem.SkipIf { @@ -265,6 +271,7 @@ func (r *GrantKitResourceModel) RefreshFromGetResponse(resp *shared.GrantKit) { } requests1.GrantKitVersionID = types.StringValue(requestsItem.GrantKitVersionID) requests1.ID = types.StringValue(requestsItem.ID) + requests1.PullRequest = types.StringValue(requestsItem.PullRequest) requests1.Reason = types.StringValue(requestsItem.Reason) requests1.Reviews = nil for _, reviewsItem := range requestsItem.Reviews { @@ -291,6 +298,7 @@ func (r *GrantKitResourceModel) RefreshFromGetResponse(resp *shared.GrantKit) { reviews1.GrantKitName = types.StringValue(reviewsItem.GrantKitName) reviews1.GrantKitVersionID = types.StringValue(reviewsItem.GrantKitVersionID) reviews1.ID = types.StringValue(reviewsItem.ID) + reviews1.PullRequest = types.StringValue(reviewsItem.PullRequest) reviews1.Reason = types.StringValue(reviewsItem.Reason) reviews1.RequestID = types.StringValue(reviewsItem.RequestID) reviews1.Status = types.StringValue(string(reviewsItem.Status)) @@ -319,13 +327,21 @@ func (r *GrantKitResourceModel) RefreshFromGetResponse(resp *shared.GrantKit) { r.Workflow.Steps = nil for _, stepsItem := range resp.Workflow.Steps { var steps1 Step - steps1.Reviewers.AllOf = nil - for _, v := range stepsItem.Reviewers.AllOf { - steps1.Reviewers.AllOf = append(steps1.Reviewers.AllOf, types.StringValue(v)) + if steps1.Reviewers == nil { + steps1.Reviewers = &Reviewers{} } - steps1.Reviewers.OneOf = nil - for _, v := range stepsItem.Reviewers.OneOf { - steps1.Reviewers.OneOf = append(steps1.Reviewers.OneOf, types.StringValue(v)) + if stepsItem.Reviewers == nil { + steps1.Reviewers = nil + } else { + steps1.Reviewers = &Reviewers{} + steps1.Reviewers.AllOf = nil + for _, v := range stepsItem.Reviewers.AllOf { + steps1.Reviewers.AllOf = append(steps1.Reviewers.AllOf, types.StringValue(v)) + } + steps1.Reviewers.OneOf = nil + for _, v := range stepsItem.Reviewers.OneOf { + steps1.Reviewers.OneOf = append(steps1.Reviewers.OneOf, types.StringValue(v)) + } } steps1.SkipIf = nil for _, skipIfItem := range stepsItem.SkipIf { diff --git a/internal/provider/identity_resource.go b/internal/provider/identity_resource.go index 6aa499b..65ca10f 100755 --- a/internal/provider/identity_resource.go +++ b/internal/provider/identity_resource.go @@ -12,8 +12,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/path" "github.com/hashicorp/terraform-plugin-framework/resource" "github.com/hashicorp/terraform-plugin-framework/resource/schema" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" - "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" "github.com/hashicorp/terraform-plugin-framework/types/basetypes" @@ -34,10 +32,12 @@ type IdentityResource struct { // IdentityResourceModel describes the resource data model. type IdentityResourceModel struct { - CreatedAt types.String `tfsdk:"created_at"` - ID types.String `tfsdk:"id"` - Linked types.String `tfsdk:"linked"` - Name types.String `tfsdk:"name"` + AbbeyAccount types.String `tfsdk:"abbey_account"` + CreatedAt types.String `tfsdk:"created_at"` + ID types.String `tfsdk:"id"` + Metadata types.String `tfsdk:"metadata"` + Source types.String `tfsdk:"source"` + UpdatedAt types.String `tfsdk:"updated_at"` } func (r *IdentityResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse) { @@ -49,6 +49,9 @@ func (r *IdentityResource) Schema(ctx context.Context, req resource.SchemaReques MarkdownDescription: "Identity Resource", Attributes: map[string]schema.Attribute{ + "abbey_account": schema.StringAttribute{ + Required: true, + }, "created_at": schema.StringAttribute{ Computed: true, Validators: []validator.String{ @@ -58,19 +61,19 @@ func (r *IdentityResource) Schema(ctx context.Context, req resource.SchemaReques "id": schema.StringAttribute{ Computed: true, }, - "linked": schema.StringAttribute{ - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, + "metadata": schema.StringAttribute{ Required: true, - Description: `Json encoded string. See documentation for details`, + Description: `Json encoded string. See documentation for details.`, }, - "name": schema.StringAttribute{ - PlanModifiers: []planmodifier.String{ - stringplanmodifier.RequiresReplace(), - }, + "source": schema.StringAttribute{ Required: true, }, + "updated_at": schema.StringAttribute{ + Computed: true, + Validators: []validator.String{ + validators.IsRFC3339(), + }, + }, }, } } @@ -189,7 +192,30 @@ func (r *IdentityResource) Update(ctx context.Context, req resource.UpdateReques return } - // Not Implemented; all attributes marked as RequiresReplace + identityParams := *data.ToUpdateSDKType() + identityID := data.ID.ValueString() + request := operations.UpdateIdentityRequest{ + IdentityParams: identityParams, + IdentityID: identityID, + } + res, err := r.client.Identities.UpdateIdentity(ctx, request) + if err != nil { + resp.Diagnostics.AddError("failure to invoke API", err.Error()) + return + } + if res == nil { + resp.Diagnostics.AddError("unexpected response from API", fmt.Sprintf("%v", res)) + return + } + if res.StatusCode != 200 { + resp.Diagnostics.AddError(fmt.Sprintf("unexpected response from API. Got an unexpected response code %v", res.StatusCode), debugResponse(res.RawResponse)) + return + } + if res.Identity == nil { + resp.Diagnostics.AddError("unexpected response from API. No response body", debugResponse(res.RawResponse)) + return + } + data.RefreshFromUpdateResponse(res.Identity) // Save updated data into Terraform state resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) diff --git a/internal/provider/identity_resource_sdk.go b/internal/provider/identity_resource_sdk.go index ea73321..46b40fe 100755 --- a/internal/provider/identity_resource_sdk.go +++ b/internal/provider/identity_resource_sdk.go @@ -9,11 +9,13 @@ import ( ) func (r *IdentityResourceModel) ToCreateSDKType() *shared.IdentityParams { - linked := r.Linked.ValueString() - name := r.Name.ValueString() + abbeyAccount := r.AbbeyAccount.ValueString() + metadata := r.Metadata.ValueString() + source := r.Source.ValueString() out := shared.IdentityParams{ - Linked: linked, - Name: name, + AbbeyAccount: abbeyAccount, + Metadata: metadata, + Source: source, } return &out } @@ -23,18 +25,29 @@ func (r *IdentityResourceModel) ToGetSDKType() *shared.IdentityParams { return out } +func (r *IdentityResourceModel) ToUpdateSDKType() *shared.IdentityParams { + out := r.ToCreateSDKType() + return out +} + func (r *IdentityResourceModel) ToDeleteSDKType() *shared.IdentityParams { out := r.ToCreateSDKType() return out } func (r *IdentityResourceModel) RefreshFromGetResponse(resp *shared.Identity) { + r.AbbeyAccount = types.StringValue(resp.AbbeyAccount) r.CreatedAt = types.StringValue(resp.CreatedAt.Format(time.RFC3339)) r.ID = types.StringValue(resp.ID) - r.Linked = types.StringValue(resp.Linked) - r.Name = types.StringValue(resp.Name) + r.Metadata = types.StringValue(resp.Metadata) + r.Source = types.StringValue(resp.Source) + r.UpdatedAt = types.StringValue(resp.UpdatedAt.Format(time.RFC3339)) } func (r *IdentityResourceModel) RefreshFromCreateResponse(resp *shared.Identity) { r.RefreshFromGetResponse(resp) } + +func (r *IdentityResourceModel) RefreshFromUpdateResponse(resp *shared.Identity) { + r.RefreshFromGetResponse(resp) +} diff --git a/internal/provider/type_request.go b/internal/provider/type_request.go index 3cccc88..867254c 100755 --- a/internal/provider/type_request.go +++ b/internal/provider/type_request.go @@ -11,6 +11,7 @@ type Request struct { GrantKitName types.String `tfsdk:"grant_kit_name"` GrantKitVersionID types.String `tfsdk:"grant_kit_version_id"` ID types.String `tfsdk:"id"` + PullRequest types.String `tfsdk:"pull_request"` Reason types.String `tfsdk:"reason"` Reviews []Review `tfsdk:"reviews"` Status types.String `tfsdk:"status"` diff --git a/internal/provider/type_review.go b/internal/provider/type_review.go index dcf9472..6d9c8b3 100755 --- a/internal/provider/type_review.go +++ b/internal/provider/type_review.go @@ -11,6 +11,7 @@ type Review struct { GrantKitName types.String `tfsdk:"grant_kit_name"` GrantKitVersionID types.String `tfsdk:"grant_kit_version_id"` ID types.String `tfsdk:"id"` + PullRequest types.String `tfsdk:"pull_request"` Reason types.String `tfsdk:"reason"` RequestID types.String `tfsdk:"request_id"` Status types.String `tfsdk:"status"` diff --git a/internal/provider/type_step.go b/internal/provider/type_step.go index 4657448..e05cdb4 100755 --- a/internal/provider/type_step.go +++ b/internal/provider/type_step.go @@ -3,6 +3,6 @@ package provider type Step struct { - Reviewers Reviewers `tfsdk:"reviewers"` - SkipIf []Policy `tfsdk:"skip_if"` + Reviewers *Reviewers `tfsdk:"reviewers"` + SkipIf []Policy `tfsdk:"skip_if"` } diff --git a/internal/sdk/apikeys.go b/internal/sdk/apikeys.go index a988713..4ba6a2a 100755 --- a/internal/sdk/apikeys.go +++ b/internal/sdk/apikeys.go @@ -45,7 +45,7 @@ func (s *apiKeys) CreateAPIKey(ctx context.Context, request shared.APIKeysCreate if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -118,7 +118,7 @@ func (s *apiKeys) GetAPIKeys(ctx context.Context) (*operations.GetAPIKeysRespons if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient diff --git a/internal/sdk/connections.go b/internal/sdk/connections.go index d482ee0..20d81e6 100755 --- a/internal/sdk/connections.go +++ b/internal/sdk/connections.go @@ -47,7 +47,7 @@ func (s *connections) CreateConnection(ctx context.Context, request shared.Conne if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -123,7 +123,7 @@ func (s *connections) GetConnection(ctx context.Context, request operations.GetC if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -193,7 +193,7 @@ func (s *connections) ListConnections(ctx context.Context) (*operations.ListConn if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -271,7 +271,7 @@ func (s *connections) UpdateConnection(ctx context.Context, request operations.U if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) diff --git a/internal/sdk/connectionspecs.go b/internal/sdk/connectionspecs.go index ff19a81..6c4a3bf 100755 --- a/internal/sdk/connectionspecs.go +++ b/internal/sdk/connectionspecs.go @@ -39,7 +39,7 @@ func (s *connectionSpecs) ListConnectionSpecs(ctx context.Context) (*operations. if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient diff --git a/internal/sdk/demo.go b/internal/sdk/demo.go index 7557a2e..f8602a7 100755 --- a/internal/sdk/demo.go +++ b/internal/sdk/demo.go @@ -41,7 +41,7 @@ func (s *demo) CreateDemo(ctx context.Context, request shared.DemoParams) (*oper if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -117,7 +117,7 @@ func (s *demo) DeleteDemo(ctx context.Context, request shared.DemoParams) (*oper if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -188,7 +188,7 @@ func (s *demo) GetDemo(ctx context.Context) (*operations.GetDemoResponse, error) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient diff --git a/internal/sdk/grantkits.go b/internal/sdk/grantkits.go index 0dbed4e..a46278b 100755 --- a/internal/sdk/grantkits.go +++ b/internal/sdk/grantkits.go @@ -50,7 +50,7 @@ func (s *grantKits) CreateGrantKit(ctx context.Context, request shared.GrantKitC if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -125,7 +125,7 @@ func (s *grantKits) ListGrantKits(ctx context.Context) (*operations.ListGrantKit if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -195,7 +195,7 @@ func (s *grantKits) DeleteGrantKit(ctx context.Context, request operations.Delet if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -267,7 +267,7 @@ func (s *grantKits) GetGrantKitByID(ctx context.Context, request operations.GetG if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -341,7 +341,7 @@ func (s *grantKits) ListGrantKitVersionsByID(ctx context.Context, request operat if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -421,7 +421,7 @@ func (s *grantKits) UpdateGrantKit(ctx context.Context, request operations.Updat if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) diff --git a/internal/sdk/grants.go b/internal/sdk/grants.go index 4c0a411..cb9f056 100755 --- a/internal/sdk/grants.go +++ b/internal/sdk/grants.go @@ -43,7 +43,7 @@ func (s *grants) ListGrants(ctx context.Context) (*operations.ListGrantsResponse if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -113,7 +113,7 @@ func (s *grants) GetGrantByID(ctx context.Context, request operations.GetGrantBy if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -185,7 +185,7 @@ func (s *grants) RevokeGrant(ctx context.Context, request operations.RevokeGrant if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient diff --git a/internal/sdk/identities.go b/internal/sdk/identities.go index ec04fc2..de94b2a 100755 --- a/internal/sdk/identities.go +++ b/internal/sdk/identities.go @@ -48,7 +48,7 @@ func (s *identities) CreateIdentity(ctx context.Context, request shared.Identity if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -187,7 +187,7 @@ func (s *identities) GetIdentity(ctx context.Context, request operations.GetIden if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -245,3 +245,85 @@ func (s *identities) GetIdentity(ctx context.Context, request operations.GetIden return res, nil } + +// UpdateIdentity - Update an Identity +// Updates an identity. +func (s *identities) UpdateIdentity(ctx context.Context, request operations.UpdateIdentityRequest) (*operations.UpdateIdentityResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/identities/{identity_id}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "IdentityParams", "json") + if err != nil { + return nil, fmt.Errorf("error serializing request body: %w", err) + } + if bodyReader == nil { + return nil, fmt.Errorf("request body is required") + } + + req, err := http.NewRequestWithContext(ctx, "PUT", url, bodyReader) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) + + req.Header.Set("Content-Type", reqContentType) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.UpdateIdentityResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out *shared.Identity + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + return nil, err + } + + res.Identity = out + } + case httpRes.StatusCode == 401: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode == 429: + fallthrough + default: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out *shared.Error + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil { + return nil, err + } + + res.Error = out + } + } + + return res, nil +} diff --git a/internal/sdk/pkg/models/operations/updateidentity.go b/internal/sdk/pkg/models/operations/updateidentity.go new file mode 100755 index 0000000..ffb6532 --- /dev/null +++ b/internal/sdk/pkg/models/operations/updateidentity.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "abbey/v2/internal/sdk/pkg/models/shared" + "net/http" +) + +type UpdateIdentityRequest struct { + IdentityParams shared.IdentityParams `request:"mediaType=application/json"` + // The ID of the identity to retrieve + IdentityID string `pathParam:"style=simple,explode=false,name=identity_id"` +} + +type UpdateIdentityResponse struct { + ContentType string + // Authentication Failed + Error *shared.Error + // Success + Identity *shared.Identity + StatusCode int + RawResponse *http.Response +} diff --git a/internal/sdk/pkg/models/shared/grantworkflow.go b/internal/sdk/pkg/models/shared/grantworkflow.go index d022d68..69f5acd 100755 --- a/internal/sdk/pkg/models/shared/grantworkflow.go +++ b/internal/sdk/pkg/models/shared/grantworkflow.go @@ -3,5 +3,5 @@ package shared type GrantWorkflow struct { - Steps []Step `json:"steps"` + Steps []Step `json:"steps,omitempty"` } diff --git a/internal/sdk/pkg/models/shared/identity.go b/internal/sdk/pkg/models/shared/identity.go index 8af65da..7ae3090 100755 --- a/internal/sdk/pkg/models/shared/identity.go +++ b/internal/sdk/pkg/models/shared/identity.go @@ -8,9 +8,11 @@ import ( // Identity - Created type Identity struct { - CreatedAt time.Time `json:"created_at"` - ID string `json:"id"` - // Json encoded string. See documentation for details - Linked string `json:"linked"` - Name string `json:"name"` + AbbeyAccount string `json:"abbey_account"` + CreatedAt time.Time `json:"created_at"` + ID string `json:"id"` + // Json encoded string. See documentation for details. + Metadata string `json:"metadata"` + Source string `json:"source"` + UpdatedAt time.Time `json:"updated_at"` } diff --git a/internal/sdk/pkg/models/shared/identityparams.go b/internal/sdk/pkg/models/shared/identityparams.go index 78fd333..8229508 100755 --- a/internal/sdk/pkg/models/shared/identityparams.go +++ b/internal/sdk/pkg/models/shared/identityparams.go @@ -3,7 +3,8 @@ package shared type IdentityParams struct { - // Json encoded string. See documentation for details - Linked string `json:"linked"` - Name string `json:"name"` + AbbeyAccount string `json:"abbey_account"` + // Json encoded string. See documentation for details. + Metadata string `json:"metadata"` + Source string `json:"source"` } diff --git a/internal/sdk/pkg/models/shared/request.go b/internal/sdk/pkg/models/shared/request.go index 8c03d6b..e7841bc 100755 --- a/internal/sdk/pkg/models/shared/request.go +++ b/internal/sdk/pkg/models/shared/request.go @@ -14,6 +14,7 @@ type Request struct { GrantKitName *string `json:"grant_kit_name,omitempty"` GrantKitVersionID string `json:"grant_kit_version_id"` ID string `json:"id"` + PullRequest string `json:"pull_request"` Reason string `json:"reason"` Reviews []Review `json:"reviews,omitempty"` Status RequestStatus `json:"status"` diff --git a/internal/sdk/pkg/models/shared/review.go b/internal/sdk/pkg/models/shared/review.go index a8abb21..3f6eb75 100755 --- a/internal/sdk/pkg/models/shared/review.go +++ b/internal/sdk/pkg/models/shared/review.go @@ -14,6 +14,7 @@ type Review struct { GrantKitName string `json:"grant_kit_name"` GrantKitVersionID string `json:"grant_kit_version_id"` ID string `json:"id"` + PullRequest string `json:"pull_request"` Reason string `json:"reason"` RequestID string `json:"request_id"` Status ReviewStatus `json:"status"` diff --git a/internal/sdk/pkg/models/shared/step.go b/internal/sdk/pkg/models/shared/step.go index 473b742..c21ed97 100755 --- a/internal/sdk/pkg/models/shared/step.go +++ b/internal/sdk/pkg/models/shared/step.go @@ -3,6 +3,6 @@ package shared type Step struct { - Reviewers Reviewers `json:"reviewers"` - SkipIf []Policy `json:"skip_if,omitempty"` + Reviewers *Reviewers `json:"reviewers,omitempty"` + SkipIf []Policy `json:"skip_if,omitempty"` } diff --git a/internal/sdk/requests.go b/internal/sdk/requests.go index 0c891f3..b5509e8 100755 --- a/internal/sdk/requests.go +++ b/internal/sdk/requests.go @@ -48,7 +48,7 @@ func (s *requests) CancelRequestByID(ctx context.Context, request operations.Can if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -137,7 +137,7 @@ func (s *requests) CreateRequest(ctx context.Context, request shared.RequestPara if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -213,7 +213,7 @@ func (s *requests) GetRequestByID(ctx context.Context, request operations.GetReq if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -284,7 +284,7 @@ func (s *requests) ListRequests(ctx context.Context) (*operations.ListRequestsRe if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient diff --git a/internal/sdk/reviews.go b/internal/sdk/reviews.go index add4c0f..38bd6e2 100755 --- a/internal/sdk/reviews.go +++ b/internal/sdk/reviews.go @@ -41,7 +41,7 @@ func (s *reviews) ListReviews(ctx context.Context) (*operations.ListReviewsRespo if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient @@ -119,7 +119,7 @@ func (s *reviews) ApproveReview(ctx context.Context, request operations.ApproveR if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -205,7 +205,7 @@ func (s *reviews) DenyReview(ctx context.Context, request operations.DenyReviewR if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) req.Header.Set("Content-Type", reqContentType) @@ -283,7 +283,7 @@ func (s *reviews) GetReviewByID(ctx context.Context, request operations.GetRevie if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } - req.Header.Set("Accept", "application/json;q=1, application/json;q=0") + req.Header.Set("Accept", "application/json") req.Header.Set("user-agent", fmt.Sprintf("speakeasy-sdk/%s %s %s %s", s.sdkConfiguration.Language, s.sdkConfiguration.SDKVersion, s.sdkConfiguration.GenVersion, s.sdkConfiguration.OpenAPIDocVersion)) client := s.sdkConfiguration.SecurityClient diff --git a/internal/sdk/sdk.go b/internal/sdk/sdk.go index eba9e03..76d03f0 100755 --- a/internal/sdk/sdk.go +++ b/internal/sdk/sdk.go @@ -177,8 +177,8 @@ func New(opts ...SDKOption) *SDK { sdkConfiguration: sdkConfiguration{ Language: "terraform", OpenAPIDocVersion: "v1", - SDKVersion: "2.1.0", - GenVersion: "2.73.0", + SDKVersion: "2.2.0", + GenVersion: "2.75.1", }, } for _, opt := range opts {